2 Replies Latest reply on Aug 17, 2007 3:33 PM by Nade Andrews

    Seam persistence with Web Service

    Sean Burns Newbie

      Hello,

      I am trying to use Seam managed persistence (Seam Application Framework) with a web service on Jboss 4.0.5 with ws 1.2.1 and seam 1.2.1.



      @WebService
      @SOAPBinding(style = SOAPBinding.Style.DOCUMENT)
      public class JustSwipeService {
      
       @WebMethod
       public boolean saveSettlement(Settlement settlement) throws Exception {
       SettlementHome settlementHome = (SettlementHome) Component.getInstance(
       "settlementHome", true);
       settlementHome.setInstance(settlement);
       settlementHome.persist();
       return true;
       }
      
      }


      When I call this I get the exception


      11:15:50,459 ERROR [SOAPFaultHelperJAXWS] SOAP request exception
      javax.persistence.TransactionRequiredException: No active JTA transaction on joinTransaction call
      at org.hibernate.ejb.AbstractEntityManagerImpl.joinTransaction(AbstractEntityManagerImpl.java:469)
      at org.hibernate.ejb.AbstractEntityManagerImpl.joinTransaction(AbstractEntityManagerImpl.java:442)
      at org.jboss.seam.persistence.EntityManagerProxy.joinTransaction(EntityManagerProxy.java:113)
      at org.jboss.seam.framework.EntityHome.persist(EntityHome.java:47)


      is there an elegant way to solve this?

      Thanks
      Sean.