Getting a JDBC Connection from an EntityManager returns null in EclipseLink 2.0.2 [message #649824] |
Thu, 20 January 2011 11:35  |
Eclipse User |
|
|
|
Hello,
We are using JPA 1.0 with the EclipseLink 2.0.2 distribution and finding that :
UnitOfWorkImpl unitOfWork = (UnitOfWorkImpl)((JpaEntityManager)em.getDelegate()).getActi veSession();
unitOfWork.beginEarlyTransaction();
return unitOfWork.getAccessor().getConnection();
as described here ( http://wiki.eclipse.org/EclipseLink/Examples/JPA/EMAPI#Getti ng_a_JDBC_Connection_from_an_EntityManager) is unexpectedly returning null.
Prior to the above code being executed, we obtain an EntityManager reference, obtain a Transaction reference against it, begin the transaction modify an instance of a JPA mapped class, then attempt to obtain the JDBC Connection from the EntityManager which is returning null.
The transaction that was started otherwise commits fine.
Has anyone experienced this problem and has found a suitable workaround?
Thank you,
Doug Gschwind
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03284 seconds