Fix sequence bug I introduced with last sequence synchronization refactoring.

git-svn-id: https://svn.apache.org/repos/asf/incubator/openjpa/trunk@448708 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
A. Abram White 2006-09-21 22:01:57 +00:00
parent 68572a9197
commit d090d717f4
2 changed files with 3 additions and 6 deletions

View File

@ -157,7 +157,7 @@ public abstract class AbstractJDBCSeq
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);

View File

@ -230,7 +230,7 @@ public class TableJDBCSeq
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 @@ public class TableJDBCSeq
catch (NumberFormatException nfe) {
return false;
} finally {
try {
conn.close();
} catch (SQLException se) {
}
try { conn.close(); } catch (SQLException se) {}
}
} else
return false;