You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by aa...@apache.org on 2006/07/13 20:24:54 UTC

svn commit: r421679 - /incubator/cayenne/main/trunk/cayenne/cayenne-java/src/cayenne/java/org/objectstyle/cayenne/dba/mysql/MySQLPkGenerator.java

Author: aadamchik
Date: Thu Jul 13 11:24:53 2006
New Revision: 421679

URL: http://svn.apache.org/viewvc?rev=421679&view=rev
Log:
adding explicit commit to MySQL pk generator, as it shouldn't make any assumptions regarding the state of the transaction

(putting commit in the right place) 

Modified:
    incubator/cayenne/main/trunk/cayenne/cayenne-java/src/cayenne/java/org/objectstyle/cayenne/dba/mysql/MySQLPkGenerator.java

Modified: incubator/cayenne/main/trunk/cayenne/cayenne-java/src/cayenne/java/org/objectstyle/cayenne/dba/mysql/MySQLPkGenerator.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/cayenne/cayenne-java/src/cayenne/java/org/objectstyle/cayenne/dba/mysql/MySQLPkGenerator.java?rev=421679&r1=421678&r2=421679&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/cayenne/cayenne-java/src/cayenne/java/org/objectstyle/cayenne/dba/mysql/MySQLPkGenerator.java (original)
+++ incubator/cayenne/main/trunk/cayenne/cayenne-java/src/cayenne/java/org/objectstyle/cayenne/dba/mysql/MySQLPkGenerator.java Thu Jul 13 11:24:53 2006
@@ -100,8 +100,17 @@
 
             try {
                 pk = getPrimaryKey(st, ent.getName());
+                con.commit();
             }
             catch (SQLException pkEx) {
+                
+                try {
+                    con.rollback();
+                }
+                catch (SQLException e) {
+
+                }
+                
                 exception = processSQLException(pkEx, exception);
             }
             finally {
@@ -126,8 +135,6 @@
                     }
                 }
             }
-            
-            con.commit();
         }
         catch (SQLException otherEx) {
             exception = processSQLException(otherEx, exception);