Skip to main content



      Home
Home » Eclipse Projects » EclipseLink » NPE during commit
NPE during commit [message #898751] Fri, 27 July 2012 08:53 Go to next message
Eclipse UserFriend
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] by Moderator

Re: NPE during commit [message #899666 is a reply to message #898751] Wed, 01 August 2012 13:51 Go to previous message
Eclipse UserFriend
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.
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 Jul 15 05:55:35 EDT 2025

Powered by FUDForum. Page generated in 0.07106 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top