Unable to unwrap connection with eclipselink.jdbc.exclusive-connection.mode=Always [message #1715137] |
Thu, 19 November 2015 09:18  |
Eclipse User |
|
|
|
When switching to exclusive connections, the application is unable to unwrap java.sql.Connection.
The application works when exclusive-connection-mode is not set.
persistence.xml
<property name="eclipselink.jdbc.exclusive-connection.mode" value="Always"/>
<property name="eclipselink.jdbc.exclusive-connection.is-lazy" value="false"/>
Removing the two lines above will make the application work again.
Code:
...
@Resource
private UserTransaction tx;
@Inject
private EntityManager em // via EntityManagerProducer
...
tx.begin();
em.joinTransaction();
Connection conn = entityManager.unwrap(Connection.class); // Connection is null
...
If I delve into ClientSession I can see that isExclusiveIsolatedClientSesson() is true, but UnitOfWork.getAccessor() returns an Accessor without a Connection.
I thought this would work the same as without exclusive connections, but guess I was wrong.
Any thoughts on how to aquire a connection when using exclusive connections?
Regards,
Håvard
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.09338 seconds