mirror of
https://github.com/apache/openjpa.git
synced 2025-03-06 16:39:11 +00:00
OPENJPA-1726: fix test case problem for Postgres. Postgres returns nextval depending on whether the two consecutive calls to nextval are in the same session or not. If they are in different sessions, the nextval returned by Postgres will be the next sequence number preallocated and stored in memory for the current session. The second nextval is not necessarily the first nextval + increment.
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@965663 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
9225c60a74
commit
1916e1bd86
@ -59,7 +59,7 @@ public class TestNativeSeqGenerator extends SQLListenerTestCase {
|
|||||||
em.getTransaction().commit();
|
em.getTransaction().commit();
|
||||||
int genId = entityE2.getId();
|
int genId = entityE2.getId();
|
||||||
int nextId = (int)((Long)em.getIdGenerator(EntityE2.class).next()).longValue();
|
int nextId = (int)((Long)em.getIdGenerator(EntityE2.class).next()).longValue();
|
||||||
assertTrue("Next value should depend on previous genid", nextId == genId + 1);
|
assertTrue("Next value should depend on previous genid", nextId >= genId + 1);
|
||||||
em.close();
|
em.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user