Index: /cats/SCHEMAcat/trunk/urn.org.isocat.schemacat.access.data/access/schemaMetadata.dpml
===================================================================
--- /cats/SCHEMAcat/trunk/urn.org.isocat.schemacat.access.data/access/schemaMetadata.dpml	(revision 4655)
+++ /cats/SCHEMAcat/trunk/urn.org.isocat.schemacat.access.data/access/schemaMetadata.dpml	(revision 4656)
@@ -111,12 +111,18 @@
                                                         error(xs:QName('sc:metadataFieldSchemaIdNotSupplied'),'ERROR updating schema metadata field: schema ID not supplied!')
                                                     else
-                                                        if(/sc:schema[@xml:id = $schemaID]/*/name() = $metadataField/name())
-                                                        then
-                                                            (db:output(element sc:response {attribute success {'true'}, element sc:written-data {$metadataField} }), 
-                                                                replace node /sc:schema[@xml:id = $schemaID]/*[name() eq $metadataField/name()] with $metadataField)
-                                                        else
-                                                            (db:output(element sc:response {attribute success {'true'}, element sc:written-data {$metadataField} }), 
-                                                                insert node $metadataField into /sc:schema[@xml:id = $schemaID])       
-                                                                else error(xs:QName('sc:metadataFieldNamespaceError'),'ERROR updating schema metadata field: supplied namespace prefix in metadata fragment field is not "sc".')
+                                                    (
+                                                        let $db-name := db:name(/sc:schema[@xml:id = $schemaID])
+                                                        return
+                                                            if(/sc:schema[@xml:id = $schemaID]/*/name() = $metadataField/name())
+                                                            then
+                                                                (db:output(element sc:response {attribute success {'true'}, element sc:written-data {$metadataField} }), 
+                                                                    replace node /sc:schema[@xml:id = $schemaID]/*[name() eq $metadataField/name()] with $metadataField,
+                                                                    put(/sc:schema[@xml:id = $schemaID],concat(string(db:list-details()[.= $db-name]/@path),file:dir-separator(),db:path(/sc:schema[@xml:id = $schemaID]))))
+                                                            else
+                                                                (db:output(element sc:response {attribute success {'true'}, element sc:written-data {$metadataField} }), 
+                                                                    insert node $metadataField into /sc:schema[@xml:id = $schemaID],
+                                                                    put(/sc:schema[@xml:id = $schemaID],concat(string(db:list-details()[. = $db-name]/@path),file:dir-separator(),db:path(/sc:schema[@xml:id = $schemaID]))))
+                                                    )
+                                                 else error(xs:QName('sc:metadataFieldNamespaceError'),'ERROR updating schema metadata field: supplied namespace prefix in metadata fragment field is not "sc".')
                                             else error(xs:QName('sc:metadataFragmentNamespaceError'),'ERROR updating schema metadata field: supplied namespace prefix in metadata fragment is not "sc".')
                                     </query>
Index: /cats/SCHEMAcat/trunk/urn.org.isocat.schemacat.access.data/access/user.dpml
===================================================================
--- /cats/SCHEMAcat/trunk/urn.org.isocat.schemacat.access.data/access/user.dpml	(revision 4655)
+++ /cats/SCHEMAcat/trunk/urn.org.isocat.schemacat.access.data/access/user.dpml	(revision 4656)
@@ -91,5 +91,10 @@
 									return 
 										if (empty($old-user)) then 
-											(db:output(element sc:response {attribute success {'true'}, element sc:written-data {$new-user}}), insert node $new-user into /sc:users)
+											(
+												let $db-name := db:name(/sc:users)
+												return 
+													(db:output(element sc:response {attribute success {'true'}, element sc:written-data {$new-user}}), insert node $new-user into /sc:users,
+													put(/sc:users,concat(string(db:list-details()[. = $db-name]),file:dir-separator(),db:path(/sc:users))))
+											)
 										else 
 											(error(xs:QName('sc:uniqueUser'),'There exists already an user with this id or principal!')) 
@@ -174,5 +179,10 @@
 											(error(xs:QName('sc:nonExistingUser'),'User matching specified id or principal not found!')) 
 										else 
-											(db:output(element sc:response {attribute success {'true'}, element sc:written-data {$newUser}}), replace node /sc:users/sc:user[(@xml:id eq $args/id) or (sc:principal eq $args/principal)] with $newUser)
+											(
+												let $db-name := db:name(/sc:users)
+												return (
+													db:output(element sc:response {attribute success {'true'}, element sc:written-data {$newUser}}), replace node /sc:users/sc:user[(@xml:id eq $args/id) or (sc:principal eq $args/principal)] with $newUser,
+													put(/sc:users,concat(string(db:list-details()[. = $db-name]/@path),file:dir-separator(),db:path(/sc:users))))
+											)
 								</query>
 						</literal>
