Skip to main content

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 12:53 Go to next message
Rodion Missing name is currently offline Rodion Missing nameFriend
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.put(
	at org.eclipse.persistence.internal.sessions.CommitManager.sort(
	at org.eclipse.persistence.internal.sessions.CommitManager.deleteAllObjects(
	at org.eclipse.persistence.internal.sessions.CommitManager.deleteAllObjects(
	at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitToDatabase(
	at org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork.commitToDatabase(
	at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitToDatabaseWithChangeSet(
	at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.issueSQLbeforeCompletion(
	at org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork.issueSQLbeforeCompletion(
	at org.eclipse.persistence.transaction.AbstractSynchronizationListener.beforeCompletion(
	at org.eclipse.persistence.transaction.JTASynchronizationListener.beforeCompletion(
	at com.sun.enterprise.transaction.JavaEETransactionImpl.commit(
	... 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 12:54]

Report message to a moderator

Re: NPE during commit [message #899666 is a reply to message #898751] Wed, 01 August 2012 17:51 Go to previous message
James Sutherland is currently offline James SutherlandFriend
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: Wed Sep 23 03:21:16 GMT 2020

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

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

Back to the top