openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From awh...@apache.org
Subject svn commit: r448708 - in /incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel: AbstractJDBCSeq.java TableJDBCSeq.java
Date Thu, 21 Sep 2006 22:01:57 GMT
Author: awhite
Date: Thu Sep 21 15:01:57 2006
New Revision: 448708

URL: http://svn.apache.org/viewvc?view=rev&rev=448708
Log:
Fix sequence bug I introduced with last sequence synchronization refactoring.


Modified:
    incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/AbstractJDBCSeq.java
    incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/TableJDBCSeq.java

Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/AbstractJDBCSeq.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/AbstractJDBCSeq.java?view=diff&rev=448708&r1=448707&r2=448708
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/AbstractJDBCSeq.java
(original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/AbstractJDBCSeq.java
Thu Sep 21 15:01:57 2006
@@ -157,7 +157,7 @@
             return;
 
         try {
-            if (type == TYPE_TRANSACTIONAL || type == TYPE_CONTIGUOUS)
+            if (type != TYPE_TRANSACTIONAL && type != TYPE_CONTIGUOUS)
                 conn.commit();
         } catch (SQLException se) {
             throw SQLExceptions.getStore(se);

Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/TableJDBCSeq.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/TableJDBCSeq.java?view=diff&rev=448708&r1=448707&r2=448708
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/TableJDBCSeq.java
(original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/TableJDBCSeq.java
Thu Sep 21 15:01:57 2006
@@ -230,7 +230,7 @@
         if (current == null) {
             Connection conn = getConnection(store);
             try {
-                long cur = getSequence(mapping, getConnection(store));
+                long cur = getSequence(mapping, conn);
                 if (cur != -1)
                     current = Numbers.valueOf(cur);
             } finally {
@@ -614,10 +614,7 @@
             catch (NumberFormatException nfe) {
                 return false;
             } finally {
-                try {
-                    conn.close();
-                } catch (SQLException se) {
-                }
+                try { conn.close(); } catch (SQLException se) {}
             }
         } else
             return false;



Mime
View raw message