3 Replies Latest reply on Dec 12, 2008 9:05 AM by jaikiran pai

    No transaction is in progress

    Rogerio Baldini Newbie

      Hi Guys,

      I am not able to solve this problema below. Any body can help me ?

      javax.persistence.TransactionRequiredException: no transaction is in progress
       at org.hibernate.ejb.AbstractEntityManagerImpl.flush(AbstractEntityManagerImpl.java:301)
       at com.powerlogic.jcompany.persistencia.jpa.PlcBaseJpaDAO.altera(PlcBaseJpaDAO.java:482)
       at com.powerlogic.jcompany.modelo.PlcBaseBO.altera(PlcBaseBO.java:492)
       at com.powerlogic.jcompany.facade.PlcFacadeImpl.gravaTabular(PlcFacadeImpl.java:444)
       at com.powerlogic.app.facade.AppFacadeImpl.gravaTabular(AppFacadeImpl.java:43)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:597)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeTarget(MethodInvocation.ja
      


      My -ds.xml
      <datasources>
       <local-tx-datasource>
       <jndi-name>jcompany_jsf</jndi-name>
       <connection-url>jdbc:oracle:thin:@10.0.0.1:1521:orades01</connection-url>
       <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
       <user-name>aaa</user-name>
       <password>bbb</password>
       </local-tx-datasource>
      </datasources>
      


      My persistence.xml
      <persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence">
       <persistence-unit name="default" transaction-type="JTA">
       <provider>org.hibernate.ejb.HibernatePersistence</provider>
       <jta-data-source>java:jcompany_jsf</jta-data-source>
      
       <jar-file>jcompany_jsf_comuns.jar</jar-file>
      
       <properties>
       <property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect"/>
       <property name="hibernate.show_sql" value="true"/>
       <property name="hibernate.format_sql" value="true"/>
      
       </properties>
       </persistence-unit>
      </persistence>
      


      My EJB
      @Stateless
      @TransactionManagement(TransactionManagementType.CONTAINER)
      public class AppFacadeImpl extends PlcFacadeImpl implements IAppFacade, IAppFacadeRemote {
      
       @Override
       @TransactionAttribute (TransactionAttributeType.REQUIRED)
       public void gravaTabular(PlcBaseContextVO context, Class classe,
       List lista, List listaAnt) throws PlcException {
       super.gravaTabular(context, classe, lista, listaAnt);
       }
      }
      


      Thanks,
      Rogerio