users@glassfish.java.net

Re: CMT, JPA, Spring

From: <glassfish_at_javadesktop.org>
Date: Thu, 15 Jul 2010 18:06:28 PDT

I started the entire test all over with a few modifications and cleaned out all my log files. I also made a few minor changes to the way I was building my object graph in the web service. I've managed to retrieve all the objects from the persistence context and make the associations but when the web service method returns and the transaction attempts to perform a commit, and everything seems to work, and exception is thrown telling me that I have a Violation of UNIQUE KEY constraint.

Upon investigation it appears that the EntityManager is attempting to insert an existing managed entity. What's even more puzzling is the fact that GlassFish appears to be in the middle of a TransactionRecovery. Why?

I've pasted an snippet from the log file below. I enabled trace on the transaction manager and JTA services. I've also attached my log file in hopes that someone can see what is actually going wrong here.

Thanks so much for the help...


[#|2010-07-15T15:59:48.626-0700|INFO|glassfish3.0.1|javax.enterprise.system.core.transaction.com.sun.jts.CosTransactions|_ThreadID=26;_ThreadName=Thread-1;|JTS5014: Recoverable JTS instance, serverId = [100]|#]

[#|2010-07-15T15:59:48.634-0700|FINE|glassfish3.0.1|javax.enterprise.system.core.transaction.com.sun.jts.CosTransactions|_ThreadID=26;_ThreadName=Thread-1;ClassName=null;MethodName=null;|Property :com. sun.jts.instancename has the value : server|#]

[#|2010-07-15T15:59:48.641-0700|FINE|glassfish3.0.1|javax.enterprise.system.core.transaction.com.sun.jts.CosTransactions|_ThreadID=26;_ThreadName=Thread-1;ClassName=Configuration; MethodName=getDirectory();|Using directory = /usr/share/glassfish-v3/glassfish/domains/domain1/logs/server/tx : provided in configuration|#]

[#|2010-07-15T15:59:48.643-0700|FINE|glassfish3.0.1|javax.enterprise.system.core.transaction.com.sun.jts.CosTransactions|_ThreadID=26;_ThreadName=Thread-1;ClassName=Configuration; MethodName=setServerName();| serverName = pumpkin.local,server,P100; isRecoverable = true|#]

[#|2010-07-15T15:59:48.648-0700|FINE|glassfish3.0.1|javax.enterprise.system.core.transaction.com.sun.jts.CosTransactions|_ThreadID=26;_ThreadName=Thread-1;ClassName=null;MethodName=null;|JTS5017: The ORB daemon, ORBD, is not running.|#]

[#|2010-07-15T15:59:48.651-0700|FINE|glassfish3.0.1|javax.enterprise.system.core.transaction.com.sun.jts.CosTransactions|_ThreadID=26;_ThreadName=Thread-1;ClassName=RecoveryManager; MethodName=initialise();|Before starting ResyncThread |#]

[#|2010-07-15T15:59:48.652-0700|FINEST|glassfish3.0.1|javax.enterprise.system.core.transaction.com.sun.jts.CosTransactions|_ThreadID=26;_ThreadName=Thread-1;ClassName=CurrentImpl;MethodName=begin(); |Before invoking create() on TxFactory|#]

[#|2010-07-15T15:59:48.652-0700|FINE|glassfish3.0.1|javax.enterprise.system.core.transaction.com.sun.jts.CosTransactions|_ThreadID=27;_ThreadName=Thread-1;ClassName=ResyncThread;MethodName=run(); |Before invoking RecoveryManager.recover()|#]

[#|2010-07-15T15:59:48.656-0700|FINE|glassfish3.0.1|javax.enterprise.system.core.transaction.com.sun.jts.CosTransactions|_ThreadID=27;_ThreadName=Thread-1;ClassName=null;MethodName=null;|Property :com. sun.jts.keypointCount has the value : 65536|#]

[#|2010-07-15T15:59:48.657-0700|FINE|glassfish3.0.1|javax.enterprise.system.core.transaction.com.sun.jts.CosTransactions|_ThreadID=27;_ThreadName=Thread-1;ClassName=Configuration; MethodName=getDirectory();|Using directory = /usr/share/glassfish-v3/glassfish/domains/domain1/logs/server/tx : provided in configuration|#]

[#|2010-07-15T15:59:48.665-0700|FINE|glassfish3.0.1|javax.enterprise.system.core.transaction.com.sun.jts.CosTransactions|_ThreadID=27;_ThreadName=Thread-1;ClassName=RecoveryManager;MethodName=recover();|Before invoking proceedWithXARecovery()|#]

[#|2010-07-15T15:59:48.666-0700|FINE|glassfish3.0.1|javax.enterprise.system.core.transaction.com.sun.jts.CosTransactions|_ThreadID=27;_ThreadName=Thread-1;ClassName=null;MethodName=null;|Property :com. sun.jts.ManualRecovery has the value : null|#]

[#|2010-07-15T15:59:48.683-0700|FINE|glassfish3.0.1|javax.enterprise.system.core.transaction.com.sun.jts.CosTransactions|_ThreadID=26;_ThreadName=Thread-1;ClassName=TransactionFactoryImpl; MethodName=localCreate();|Control object :com.sun.jts.CosTransactions.ControlImpl_at_25b43d0d corresponding to this transaction has been createdGTID is : 0200000041CD55D870756D706B696E2E6C6F63616C2C7365727665722C50313030|#]

[#|2010-07-15T15:59:48.683-0700|FINEST|glassfish3.0.1|javax.enterprise.system.core.transaction.com.sun.jts.CosTransactions|_ThreadID=26;_ThreadName=Thread-1;ClassName=CurrentImpl;MethodName=begin(); |Before invoking CurrentTransaction.setCurrent(control,true)|#]
[Message sent by forum member 'fericit_bostan']

http://forums.java.net/jive/thread.jspa?messageID=477783