You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-dev@db.apache.org by tf...@apache.org on 2012/01/17 02:04:36 UTC
svn commit: r1232249 -
/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/BasePeerImpl.java
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