db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tfisc...@apache.org
Subject svn commit: r1232249 - /db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/BasePeerImpl.java
Date Tue, 17 Jan 2012 01:04:36 GMT
Author: tfischer
Date: Tue Jan 17 01:04:36 2012
New Revision: 1232249

URL: http://svn.apache.org/viewvc?rev=1232249&view=rev
Log:
Do not retrieve lastInsertId() on mysql when the primary key is already given

Modified:
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/BasePeerImpl.java

Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/BasePeerImpl.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/BasePeerImpl.java?rev=1232249&r1=1232248&r2=1232249&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/BasePeerImpl.java
(original)
+++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/BasePeerImpl.java
Tue Jan 17 01:04:36 2012
@@ -813,7 +813,10 @@ public class BasePeerImpl implements Ser
 
         // If the primary key column is auto-incremented, get the id
         // now.
-        if (keyGen != null && keyGen.isPostInsert())
+        if (keyGen != null && keyGen.isPostInsert()
+                && primaryKey != null
+                && !insertValues.containsKey(
+                        primaryKey))
         {
             id = getId(primaryKey, keyGen, connection, keyInfo);
         }



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


Mime
View raw message