OPENJPA-466: Get rid of possible duplicate sequence values

git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@773999 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Milosz Tylenda 2009-05-12 17:43:28 +00:00
parent f221b1fa85
commit 13819e01f7
2 changed files with 4 additions and 5 deletions

View File

@ -57,8 +57,9 @@ public abstract class AbstractJDBCSeq
public Object next(StoreContext ctx, ClassMetaData meta) {
JDBCStore store = getStore(ctx);
try {
current = nextInternal(store, (ClassMapping) meta);
return current;
Object currentLocal = nextInternal(store, (ClassMapping) meta);
current = currentLocal;
return currentLocal;
} catch (OpenJPAException ke) {
throw ke;
} catch (SQLException se) {

View File

@ -296,9 +296,7 @@ public class NativeJDBCSeq
try {
stmnt = conn.prepareStatement(_select);
dict.setTimeouts(stmnt, _conf, false);
synchronized(this) {
rs = stmnt.executeQuery();
}
if (rs.next())
return rs.getLong(1);