Bug 484286 - Intermittent NPR in SequencingManager.getNextValue
Summary: Intermittent NPR in SequencingManager.getNextValue
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Mac OS X
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-13 23:18 EST by Grant Jennings CLA
Modified: 2022-06-09 10:14 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Grant Jennings CLA 2015-12-13 23:18:32 EST
java.lang.NullPointerException
	at org.eclipse.persistence.internal.sequencing.SequencingManager.getNextValue(SequencingManager.java:1107)
	at org.eclipse.persistence.internal.sequencing.ClientSessionSequencing.getNextValue(ClientSessionSequencing.java:70)
	at org.eclipse.persistence.internal.descriptors.ObjectBuilder.assignSequenceNumber(ObjectBuilder.java:362)
	at org.eclipse.persistence.internal.descriptors.ObjectBuilder.assignSequenceNumber(ObjectBuilder.java:321)
	at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.assignSequenceNumber(UnitOfWorkImpl.java:486)
	at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.registerNotRegisteredNewObjectForPersist(UnitOfWorkImpl.java:4288)
	at org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork.registerNotRegisteredNewObjectForPersist(RepeatableWriteUnitOfWork.java:521)
	at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.registerNewObjectForPersist(UnitOfWorkImpl.java:4233)
	at org.eclipse.persistence.internal.jpa.EntityManagerImpl.persist(EntityManagerImpl.java:507)
...


I am using UUIDGenerator and eclipse link 2.6.1 and my unit tests (using H2) will intermittently fail with this exception. Running the same test immediately after failing and it will pass. 
Since it isn't reliably reproducible, it looks like that call to getStates(...) is returning null, making me think that the UUID generator's sequence is not being discovered in a timely (aka thread-safe) manner for a unit test.

I haven't seen the error in the application running in glassfish so although it is concerning, its severity is minor.
Comment 1 John N CLA 2017-10-09 07:13:54 EDT
Is this a real bug, I am getting this Issue when data is saved concurrently, We are also using UUIDGenerator with Eclipse Link 2.6.0 with PostGresDB.
Comment 2 John N CLA 2017-10-09 07:27:15 EDT
In my case the primary ID which is also unique is defined as a character column in Postgres DB. Is that a reason for assiging sequence Number. If no concurrent data we are not getting any exception and working fine. Only sometime with concurrent data NullPointerException is seen.
Comment 3 Eclipse Webmaster CLA 2022-06-09 10:10:05 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink
Comment 4 Eclipse Webmaster CLA 2022-06-09 10:14:04 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink