[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[List Home]
|
[eclipselink-users] How to archive Full EclipseLink Transaction Isolation (for RESOURCE_LOCAL transactions)
|
- From: patric@xxxxxxxxxx
- Date: Mon, 27 Jul 2009 19:22:16 +0200
- Delivered-to: eclipselink-users@eclipse.org
- User-agent: Dynamic Internet Messaging Program (DIMP) H3 (1.1.2)
Hello everyone,
we need full transaction isolation using RESOURCE_LOCAL transactions
in a non-JEE project.
(this means no second level cache, isolated session caches for me as
far as I understand the eclipselink cache architecture)
We are using an EclipseLink Session Customizer to bind our entity
managers to a custom DataSource (
in fact a connection pool which returns distinct connection objects
when calling acquireConnection() ).
Imagine the following situation, where em1 and em2 represents an
EclipseLink EntityManager:
User newObj = new User();
newObj.setAuthMode('A');
em1.persist(newObj);
id = newObj.getId();
LOGGER.debug("persisted object, new id is " + id);
assertNull(em2.find(User.class, id));
The assertion fails, em2 returns the new object although the
underlying transaction of em1 has not been commited yet.
How can I archive full transaction isolation within EclipseLink?
Excerpt from my persistence.xml:
<property name="eclipselink.jdbc.read-connections.shared"
value="false"/>
<property name="eclipselink.cache.shared.default" value="false"/>
<property name="eclipselink.jdbc.exclusive-connection.mode"
value="Always"/>
Best regards,
Patric