Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] Using JTA

I have to deploy my WebApplication which uses Eclipselink.

When I'm using RESOURCE_LOCAL as my Transaction type, I'm controlling my
transactions using,
em.getTransaction().begin();
//---do Someting()
em.getTransaction().commit();

But, I may need to go with JTA, since that is the standard for JavaEE
applications...
But when I'm using JTA, it is not allowing me use em.getTransaction() api.
instead I may need to define my EntityManager using
    @PersistenceContext(unitName="example",
type=PersistenceContextType.TRANSACTION)    
    private EntityManager em;

In that case, how to control the transactions?
I'm not using any EJB stuff in my code... So, how to embed my code in the
transaction boundary?
-- 
View this message in context: http://old.nabble.com/Using-JTA-tp28188849p28188849.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top