You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Stefan Arentz <st...@soze.com> on 2003/03/08 08:53:32 UTC

Transactions in Actions

Question about using EJBs from an Action. I tried creating a 
UserTransaction like this:

  try
  {
    UserTransaction transaction = (UserTransaction)
      initialContext.lookup("java:/comp/UserTransaction");
    transaction.begin();

    .. do work with a stateless session bean ..

    if error throw new SystemException();

    transaction.commit();
   }

   catch (SystemException e)
   {
      ...
   }

But this throws a NestedTransactionException.

I am running this in JBoss with Jetty.

  S.


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org