DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=34640>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=34640

           Summary: Bindings lost in copy/move using mysql store
           Product: Slide
           Version: Nightly
          Platform: Other
        OS/Version: other
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Stores
        AssignedTo: slide-dev@jakarta.apache.org
        ReportedBy: [EMAIL PROTECTED]


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 
-u.URI_ID = c.CHILD_UURI_ID and u.URI_STRING IN "
-                            + 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());

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to