Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] How to archive Full EclipseLink Transaction Isolation (for RESOURCE_LOCAL transactions)

Your test is confusing, if you have not committed the em1 transaction, then
no matter what config you are using there is "no way" to see that object
with em2.  Even with a shared cache and no exclusive mode you will never see
uncommitted data.

Either you already have an object in the database with the id, or you are
doing something very odd like sharing the same connection and flushing? 
Perhaps include your complete config.


patric-5 wrote:
> 
> 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
> 
> 
> 
> 
> 
> 
> 
> _______________________________________________
> eclipselink-users mailing list
> eclipselink-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/eclipselink-users
> 
> 


-----
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://www.nabble.com/How-to-archive-Full-EclipseLink-Transaction-Isolation-%28for-RESOURCE_LOCAL-transactions%29-tp24684883p24702316.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top