NPE in DatabaseQueryMechanism.updateObjectForWriteWithChangeSet(DatabaseQueryMechanism.java:978) [message #1058006] |
Fri, 10 May 2013 13:13 |
Alex Panchenko Messages: 342 Registered: July 2009 |
Senior Member |
|
|
Hi,
We experience the following NPE in a web application using Spring.
Caused by: java.lang.NullPointerException: null
at org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.updateObjectForWriteWithChangeSet(DatabaseQueryMechanism.java:978) ~[eclipselink-2.4.1.jar:2.4.1.v20121003-ad44345]
at org.eclipse.persistence.queries.UpdateObjectQuery.executeCommitWithChangeSet(UpdateObjectQuery.java:84) ~[eclipselink-2.4.1.jar:2.4.1.v20121003-ad44345]
at org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.executeWriteWithChangeSet(DatabaseQueryMechanism.java:286) ~[eclipselink-2.4.1.jar:2.4.1.v20121003-ad44345]
at org.eclipse.persistence.queries.WriteObjectQuery.executeDatabaseQuery(WriteObjectQuery.java:58) ~[eclipselink-2.4.1.jar:2.4.1.v20121003-ad44345]
at org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQuery.java:852) ~[eclipselink-2.4.1.jar:2.4.1.v20121003-ad44345]
at org.eclipse.persistence.queries.DatabaseQuery.executeInUnitOfWork(DatabaseQuery.java:751) ~[eclipselink-2.4.1.jar:2.4.1.v20121003-ad44345]
at org.eclipse.persistence.queries.ObjectLevelModifyQuery.executeInUnitOfWorkObjectLevelModifyQuery(ObjectLevelModifyQuery.java:108) ~[eclipselink-2.4.1.jar:2.4.1.v20121003-ad44345]
at org.eclipse.persistence.queries.ObjectLevelModifyQuery.executeInUnitOfWork(ObjectLevelModifyQuery.java:85) ~[eclipselink-2.4.1.jar:2.4.1.v20121003-ad44345]
at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2875) ~[eclipselink-2.4.1.jar:2.4.1.v20121003-ad44345]
at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1602) ~[eclipselink-2.4.1.jar:2.4.1.v20121003-ad44345]
at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1584) ~[eclipselink-2.4.1.jar:2.4.1.v20121003-ad44345]
at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1535) ~[eclipselink-2.4.1.jar:2.4.1.v20121003-ad44345]
at org.eclipse.persistence.internal.sessions.CommitManager.commitChangedObjectsForClassWithChangeSet(CommitManager.java:265) ~[eclipselink-2.4.1.jar:2.4.1.v20121003-ad44345]
at org.eclipse.persistence.internal.sessions.CommitManager.commitAllObjectsWithChangeSet(CommitManager.java:128) ~[eclipselink-2.4.1.jar:2.4.1.v20121003-ad44345]
at org.eclipse.persistence.internal.sessions.AbstractSession.writeAllObjectsWithChangeSet(AbstractSession.java:3914) ~[eclipselink-2.4.1.jar:2.4.1.v20121003-ad44345]
at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitToDatabase(UnitOfWorkImpl.java:1419) ~[eclipselink-2.4.1.jar:2.4.1.v20121003-ad44345]
at org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork.commitToDatabase(RepeatableWriteUnitOfWork.java:634) ~[eclipselink-2.4.1.jar:2.4.1.v20121003-ad44345]
at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitToDatabaseWithChangeSet(UnitOfWorkImpl.java:1509) ~[eclipselink-2.4.1.jar:2.4.1.v20121003-ad44345]
at org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork.commitRootUnitOfWork(RepeatableWriteUnitOfWork.java:266) ~[eclipselink-2.4.1.jar:2.4.1.v20121003-ad44345]
at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitAndResume(UnitOfWorkImpl.java:1147) ~[eclipselink-2.4.1.jar:2.4.1.v20121003-ad44345]
at org.eclipse.persistence.internal.jpa.transaction.EntityTransactionImpl.commitInternal(EntityTransactionImpl.java:84) ~[eclipselink-2.4.1.jar:2.4.1.v20121003-ad44345]
... 73 common frames omitted
It happens via one of the controller methods and is quite reproducible. Is there a known reason and possibly a workaround for it?
How can I help identifying and fixing it?
Unfortunately it happens only on server, I was not able to reproduce it locally.
UPDATE: It seems that calling .flush() helps.
Thanks,
Alex
[Updated on: Mon, 13 May 2013 16:53] Report message to a moderator
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03809 seconds