Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Accessor or its connection has been set to null.

It seems that you have some threads sharing the same EntityManager.  Make
sure you are not using JTA or managed EntityManagers if you are doing your
own threading.

>> Closing an EntityManager closes the ClientSession
Yes.  It releases and closes the associated UnitOfWork and ClientSession.

>> Releasing an EntityTransaction releases the UnitOfWork
Not exactly.  If you commit an EntityManager transaction it will commit the
database transaction, and resume the UnitOfWork (commitAndResume).  If you
rollback an EntityManager transaction it will rollback the database
transaction, and clear and release the UnitOfWork and the ClientSession.


DavidParker wrote:
> 
> I have multiple threads in a server process, and they all appear to be
> using different EntityManagerFactory and EntityManagers, but I am getting:
> 
> Accessor or its connection has been set to null.  This can occur if the
> ClientSession or UnitOfWork was released in a seperate thread, for
> instance if a Timeout occurred.
> 
> We are using the JPA interfaces, so I just want to make sure the mappings
> to this error message:
> 
> Closing an EntityManager closes the ClientSession?
> Releasing an EntityTransaction releases the UnitOfWork?
> 
> Thanks.
> =============================================
> David Parker
> dap@xxxxxxxxxxxxxxxxxxxx
> 
> 
> 


-----
http://wiki.eclipse.org/User:James.sutherland.oracle.com James Sutherland 
http://www.eclipse.org/eclipselink/
 EclipseLink ,  http://www.oracle.com/technology/products/ias/toplink/
TopLink 
Wiki:  http://wiki.eclipse.org/EclipseLink EclipseLink , 
http://wiki.oracle.com/page/TopLink TopLink 
Forums:  http://forums.oracle.com/forums/forum.jspa?forumID=48 TopLink , 
http://www.nabble.com/EclipseLink-f26430.html EclipseLink 
Book:  http://en.wikibooks.org/wiki/Java_Persistence Java Persistence 
-- 
View this message in context: http://old.nabble.com/Accessor-or-its-connection-has-been-set-to-null.-tp27441510p27516229.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top