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 2006/08/18 15:43:46 UTC

svn commit: r432583 - /db/ojb/trunk/src/java/org/apache/ojb/broker/core/PersistenceBrokerImpl.java

Author: arminw
Date: Fri Aug 18 06:43:45 2006
New Revision: 432583

URL: http://svn.apache.org/viewvc?rev=432583&view=rev
Log:
fix, always replace the Identity object on insert

Modified:
    db/ojb/trunk/src/java/org/apache/ojb/broker/core/PersistenceBrokerImpl.java

Modified: db/ojb/trunk/src/java/org/apache/ojb/broker/core/PersistenceBrokerImpl.java
URL: http://svn.apache.org/viewvc/db/ojb/trunk/src/java/org/apache/ojb/broker/core/PersistenceBrokerImpl.java?rev=432583&r1=432582&r2=432583&view=diff
==============================================================================
--- db/ojb/trunk/src/java/org/apache/ojb/broker/core/PersistenceBrokerImpl.java (original)
+++ db/ojb/trunk/src/java/org/apache/ojb/broker/core/PersistenceBrokerImpl.java Fri Aug 18 06:43:45 2006
@@ -2406,11 +2406,12 @@
         if (insert)
         {
             dbAccess.executeInsert(cld, obj);
-            if(oid.isTransient())
-            {
-                // Create a new Identity based on the current set of primary key values.
-                oid = serviceIdentity().buildIdentity(cld, obj);
-            }
+            /*
+            Create a new Identity based on the current set of primary key values.
+            This is mandatory because the used oid can be transient or the specified
+            PK values of the object can be changed by the database (use of database identity columns)
+            */
+            oid = serviceIdentity().buildIdentity(cld, obj);
         }
         // else use UPDATE
         else



---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org