Bug 34640 - Bindings lost in copy/move using mysql store
Summary: Bindings lost in copy/move using mysql store
Status: NEW
Alias: None
Product: Slide
Classification: Unclassified
Component: Stores (show other bugs)
Version: Nightly
Hardware: Other other
: P2 normal (vote)
Target Milestone: ---
Assignee: Slide Developer List
Depends on:
Reported: 2005-04-27 00:11 UTC by Tara Talbott
Modified: 2005-04-26 16:11 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Tara Talbott 2005-04-27 00:11:41 UTC
We have noticed that if a collection is created and a resource added to it, 
then if you copy or move the collection the bindings between it and the child 
are lost (although typically this isn't noticed until the server is restarted 
because of caching).  This is because in the clear bindings method of the 
MySqlRDMSAdapter it deletes bindings based on the updated child uris only.  
And on a copy or move the children for the original ObjectNode are passed in. 
If the method is modified to check the for the parent half of the binding as 
well as the child in the delete binding statement it seems to fix the problem.

Below are changes to MySqlRDBMSAdapter which should fix the problem.

~line 219 
                statement =
+                    connection.prepareStatement(
+                        deleteStatement("BINDING","c",", URI u, URI u2 where 
+u.URI_ID = c.CHILD_UURI_ID and u2.URI_ID = c.URI_ID and u.URI_STRING IN "
+                            + bindings + " and u2.URI_STRING = ?") );
-                    connection.prepareStatement(
-                        deleteStatement("BINDING","c",", URI u where 
-                            + bindings ) );

~lines 225 - 230
+               int i = 0;
+                for (i = 1; iter.hasNext(); i++) {
-                for (int i = 1; iter.hasNext(); i++) {
                    String next = iter.next().toString();
                    statement.setString(i, next);
+                statement.setString(i++, uri.toString());