Community
Participate
Working Groups
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.
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.
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.
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink