Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » NPE during commit
NPE during commit [message #898751] Fri, 27 July 2012 08:53 Go to next message
Rodion Missing name is currently offline Rodion Missing name
Messages: 8
Registered: September 2009
Junior Member
In continuation of this topic

Short description on problem I'm facing with. If you object graph contains two possible pathes to same newly created object (from one root object) - eclipse link will try to insert this object twice but will fail because one internal clone of this object do not have primary key properly set (other will).

It appears that weaving was disabled by accident in previos situation. When I have enabled weaving I starting to get different exception:

Caused by: java.lang.NullPointerException
	at java.util.TreeMap.compare(TreeMap.java:1188)
	at java.util.TreeMap.put(TreeMap.java:531)
	at org.eclipse.persistence.internal.sessions.CommitManager.sort(CommitManager.java:351)
	at org.eclipse.persistence.internal.sessions.CommitManager.deleteAllObjects(CommitManager.java:312)
	at org.eclipse.persistence.internal.sessions.CommitManager.deleteAllObjects(CommitManager.java:283)
	at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitToDatabase(UnitOfWorkImpl.java:1418)
	at org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork.commitToDatabase(RepeatableWriteUnitOfWork.java:636)
	at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitToDatabaseWithChangeSet(UnitOfWorkImpl.java:1505)
	at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.issueSQLbeforeCompletion(UnitOfWorkImpl.java:3143)
	at org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork.issueSQLbeforeCompletion(RepeatableWriteUnitOfWork.java:346)
	at org.eclipse.persistence.transaction.AbstractSynchronizationListener.beforeCompletion(AbstractSynchronizationListener.java:157)
	at org.eclipse.persistence.transaction.JTASynchronizationListener.beforeCompletion(JTASynchronizationListener.java:68)
	at com.sun.enterprise.transaction.JavaEETransactionImpl.commit(JavaEETransactionImpl.java:435)
	... 53 more


This happens because eclipse link try to delete "old" object which has null primary key, and before deletion eclipselink try to sort on deletedObjects collection by primary key using TreeMap that do not expect nulls as keys.

This is definetely looks like bug to me.

[Updated on: Fri, 27 July 2012 08:54]

Report message to a moderator

Re: NPE during commit [message #899666 is a reply to message #898751] Wed, 01 August 2012 13:51 Go to previous message
James Sutherland is currently offline James Sutherland
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

How does your old object have a null primary key?

It sounds like the same problem in your merge. I would log a bug for the merge issue.


James : Wiki : Book : Blog : Twitter
Previous Topic:The parameter name in the query's selection criteria does not match any parameter name defi
Next Topic:EntityManager and Multi-threading design question
Goto Forum:
  


Current Time: Tue Sep 02 02:58:59 EDT 2014

Powered by FUDForum. Page generated in 0.01574 seconds