1 2 Previous Next 20 Replies Latest reply on Nov 8, 2006 4:51 AM by Kevin Conner

    javax.persistence.TransactionRequiredException: No active J

    Juha Moisio Newbie

      I installed JBossTS to JBoss 4.0.5GA and I'm getting
      No active JTA transaction on joinTransaction call.

      I copied JBossTS jars to server/default/lib
      and jbossjta-properties.xml to server/default/conf.

      Any ideas what is wrong?

      server/default/deploy/jta-service.xml
      <server>
       <!-- ==================================================================== -->
       <!-- Transactions -->
       <!-- ==================================================================== -->
       <!-- The configurable Xid factory. For use with Oracle, set pad to true -->
      
       <mbean code="org.jboss.tm.XidFactory"
       name="jboss:service=XidFactory">
       <!--attribute name="Pad">true</attribute-->
       </mbean>
      
       <!--
       | The fast in-memory transaction manager.
       -->
       <mbean code="com.arjuna.ats.jbossatx.jta.TransactionManagerService"
       name="jboss:service=TransactionManager">
       <attribute name="TransactionTimeout">300</attribute>
       <depends>jboss:service=XidFactory</depends>
       <depends>jboss:service=Naming</depends>
       </mbean>
      </server>
      
      



      14:27:35,594 WARN [ServiceController] Problem starting service logiasoftware.fi:service=SchedulerService
      javax.ejb.EJBException: javax.persistence.TransactionRequiredException: No active JTA transaction on joinTransaction call
       at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:69)
       at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83)
       at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:197)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
       at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:131)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:263)
       at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:58)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:102)
       at $Proxy191.getProperty(Unknown Source)
       at fi.logiasoftware.serviceutils.SchedulerService.start(SchedulerService.java:45)
       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:585)
       at com.sun.jmx.mbeanserver.StandardMetaDataImpl.invoke(StandardMetaDataImpl.java:414)
       at javax.management.StandardMBean.invoke(StandardMBean.java:323)
       at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:995)
       at $Proxy0.start(Unknown Source)
       at org.jboss.system.ServiceController.start(ServiceController.java:417)
       at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
       at $Proxy4.start(Unknown Source)
       at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
       at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
       at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1015)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
       at sun.reflect.GeneratedMethodAccessor11.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
       at $Proxy6.deploy(Unknown Source)
       at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
       at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:336)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
       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:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
       at $Proxy0.start(Unknown Source)
       at org.jboss.system.ServiceController.start(ServiceController.java:417)
       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:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
       at $Proxy4.start(Unknown Source)
       at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
       at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
       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:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
       at $Proxy5.deploy(Unknown Source)
       at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
       at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
       at org.jboss.Main.boot(Main.java:200)
       at org.jboss.Main$1.run(Main.java:490)
       at java.lang.Thread.run(Thread.java:595)
      Caused by: 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.ejb3.entity.ManagedEntityManagerFactory.getTransactionScopedEntityManager(ManagedEntityManagerFactory.java:182)
       at org.jboss.ejb3.entity.TransactionScopedEntityManager.createQuery(TransactionScopedEntityManager.java:125)
       at fi.logiasoftware.messageserver.services.backend.ConfigurationBean.getProperty(ConfigurationBean.java:53)
       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:585)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
       at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
       at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
       ... 111 more
      14:27:35,619 ERROR [URLDeploymentScanner] Incomplete Deployment listing:
      
      --- MBeans waiting for other MBeans ---
      ObjectName: logiasoftware.fi:service=SchedulerService
       State: FAILED
       Reason: javax.ejb.EJBException: javax.persistence.TransactionRequiredException: No active JTA transaction on joinTransaction call
      
      --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
      ObjectName: logiasoftware.fi:service=SchedulerService
       State: FAILED
       Reason: javax.ejb.EJBException: javax.persistence.TransactionRequiredException: No active JTA transaction on joinTransaction call
      
      
      14:27:35,719 INFO [Http11BaseProtocol] Starting Coyote HTTP/1.1 on http-0.0.0.0-9090
      
      



      Br,

      Juha Moisio

        • 1. Re:  javax.persistence.TransactionRequiredException: No acti
          Kevin Conner Master

          It appears that you do not have an active transaction.

          What are you trying to do?

          Kev

          • 2. Re:  javax.persistence.TransactionRequiredException: No acti
            Juha Moisio Newbie

            Hi,

            If I change TransactionManager back to org.jboss.tm.TransactionManagerService,
            it works.

            All Session Beans are annotated with TransactionAttributeType.REQUIRED.

            I'm pretty sure that I have transaction :-/

            -Juha-

            • 3. Re:  javax.persistence.TransactionRequiredException: No acti
              Juha Moisio Newbie

              Snap from server.log using org.jboss.tm.TransactionManagerService

              2006-11-06 10:27:53,811 DEBUG [org.jboss.deployment.SARDeployer] Deploying SAR, create step: url file:/java/jboss-4.0.4.GA/server/sam/deploy/deploy.last/ServiceUtils.sar
              2006-11-06 10:27:53,811 DEBUG [org.jboss.deployment.SARDeployer] Registering service UCL=jmx.loading:UCL=df672a
              2006-11-06 10:27:53,815 DEBUG [org.jboss.system.ServiceCreator] About to create bean resource: logiasoftware.fi:service=SchedulerService with code: fi.logiasoftware.serviceutils.SchedulerService
              2006-11-06 10:27:53,820 DEBUG [org.jboss.system.ServiceCreator] About to register StandardMBean : logiasoftware.fi:service=SchedulerService
              2006-11-06 10:27:53,829 DEBUG [org.jboss.system.ServiceCreator] Created bean: logiasoftware.fi:service=SchedulerService
              2006-11-06 10:27:53,830 DEBUG [org.jboss.system.ServiceController] Creating service logiasoftware.fi:service=SchedulerService
              2006-11-06 10:27:53,831 INFO [STDOUT] Creating SchedulerService
              2006-11-06 10:27:53,834 DEBUG [org.jboss.system.ServiceController] Creating dependent components for: logiasoftware.fi:service=SchedulerService dependents are: []
              2006-11-06 10:27:53,834 DEBUG [org.jboss.deployment.MainDeployer] Done with create step of deploying ServiceUtils.sar
              2006-11-06 10:27:53,834 DEBUG [org.jboss.deployment.MainDeployer] Done with create step of deploying deploy.last
              2006-11-06 10:27:53,834 DEBUG [org.jboss.deployment.MainDeployer] Begin deployment start file:/java/jboss-4.0.4.GA/server/sam/deploy/deploy.last/
              2006-11-06 10:27:53,834 DEBUG [org.jboss.deployment.MainDeployer] Begin deployment start file:/java/jboss-4.0.4.GA/server/sam/deploy/deploy.last/ServiceUtils.sar
              2006-11-06 10:27:53,834 DEBUG [org.jboss.deployment.SARDeployer] Deploying SAR, start step: url file:/java/jboss-4.0.4.GA/server/sam/deploy/deploy.last/ServiceUtils.sar
              2006-11-06 10:27:53,834 DEBUG [org.jboss.system.ServiceController] starting service logiasoftware.fi:service=SchedulerService
              2006-11-06 10:27:54,155 DEBUG [org.hibernate.impl.SessionImpl] opened session at timestamp: 4762835656986624
              2006-11-06 10:27:54,155 DEBUG [org.hibernate.jdbc.JDBCContext] TransactionFactory reported no active transaction; Synchronization not registered
              2006-11-06 10:27:54,155 DEBUG [org.hibernate.ejb.AbstractEntityManagerImpl] Looking for a JTA transaction to join
              2006-11-06 10:27:54,167 DEBUG [org.hibernate.jdbc.JDBCContext] successfully registered Synchronization
              2006-11-06 10:27:54,171 DEBUG [org.hibernate.ejb.AbstractEntityManagerImpl] Looking for a JTA transaction to join
              2006-11-06 10:27:54,171 DEBUG [org.hibernate.ejb.AbstractEntityManagerImpl] Transaction already joined
              



              Snap from server.log using com.arjuna.ats.jbossatx.jta.TransactionManagerService

              
              2006-11-06 14:27:26,558 DEBUG [org.jboss.system.ServiceController] starting service jboss.j2ee:ear=MessageServer.ear,jar=MessageServices.par,name=MessageResenderBean,service=EJB3
              2006-11-06 14:27:26,558 DEBUG [org.jboss.ejb3.ServiceDelegateWrapper] Starting jboss.j2ee:ear=MessageServer.ear,jar=MessageServices.par,name=MessageResenderBean,service=EJB3
              2006-11-06 14:27:26,563 DEBUG [org.jboss.ejb3.interceptor.EJB3InterceptorsFactory] Bound interceptors for joinpoint: public void fi.logiasoftware.messageserver.services.backend.MessageResenderBean.cancelTimer() - [Lorg.jboss.ejb3.interceptor.InterceptorInfo;@76a6d9
              2006-11-06 14:27:26,563 DEBUG [org.jboss.ejb3.interceptor.EJB3InterceptorsFactory] Bound interceptors for joinpoint: public void fi.logiasoftware.messageserver.services.backend.MessageResenderBean.createTimer() - [Lorg.jboss.ejb3.interceptor.InterceptorInfo;@37fd24
              2006-11-06 14:27:26,565 DEBUG [org.jboss.ejb3.tx.UserTransactionImpl] new UserTx: org.jboss.ejb3.tx.UserTransactionImpl@1cc55fb
              2006-11-06 14:27:26,566 DEBUG [org.hibernate.impl.SessionImpl] opened session at timestamp: 4762894526156800
              2006-11-06 14:27:26,566 DEBUG [org.hibernate.ejb.AbstractEntityManagerImpl] Looking for a JTA transaction to join
              2006-11-06 14:27:26,573 DEBUG [org.jboss.ejb3.interceptor.EJB3InterceptorsFactory] Bound interceptors for joinpoint: public void fi.logiasoftware.messageserver.services.backend.MessageResenderBean.cancelTimer() - [Lorg.jboss.ejb3.interceptor.InterceptorInfo;@60c384
              2006-11-06 14:27:26,573 DEBUG [org.jboss.ejb3.interceptor.EJB3InterceptorsFactory] Bound interceptors for joinpoint: public void fi.logiasoftware.messageserver.services.backend.MessageResenderBean.createTimer() - [Lorg.jboss.ejb3.interceptor.InterceptorInfo;@c449c6
              2006-11-06 14:27:26,574 DEBUG [org.jboss.ejb3.security.JaccHelper] MessageResenderBean has no @SecurityDomain - skipping JACC configuration
              2006-11-06 14:27:26,574 INFO [org.jboss.ejb3.EJBContainer] STARTED EJB: fi.logiasoftware.messageserver.services.backend.MessageResenderBean ejbName: MessageResenderBean
              2006-11-06 14:27:26,580 DEBUG [org.hibernate.ejb.AbstractEntityManagerImpl] No JTA transaction found
              2006-11-06 14:27:26,583 DEBUG [org.hibernate.ejb.AbstractEntityManagerImpl] Looking for a JTA transaction to join
              2006-11-06 14:27:26,587 DEBUG [org.jboss.ejb3.entity.ManagedEntityManagerFactory] ************** closing entity managersession **************
              2006-11-06 14:27:26,598 DEBUG [org.jboss.ejb.txtimer.EJBTimerServiceImpl] createTimerService: org.jboss.ejb.txtimer.TimerServiceImpl@d86cae
              2006-11-06 14:27:26,603 ERROR [org.jboss.ejb.txtimer.TimerImpl] Error invoking ejbTimeout: javax.ejb.EJBException: javax.persistence.TransactionRequiredException: No active JTA transaction on joinTransaction call
              2006-11-06 14:27:26,604 DEBUG [org.jboss.ejb.txtimer.TimerImpl] Timer was not registered with Tx, resetting state: [id=1,target=[target=jboss.j2ee:service=EJB3,ear=MessageServer.ear,jar=MessageServices.par,name=CheckerBean],remaining=-1137815,periode=120000,in_timeout]
              2006-11-06 14:27:26,604 DEBUG [org.jboss.ejb.txtimer.TimerImpl] setTimerState: active
              2006-11-06 14:27:26,619 DEBUG [org.jboss.ejb.txtimer.TimerImpl] setTimerState: created
              2006-11-06 14:27:26,622 DEBUG [org.jboss.ejb.txtimer.TimerImpl] setTimerState: active
              



              Br,

              Juha



              • 4. Re:  javax.persistence.TransactionRequiredException: No acti
                Kevin Conner Master

                I have just tried some simple tests and they all work.

                I have used the JBoss 4.0.5 GA zip and JBossTS4.2.2 zip downloads.

                Are there any other messages in your log? Could the transaction have timed out?

                JBossTS has an asynchronous timeout mechanism which will rollback the transaction after the timeout has expired. You would see this error message if you tried to access the transaction after expiry.

                Kev

                • 5. Re:  javax.persistence.TransactionRequiredException: No acti
                  Kevin Conner Master

                  Unless I am missing something these logs appear to be from two different areas of your application.

                  Have you tried enabling the debug to see what is happening?

                  Can you also describe the part of your application that is failing, it would help if I had a better understanding of what you were trying to achieve.

                  Kev

                  • 6. Re:  javax.persistence.TransactionRequiredException: No acti
                    Kevin Conner Master

                    Of course, I mean the debug in JBossTS :-)

                    Kev

                    • 7. Re:  javax.persistence.TransactionRequiredException: No acti
                      Juha Moisio Newbie

                      Hi,

                      Yes those log files are from different part of application. All I wanted to should that with default TransactionManager, it finds active tranaction to join with.

                      The cause could not be transaction timeout because
                      this is first thing my app tries to do when server is started

                      fi.logiasoftware.serviceutils.SchedulerService.start(SchedulerService.java:45)
                      i.logiasoftware.messageserver.services.backend.ConfigurationBean.getProperty(Configurati
                      onBean.java:53).

                      It tries to read 3 configuration records from db and then activate on Sessiom Timer Bean.

                      -Juha-

                      • 8. Re:  javax.persistence.TransactionRequiredException: No acti
                        Kevin Conner Master

                        Can you please describe your application and the point at which it goes wrong? I ran tests earlier which shows that transactions do work under 4.0.5.

                        If you understand the issue can you generate a small test case to demonstrate it?

                        Kev

                        • 9. Re:  javax.persistence.TransactionRequiredException: No acti
                          Kevin Conner Master

                          Can you also describe your setup? Is this a vanilla 4.0.5 and TS or have you modified either?

                          Kev

                          • 10. Re:  javax.persistence.TransactionRequiredException: No acti
                            Juha Moisio Newbie

                            Here is my jbossjta-properties.xml. Is it ok?

                            <?xml version="1.0" encoding="UTF-8"?>
                            <transaction-service>
                             <properties depends="common" name="arjuna">
                             <!--
                             Transaction Reaper Timeout (default is 120000 microseconds).
                             -->
                             <property
                             name="com.arjuna.ats.arjuna.coordinator.txReaperTimeout" value="120000"/>
                             <!--
                             Transaction Reaper Mode, can be: NORMAL or DYNAMIC (default is NORMAL).
                             -->
                             <property name="com.arjuna.ats.arjuna.coordinator.txReaperMode" value="NORMAL"/>
                             <!--
                             (default is NO)
                             -->
                             <property name="com.arjuna.ats.arjuna.coordinator.asyncCommit" value="NO"/>
                             <!--
                             (default is NO)
                             -->
                             <property name="com.arjuna.ats.arjuna.coordinator.asyncPrepare" value="NO"/>
                             <!--
                             (default is YES)
                             -->
                             <property
                             name="com.arjuna.ats.arjuna.coordinator.commitOnePhase" value="YES"/>
                             <!--
                             (default is defaultStore)
                             -->
                             <property name="com.arjuna.ats.arjuna.objectstore.localOSRoot" value="defaultStore"/>
                             <!--
                             default is under user.home - must be writeable!)
                             -->
                             <property
                             name="com.arjuna.ats.arjuna.objectstore.objectStoreDir" value="PutObjectStoreDirHere"/>
                             <!--
                             (default is ON)
                             -->
                             <property
                             name="com.arjuna.ats.arjuna.objectstore.objectStoreSync" value="ON"/>
                             <!--
                             (default is ShadowNoFileLockStore)
                             -->
                             <property
                             name="com.arjuna.ats.arjuna.objectstore.objectStoreType" value="ShadowNoFileLockStore"/>
                             <!--
                             (default is 255)
                             -->
                             <property
                             name="com.arjuna.ats.arjuna.objectstore.hashedDirectories" value="255"/>
                             <!--
                             (default is ON)
                             -->
                             <property
                             name="com.arjuna.ats.arjuna.objectstore.transactionSync" value="ON"/>
                             <!--
                             (Must be unique across all Arjuna instances.)
                             -->
                             <property name="com.arjuna.ats.arjuna.xa.nodeIdentifier" value="1"/>
                             <!-- property
                             name="com.arjuna.ats.arjuna.coordinator.actionStore"
                             value="HashedActionStore"
                             value="JDBCActionStore"
                             -->
                             <!-- property
                             name="com.arjuna.ats.arjuna.objectstore.jdbcTxDbAccess"
                             value="JDBCAccess"
                             -->
                             <!-- property
                             name="com.arjuna.ats.arjuna.objectstore.objectStoreType"
                             value="ShadowNoFileLockStore"
                             value="JDBCStore"
                             -->
                             <!-- property
                             name="com.arjuna.ats.arjuna.objectstore.jdbcUserDbAccess"
                             value="JDBCAccess"
                             -->
                             <!-- property
                             name="com.arjuna.ats.arjuna.objectstore.jdbcPoolSizeInitial"
                             value="1"
                             -->
                             <!-- property
                             name="com.arjuna.ats.arjuna.objectstore.jdbcPoolSizeMaximum"
                             value="1"
                             -->
                             <!-- property
                             name="com.arjuna.ats.arjuna.objectstore.jdbcPoolPutConnections"
                             value="false"
                             -->
                             <!-- property
                             name="com.arjuna.ats.arjuna.internal.arjuna.objectstore.cacheStore.size"
                             value=""
                             -->
                             <!-- property
                             name="com.arjuna.ats.arjuna.internal.arjuna.objectstore.cacheStore.period"
                             value=""
                             -->
                             <!--
                             The location for creating temporary files, e.g., Uids.
                             Default is under user.home.
                             IMPORTANT: make sure the directory is lockable, e.g., /tmp on Unix
                             may not be!
                             -->
                             <!--
                             <property
                             name="com.arjuna.ats.arjuna.common.varDir"
                             value="var"/>
                             -->
                             </properties>
                             <properties depends="arjuna" name="recoverymanager">
                             <!--
                             Properties used only by the RecoveryManager.
                             -->
                             <!--
                             Periodic recovery settings.
                             Time values in this section are in seconds.
                             -->
                             <!--
                             Interval in seconds between initiating the periodic recovery modules.
                             Default is 120 seconds.
                             -->
                             <property
                             name="com.arjuna.ats.arjuna.recovery.periodicRecoveryPeriod" value="120"/>
                             <!--
                             Interval in seconds between first and second pass of periodic recovery.
                             Default is 10 seconds.
                             -->
                             <property
                             name="com.arjuna.ats.arjuna.recovery.recoveryBackoffPeriod" value="10"/>
                             <!--
                             Periodic recovery modules to use. Invoked in sort-order of names.
                             -->
                             <property
                             name="com.arjuna.ats.arjuna.recovery.recoveryExtension1" value="com.arjuna.ats.internal.arjuna.recovery.AtomicActionRecoveryModule"/>
                             <property
                             name="com.arjuna.ats.arjuna.recovery.recoveryExtension2" value="com.arjuna.ats.internal.txoj.recovery.TORecoveryModule"/>
                             <!--
                             Expired entry removal
                             -->
                             <!--
                             Expiry scanners to use (order of invocation is random).
                             Names must begin with "com.arjuna.ats.arjuna.recovery.expiryScanner"
                             -->
                             <property
                             name="com.arjuna.ats.arjuna.recovery.expiryScannerTransactionStatusManager" value="com.arjuna.ats.internal.arjuna.recovery.ExpiredTransactionStatusManagerScanner"/>
                             <!--
                             Interval, in hours, between running the expiry scanners.
                             This can be quite long. The absolute value determines the interval -
                             if the value is negative, the scan will NOT be run until after one
                             interval has elapsed. If positive the first scan will be immediately
                             after startup. Zero will prevent any scanning.
                             Default = 12 = run immediately, then every 12 hours.
                             -->
                             <property
                             name="com.arjuna.ats.arjuna.recovery.expiryScanInterval" value="12"/>
                             <!--
                             Age, in hours, for removal of transaction status manager item.
                             This should be longer than any ts-using process will remain running.
                             Zero = Never removed. Default is 12.
                             -->
                             <property
                             name="com.arjuna.ats.arjuna.recovery.transactionStatusManagerExpiryTime" value="12"/>
                             <!--
                             Use this to fix the port on which the TransactionStatusManager listens,
                             The default behaviour is to use any free port.
                             -->
                             <property
                             name="com.arjuna.ats.arjuna.recovery.transactionStatusManagerPort" value="0"/>
                             <!--
                             Properties used only by the RecoveryManager.
                             -->
                             <!--
                             Periodic recovery settings.
                             Time values in this section are in seconds.
                             -->
                             <!--
                             Interval in seconds between initiating the periodic recovery modules.
                             Default is 120 seconds.
                             -->
                             <property
                             name="com.arjuna.ats.arjuna.recovery.periodicRecoveryPeriod" value="120"/>
                             <!--
                             Interval in seconds between first and second pass of periodic recovery.
                             Default is 10 seconds.
                             -->
                             <property
                             name="com.arjuna.ats.arjuna.recovery.recoveryBackoffPeriod" value="10"/>
                             <!--
                             Periodic recovery modules to use. Invoked in sort-order of names.
                             -->
                             <property
                             name="com.arjuna.ats.arjuna.recovery.recoveryExtension1" value="com.arjuna.ats.internal.arjuna.recovery.AtomicActionRecoveryModule"/>
                             <property
                             name="com.arjuna.ats.arjuna.recovery.recoveryExtension2" value="com.arjuna.ats.internal.txoj.recovery.TORecoveryModule"/>
                             <property
                             name="com.arjuna.ats.arjuna.recovery.recoveryExtension3" value="com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule"/>
                             <!--
                             Expired entry removal
                             -->
                             <!--
                             Expiry scanners to use (order of invocation is random).
                             Names must begin with "com.arjuna.ats.arjuna.recovery.expiryScanner"
                             -->
                             <property
                             name="com.arjuna.ats.arjuna.recovery.expiryScannerTransactionStatusManager" value="com.arjuna.ats.internal.arjuna.recovery.ExpiredTransactionStatusManagerScanner"/>
                             <!--
                             Interval, in hours, between running the expiry scanners.
                             This can be quite long. The absolute value determines the interval -
                             if the value is negative, the scan will NOT be run until after one
                             interval has elapsed. If positive the first scan will be immediately
                             after startup. Zero will prevent any scanning.
                             Default = 12 = run immediately, then every 12 hours.
                             -->
                             <property
                             name="com.arjuna.ats.arjuna.recovery.expiryScanInterval" value="12"/>
                             <!--
                             Age, in hours, for removal of transaction status manager item.
                             This should be longer than any ts-using process will remain running.
                             Zero = Never removed. Default is 12.
                             -->
                             <property
                             name="com.arjuna.ats.arjuna.recovery.transactionStatusManagerExpiryTime" value="12"/>
                             <!--
                             Use this to fix the port on which the TransactionStatusManager listens,
                             The default behaviour is to use any free port.
                             -->
                             <property
                             name="com.arjuna.ats.arjuna.recovery.transactionStatusManagerPort" value="0"/>
                             </properties>
                             <properties name="common">
                             <!-- CLF 2.0 properties -->
                             <property name="com.arjuna.common.util.logging.DebugLevel"
                             type="System" value="0x00000000"/>
                             <property name="com.arjuna.common.util.logging.FacilityLevel"
                             type="System" value="0xffffffff"/>
                             <property name="com.arjuna.common.util.logging.VisibilityLevel"
                             type="System" value="0xffffffff"/>
                             <property name="com.arjuna.common.util.logger" type="System" value="log4j"/>
                             </properties>
                             <properties depends="arjuna" name="txoj">
                             <!--
                             (default is LockStore of installation - must be writeable!)
                             -->
                             <!--
                             <property
                             name="com.arjuna.ats.txoj.lockstore.lockStoreDir"
                             value="LockStore"/>
                             -->
                             <!--
                             (default is BasicLockStore)
                             -->
                             <property name="com.arjuna.ats.txoj.lockstore.lockStoreType" value="BasicLockStore"/>
                             <!--
                             (default is NO)
                             -->
                             <property name="com.arjuna.ats.txoj.lockstore.multipleLockStore" value="NO"/>
                             <!--
                             (default is YES)
                             -->
                             <property name="com.arjuna.ats.txoj.lockstore.singleLockStore" value="YES"/>
                             <!--
                             (default is YES)
                             -->
                             <property
                             name="com.arjuna.ats.txoj.lockstore.allowNestedLocking" value="YES"/>
                             </properties>
                             <properties depends="arjuna" name="jta">
                             <!--
                             Support subtransactions in the JTA layer?
                             Default is NO.
                             -->
                             <property name="com.arjuna.ats.jta.supportSubtransactions" value="NO"/>
                             <property name="com.arjuna.ats.jta.jtaTMImplementation" value="com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionManagerImple"/>
                             <!--
                             com.arjuna.ats.internal.jta.transaction.jts.TransactionManagerImple
                             -->
                             <property name="com.arjuna.ats.jta.jtaUTImplementation" value="com.arjuna.ats.internal.jta.transaction.arjunacore.UserTransactionImple"/>
                             <!--
                             com.arjuna.ats.internal.jta.transaction.jts.UserTransactionImple
                             -->
                             </properties>
                             <properties depends="jta" name="jdbc">
                             <!--
                             property name="com.arjuna.ats.jdbc.isolationLevel" value="TRANSACTION_SERIALIZABLE"/>
                             -->
                             </properties>
                            </transaction-service>
                            


                            Br,

                            Juha



                            • 11. Re:  javax.persistence.TransactionRequiredException: No acti
                              Kevin Conner Master

                              Lets take this one step at a time please.

                              Please describe your setup and your application. Is this a vanilla install or have you modified anything?

                              Kev

                              • 12. Re:  javax.persistence.TransactionRequiredException: No acti
                                Juha Moisio Newbie

                                I setup JBoss 4.0.5GA using WebStart installer and downloaded JBossTS 4.2.2
                                binary release today.

                                -Juha-

                                • 13. Re:  javax.persistence.TransactionRequiredException: No acti
                                  Kevin Conner Master

                                  Hmmm, our instructions tell you not to use that because it hasn't been validated.

                                  Please try again with the zip/tar.gz distribution.

                                  Kev

                                  • 14. Re:  javax.persistence.TransactionRequiredException: No acti
                                    Juha Moisio Newbie

                                    SchedulerService is deployed from server/default/deploy/deploy.last

                                    <?xml version="1.0" encoding="UTF-8"?>
                                    
                                    <server>
                                     <mbean code="fi.logiasoftware.serviceutils.SchedulerService"
                                     name="logiasoftware.fi:service=SchedulerService"
                                     interface="fi.logiasoftware.serviceutils.SchedulerServiceManagement">
                                    
                                     </mbean>
                                    </server>
                                    


                                    package fi.logiasoftware.serviceutils;
                                    
                                    import javax.ejb.Local;
                                    import javax.ejb.Remote;
                                    import javax.ejb.TransactionAttribute;
                                    import javax.ejb.TransactionAttributeType;
                                    import javax.naming.InitialContext;
                                    import org.jboss.annotation.ejb.Management;
                                    import org.jboss.annotation.ejb.Service;
                                    import fi.logiasoftware.messageserver.services.backend.Checker;
                                    import fi.logiasoftware.messageserver.services.backend.Configuration;
                                    import fi.logiasoftware.messageserver.services.backend.MessageResender;
                                    import fi.logiasoftware.messageserver.services.backend.Scheduler;
                                    
                                    @Service
                                    @Local(SchedulerServiceLocal.class)
                                    @Remote(SchedulerServiceRemote.class)
                                    @Management(SchedulerServiceManagement.class)
                                    @TransactionAttribute(TransactionAttributeType.REQUIRED)
                                    public class SchedulerService implements SchedulerServiceLocal,
                                     SchedulerServiceRemote, SchedulerServiceManagement {
                                    
                                     InitialContext ic = null;
                                     MessageResender resender = null;
                                     Scheduler scheduler = null;
                                     Checker checker = null;
                                    
                                    
                                    
                                     // Lifecycle methods
                                     public void create() throws Exception {
                                     System.out.println("Creating SchedulerService");
                                     ic = new InitialContext();
                                     }
                                    
                                     public void start() throws Exception {
                                    
                                    
                                     scheduler = (Scheduler) ic.lookup("Scheduler");
                                     checker = (Checker) ic.lookup("Checker");
                                     resender = (MessageResender) ic.lookup("MessageResender");
                                    
                                     Configuration config = (Configuration) ic.lookup("Configuration");
                                    
                                     String autostart = config.getProperty("AUTOSTART");
                                    
                                     if(autostart.equalsIgnoreCase("yes")) {
                                     System.out.println("SchedulerService - Starting");
                                     scheduler.createScheduler();
                                    
                                     }
                                    
                                     String debug = config.getProperty("DEBUG");
                                    
                                     if(debug != null && ! debug.equalsIgnoreCase("yes")) {
                                     resender.createTimer();
                                     checker.createChecker();
                                     }
                                    
                                    
                                     System.out.println("Starting checker....");
                                    
                                     }
                                    
                                     public void stop() {
                                     System.out.println("SchedulerService - Stopping");
                                     /*
                                     resender.cancelTimer();
                                     scheduler.cancelTimers();
                                     checker.cancelTimer();
                                     */
                                    
                                     }
                                    
                                     public void destroy() {
                                     System.out.println("SchedulerService - Destroying");
                                     }
                                    }
                                    
                                    


                                    package fi.logiasoftware.messageserver.services.backend;
                                    
                                    import javax.ejb.Local;
                                    import javax.ejb.Remote;
                                    import javax.ejb.Stateless;
                                    import javax.ejb.TransactionAttribute;
                                    import javax.ejb.TransactionAttributeType;
                                    import javax.persistence.EntityManager;
                                    import javax.persistence.NoResultException;
                                    import javax.persistence.PersistenceContext;
                                    import javax.persistence.Query;
                                    import org.jboss.annotation.ejb.LocalBinding;
                                    import org.jboss.annotation.ejb.RemoteBinding;
                                    import fi.logiasoftware.messageserver.config.Systemctrl;
                                    
                                    /**
                                     * Copyright 2006 Logia Software.All rights reserved.
                                     *
                                     * This class is a Stateless bean.It is used to get system properties.
                                     *
                                     * @Stateless
                                     * @RemoteBinding(jndiBinding="Configuration")
                                     * @LocalBinding(jndiBinding="ConfigurationLocal")
                                     * @Remote(Configuration.class)
                                     * @Local(Configuration.class)
                                     *
                                     * implements Configuration
                                     *
                                     * @author hbm2java (latest modification by $Author: sam $)
                                     * @version $Revision: 1.5 $ $Date: 2006/10/26 09:23:20 $
                                     */
                                    @Stateless
                                    @RemoteBinding(jndiBinding = "Configuration") @LocalBinding(jndiBinding = "ConfigurationLocal")
                                    @Remote(Configuration.class)
                                    @Local(Configuration.class)
                                    @TransactionAttribute(TransactionAttributeType.REQUIRED)
                                    public class ConfigurationBean implements Configuration {
                                    
                                     @PersistenceContext(unitName = "MessageServer")
                                     private EntityManager entityManager;
                                    
                                     /**
                                     * Gets system properties.
                                     *
                                     * @param name :
                                     * syscode of systemctrl as String
                                     */
                                     public String getProperty(String name) {
                                    
                                     try {
                                    
                                     Query q = entityManager
                                     .createQuery("from Systemctrl s where s.syscode = :syscode");
                                     q.setParameter("syscode", name);
                                     return ((Systemctrl) q.getSingleResult()).getSysname();
                                    
                                     } catch (NoResultException e) {
                                     return null;
                                     }
                                    
                                     }
                                    
                                    }
                                    


                                    package fi.logiasoftware.messageserver.config;
                                    
                                    // Generated 22.4.2006 18:16:08 by Hibernate Tools 3.1.0 beta3
                                    
                                    import javax.persistence.Column;
                                    import javax.persistence.Entity;
                                    import javax.persistence.Id;
                                    import javax.persistence.Table;
                                    import javax.persistence.UniqueConstraint;
                                    import javax.persistence.Version;
                                    
                                    import org.hibernate.annotations.OptimisticLockType;
                                    import org.jboss.seam.annotations.Name;
                                    
                                    /**
                                     * Generated 22.4.2006 18:16:08 by Hibernate Tools 3.1.0 beta3 by hbm2java
                                     *
                                     * Copyright 2006 Logia Software.All rights reserved.
                                     *
                                     * This class is a EJB3 Entity. It stores data of systemctrl table.
                                     *
                                     * @author hbm2java (latest modification by $Author: sam $)
                                     * @version $Revision: 1.4 $ $Date: 2006/10/09 06:41:12 $
                                     */
                                    @Entity
                                    @org.hibernate.annotations.Entity(optimisticLock = OptimisticLockType.VERSION) @Table(name = "systemctrl", catalog = "MessageServer", uniqueConstraints = { @UniqueConstraint(columnNames = { "syscode" }) })
                                    @Name("systemctrl")
                                    public class Systemctrl implements java.io.Serializable {
                                     private static final long serialVersionUID = 1L;
                                    
                                     // Fields
                                    
                                     private int id;
                                    
                                     private String syscode;
                                    
                                     private String sysname;
                                    
                                     private String sysdesc;
                                    
                                     private String crossref;
                                    
                                     private long version;
                                    
                                     /**
                                     *
                                     * @return : get version of a specific system as long
                                     */
                                     @Version
                                     @Column(name = "version")
                                     public long getVersion() {
                                     return this.version;
                                     }
                                    
                                     /**
                                     *
                                     * @param version :
                                     * set version of a specific system as long
                                     */
                                     public void setVersion(long version) {
                                     this.version = version;
                                     }
                                    
                                     // Constructors
                                    
                                     /** default constructor */
                                     public Systemctrl() {
                                     }
                                    
                                     /**
                                     * minimal constructor
                                     *
                                     * @param id :
                                     * set id of a specific system as int
                                     * @param syscode :
                                     * set syscode of a specific system as String
                                     * @param sysname :
                                     * set sysname of a specific system as String
                                     */
                                     public Systemctrl(int id, String syscode, String sysname) {
                                     this.id = id;
                                     this.syscode = syscode;
                                     this.sysname = sysname;
                                     }
                                    
                                     /**
                                     * full constructor
                                     *
                                     * @param id :
                                     * set id of a specific system as int
                                     * @param syscode :
                                     * set syscode of a specific system as String
                                     * @param sysname :
                                     * set sysname of a specific system as String
                                     * @param sysdesc :
                                     * set sysdesc of a specific system as String
                                     * @param crossref :
                                     * set crossref of a specific system as String
                                     */
                                     public Systemctrl(int id, String syscode, String sysname, String sysdesc,
                                     String crossref) {
                                     this.id = id;
                                     this.syscode = syscode;
                                     this.sysname = sysname;
                                     this.sysdesc = sysdesc;
                                     this.crossref = crossref;
                                     }
                                    
                                     // Property accessors
                                     /**
                                     *
                                     * @return : get id of a specific system as int
                                     */
                                     @Id
                                     @Column(name = "id", unique = true, nullable = false, insertable = true, updatable = true)
                                     public int getId() {
                                     return this.id;
                                     }
                                    
                                     /**
                                     *
                                     * @param id :
                                     * set id of a specific system as int
                                     */
                                     public void setId(int id) {
                                     this.id = id;
                                     }
                                    
                                     /**
                                     *
                                     * @return : get syscode of a specific system as String
                                     */
                                     @Column(name = "syscode", unique = true, nullable = false, insertable = true, updatable = true, length = 30)
                                     public String getSyscode() {
                                     return this.syscode;
                                     }
                                    
                                     /**
                                     *
                                     * @param syscode :
                                     * set syscode of a specific system as String
                                     */
                                     public void setSyscode(String syscode) {
                                     this.syscode = syscode;
                                     }
                                    
                                     /**
                                     *
                                     * @return : get sysname of a specific system as String
                                     */
                                     @Column(name = "sysname", unique = false, nullable = false, insertable = true, updatable = true, length = 100)
                                     public String getSysname() {
                                     return this.sysname;
                                     }
                                    
                                     /**
                                     *
                                     * @param sysname :
                                     * set sysname of a specific system as String
                                     */
                                     public void setSysname(String sysname) {
                                     this.sysname = sysname;
                                     }
                                    
                                     /**
                                     *
                                     * @return : get sysdesc of a specific system as String
                                     */
                                     @Column(name = "sysdesc", unique = false, nullable = true, insertable = true, updatable = true, length = 100)
                                     public String getSysdesc() {
                                     return this.sysdesc;
                                     }
                                    
                                     /**
                                     *
                                     * @param sysdesc :
                                     * set sysdesc of a specific system as String
                                     */
                                     public void setSysdesc(String sysdesc) {
                                     this.sysdesc = sysdesc;
                                     }
                                    
                                     /**
                                     *
                                     * @return : get crossref of a specific system as String
                                     */
                                     @Column(name = "crossref", unique = false, nullable = true, insertable = true, updatable = true, length = 200)
                                     public String getCrossref() {
                                     return this.crossref;
                                     }
                                    
                                     /**
                                     *
                                     * @param crossref :
                                     * set crossref of a specific system as String
                                     */
                                     public void setCrossref(String crossref) {
                                     this.crossref = crossref;
                                     }
                                    
                                    }
                                    
                                    


                                    <persistence>
                                    
                                     <persistence-unit name="MessageServer" transaction-type="jta">
                                    
                                     <provider>org.hibernate.ejb.HibernatePersistence</provider>
                                     <jta-data-source>java:/MessageServicesDS</jta-data-source>
                                    
                                     <properties>
                                     <property name="hibernate.dialect">org.hibernate.dialect.MySQLInnoDBDialect</property>
                                     <!-- property name="hibernate.hbm2ddl.auto" value="create"/ -->
                                     <property name="hibernate.session_factory_name" value="ServiceConfig"/>
                                     <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup"/>
                                     <property name="hibernate.jdbc.use_get_generated_keys" value="true"/>
                                     <property name="hibernate.order_updates" value="true"/>
                                     <property name="hibernate.jdbc.batch_versioned_data" value="true"/>
                                     <property name="jta.UserTransaction" value="UserTransaction"/>
                                     <property name="hibernate.current_session_context_class" value="jta"/>
                                     <property name="hibernate.query.jpaql_strict_compliance" value="false"/>
                                     <property name="hibernate.show_sql" value="false"/>
                                     <property name="hibernate.format_sql" value="true"/>
                                     <property name="jboss.entity.manager.factory.jndi.name" value="java:/EntityManagerFactory"/>
                                     <property name="jboss.entity.manager.jndi.name" value="java:/EntityManager"/>
                                     </properties>
                                    
                                     <!-- property name="hibernate.ejb.cfgfile" value="/hibernate.cfg.xml"/ -->
                                     </persistence-unit>
                                    
                                    </persistence>
                                    


                                    <?xml version="1.0" encoding="UTF-8"?>
                                    <datasources>
                                    <xa-datasource>
                                    <jndi-name>MessageServicesDS</jndi-name>
                                    
                                    <xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class>
                                    <xa-datasource-property name="URL">jdbc:mysql://localhost:3306/MessageServer</xa-datasource-property>
                                    <user-name>XXXXXX</user-name>
                                    <password>YYYYYYY</password> <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
                                    <max-pool-size>20</max-pool-size> <min-pool-size>5</min-pool-size>
                                    
                                    <blocking-timeout-millis>2000</blocking-timeout-millis>
                                    <idle-timeout-minutes>2</idle-timeout-minutes>
                                    <track-connection-by-tx>true</track-connection-by-tx>
                                    <no-tx-separate-pools>false</no-tx-separate-pools>
                                    <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name>
                                    <!-- <valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLValidConnectionChecker</valid-connection-checker-class-name> --> <metadata> <type-mapping>mySQL</type-mapping>
                                    </metadata>
                                    </xa-datasource>
                                    
                                    </datasources>
                                    



                                    Br,

                                    Juha

                                    1 2 Previous Next