Hi,

I have a problem with getting bean managed transaction or more appropriately 
user managed transaction to work on my Session Bean (EJB3 specs.)

I have a session bean with the EntityManager "em" already defined and I have a 
method xxx() which is suppose to rollback all which persistence when one of 
them failed.

I tried to obtain the EntityTransaction by calling:

EntityTransaction trxn = em.getTransaction();

try
{
    trxn.begin();
    //do something...
    trxn.commit();
}
catch(Exception ex)
{
    trxn.rollback();
}

Unfortunately, JBoss throws IllegalStateException while calling 
em.getTransaction(). May I know how do I configure the session bean to be able 
to handle user managed transaction instead of container managed transaction 
(like the old days where we could define that in the ejb-jar.xml)? I'm running 
on JBoss 4.0.4RC1.

Any help will be greatly appreciated. Thank you.

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3931192#3931192

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3931192


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to