wburrows 2004/12/07 13:07:22
Modified: src/stores/org/apache/slide/store/impl/rdbms
DB2RDBMSAdapter.java
Log:
Defect 32460 fix: create dummy uri in uri table for child stores of root.
Revision Changes Path
1.8 +19 -16
jakarta-slide/src/stores/org/apache/slide/store/impl/rdbms/DB2RDBMSAdapter.java
Index: DB2RDBMSAdapter.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/src/stores/org/apache/slide/store/impl/rdbms/DB2RDBMSAdapter.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- DB2RDBMSAdapter.java 19 Oct 2004 14:53:12 -0000 1.7
+++ DB2RDBMSAdapter.java 7 Dec 2004 21:07:22 -0000 1.8
@@ -103,20 +103,23 @@
while (bindings.hasMoreElements()) {
ObjectNode.Binding binding = (ObjectNode.Binding)
bindings.nextElement();
try {
- long childID =
getID(connection,binding.getUuri());
+ long childID = getID(connection,binding.getUuri());
/*
- * ChildID can be 0 if we are the root "/" and the child
is a mount point for
- * another store since it won't be listed in the tables
of the root store.
+ * childID can be 0 if we are the root "/" and the child
is a mount point for
+ * another store since it won't have been added to the
URI table since its is
+ * the root of another store. So when there's no URI for
the child just create
+ * a child URI for the binding table to refer to.
*/
- if (childID != 0) {
- statement =
- connection.prepareStatement(
- "insert into BINDING (URI_ID, NAME,
CHILD_UURI_ID) values (?,?,?)");
- statement.setLong(1, uriid);
- statement.setString(2, binding.getName());
- statement.setLong(3, childID);
- statement.executeUpdate();
- }
+ if (childID == 0)
+ childID = assureUriId(connection, binding.getUuri());
+
+ statement =
+ connection.prepareStatement(
+ "insert into BINDING (URI_ID, NAME,
CHILD_UURI_ID) values (?,?,?)");
+ statement.setLong(1, uriid);
+ statement.setString(2, binding.getName());
+ statement.setLong(3, childID);
+ statement.executeUpdate();
} finally {
close(statement);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]