Description
When sequence table does not exist and mutliple threads get EntityManagers from EntityManageFactory, an insert into sequence table may fail because of duplicate primary key value.
EMF is created lazily by default and users reported various problems with concurrent initialization (e.g. failures in resolving aliases in JPQL queries, IIRC) of EMF. This issue might have the same roots.
Issue and test case originally reported by Pinaki in OPENJPA-466.
Attachments
Attachments
Issue Links
- is related to
-
OPENJPA-1765 TableGenerator doesn't properly utilize all keys when under heavy stress.
- Closed
- relates to
-
OPENJPA-466 Primary key constraint violated using (Oracle) sequence to generate ID in multithreaded app
- Closed
-
OPENJPA-2269 Duplicate key exception in sequence table on multithreaded initialization
- Closed