Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: Re[eclipselink-users] ading Through the Write Connection

This looks fine.  You can also use the
"eclipselink.jdbc.exclusive-connection.mode" persistence.xml, or
EntityManager property using the ExclusiveConnectionMode.Always ("Always")
option.


dmitryerkin wrote:
> 
> Hi
> How can I be sure that the server session uses the same connection for
> read and write operations in case it works inside the websphere container?
> How can I set the transaction mode to read only for the particular
> transaction of this connection? I mean I use Oracle and need to SET
> TRANSACTION READ ONLY.
> 
> Is this the right code?
> 
> JpaEntityManager jpaEM =
> org.eclipse.persistence.jpa.JpaHelper.getEntityManager(em);
> UnitOfWork uow = jpaEM.getActiveSession().getActiveUnitOfWork();
> uow.beginEarlyTransaction();
> em.createNativeQuery("SET TRANSACTION READ ONLY").executeUpdate();
> 
> Thanks
> 
> Regards,
> Dmitry
> 


-----
---
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/Reading-Through-the-Write-Connection-tp20280212p20303806.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top