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; return;
try { try {
if (type == TYPE_TRANSACTIONAL || type == TYPE_CONTIGUOUS) if (type != TYPE_TRANSACTIONAL && type != TYPE_CONTIGUOUS)
conn.commit(); conn.commit();
} catch (SQLException se) { } catch (SQLException se) {
throw SQLExceptions.getStore(se); throw SQLExceptions.getStore(se);

View File

@ -230,7 +230,7 @@ public class TableJDBCSeq
if (current == null) { if (current == null) {
Connection conn = getConnection(store); Connection conn = getConnection(store);
try { try {
long cur = getSequence(mapping, getConnection(store)); long cur = getSequence(mapping, conn);
if (cur != -1) if (cur != -1)
current = Numbers.valueOf(cur); current = Numbers.valueOf(cur);
} finally { } finally {
@ -614,10 +614,7 @@ public class TableJDBCSeq
catch (NumberFormatException nfe) { catch (NumberFormatException nfe) {
return false; return false;
} finally { } finally {
try { try { conn.close(); } catch (SQLException se) {}
conn.close();
} catch (SQLException se) {
}
} }
} else } else
return false; return false;