You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-dev@db.apache.org by ar...@apache.org on 2003/12/09 23:48:20 UTC
cvs commit: db-ojb/src/java/org/apache/ojb/broker/platforms PlatformDb2Impl.java
arminw 2003/12/09 14:48:20
Modified: src/java/org/apache/ojb/odmg TransactionImpl.java
src/java/org/apache/ojb/broker/util/sequence
SequenceManagerNativeImpl.java
src/java/org/apache/ojb/broker/platforms
PlatformDb2Impl.java
Log:
add patches for issues #223, #224, #225 by Michael Becke
Revision Changes Path
1.50 +8 -2 db-ojb/src/java/org/apache/ojb/odmg/TransactionImpl.java
Index: TransactionImpl.java
===================================================================
RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/odmg/TransactionImpl.java,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -r1.49 -r1.50
--- TransactionImpl.java 28 Nov 2003 14:39:59 -0000 1.49
+++ TransactionImpl.java 9 Dec 2003 22:48:20 -0000 1.50
@@ -435,7 +435,13 @@
}
if(broker != null && !broker.isClosed())
{
- broker.close();
+ try
+ {
+ broker.close();
+ }
+ catch (Exception ignore)
+ {
+ }
}
// clear the temporary used named roots map
// we should do that, because same tx instance
1.12 +22 -17 db-ojb/src/java/org/apache/ojb/broker/util/sequence/SequenceManagerNativeImpl.java
Index: SequenceManagerNativeImpl.java
===================================================================
RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/util/sequence/SequenceManagerNativeImpl.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- SequenceManagerNativeImpl.java 9 Dec 2003 17:19:58 -0000 1.11
+++ SequenceManagerNativeImpl.java 9 Dec 2003 22:48:20 -0000 1.12
@@ -157,22 +157,27 @@
}
}
- private FieldDescriptor extractIdentityColumnField(ClassDescriptor cld)
- {
- FieldDescriptor[] pkFields = cld.getPkFields();
- FieldDescriptor result = null;
- for (int i = 0; i < pkFields.length; i++)
- {
- result = pkFields[i];
- // to find the identity column we search for a autoincrement
- // read-only field
- if (result.isAutoIncrement() && result.isAccessReadOnly())
- {
- break;
- }
- }
- return result;
- }
+ /**
+ * Gets the identity column descriptor for the given class
+ * or return <code>null</code> if none defined.
+ *
+ * @param cld The class descriptor
+ * @return The class's identity column or <code>null</code> if it does not have one
+ */
+ private FieldDescriptor extractIdentityColumnField(ClassDescriptor cld)
+ {
+ FieldDescriptor[] pkFields = cld.getPkFields();
+ for (int i = 0; i < pkFields.length; i++)
+ {
+ // to find the identity column we search for a autoincrement
+ // read-only field
+ if (pkFields[i].isAutoIncrement() && pkFields[i].isAccessReadOnly())
+ {
+ return pkFields[i];
+ }
+ }
+ return null;
+ }
private void ifNotReadOnlyFail(FieldDescriptor field) throws SequenceManagerException
{
1.7 +6 -1 db-ojb/src/java/org/apache/ojb/broker/platforms/PlatformDb2Impl.java
Index: PlatformDb2Impl.java
===================================================================
RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/platforms/PlatformDb2Impl.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- PlatformDb2Impl.java 31 Jul 2003 16:14:06 -0000 1.6
+++ PlatformDb2Impl.java 9 Dec 2003 22:48:20 -0000 1.7
@@ -98,4 +98,9 @@
{
return "drop sequence " + sequenceName;
}
+
+ public String getLastInsertIdentityQuery(String tableName)
+ {
+ return "values IDENTITY_VAL_LOCAL() fetch first row only";
+ }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org