title: Getting "transaction is not active" when trying to run a Spring @Transactional service method in my WAR
body: <p>I'm using Spring 3.1.1.RELEASE, Hibernate 4.1.0.Final, and JBoss 7.1.1.Final.  When I try and run a service method in which I have annotated the method as @Transactional, I'm getting the following error after the transaction completes:</p>
  
  <pre><code>19:25:43,968 WARN  [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (http--127.0.0.1-8080-1) SQL Error: 0, SQLState: null
  19:25:43,973 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/myprojectclient].[dispatcher]] (http--127.0.0.1-8080-1) Servlet.service() for servlet dispatcher threw exception: javax.resource.ResourceException:     IJ000459: Transaction is not active: tx=TransactionImple &lt; ac, BasicAction: 0:ffffc0a80064:-6b6427d:5114500c:3bd status: ActionStatus.ABORT_ONLY &gt;
      at org.jboss.jca.core.connectionmanager.tx.TxConnectionManagerImpl.getManagedConnection(TxConnectionManagerImpl.java:352)
      at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.allocateConnection(AbstractConnectionManager.java:464)
      at org.jboss.jca.adapters.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:129)
      at org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider.getConnection(InjectedDataSourceConnectionProvider.java:67) [hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final]
      at org.hibernate.internal.AbstractSessionImpl$NonContextualJdbcConnectionAccess.obtainConnection(AbstractSessionImpl.java:276) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
      at org.hibernate.engine.jdbc.internal.LogicalConnectionImpl.obtainConnection(LogicalConnectionImpl.java:297) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
      at org.hibernate.engine.jdbc.internal.LogicalConnectionImpl.getConnection(LogicalConnectionImpl.java:169) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
      at org.hibernate.engine.jdbc.internal.proxy.ConnectionProxyHandler.extractPhysicalConnection(ConnectionProxyHandler.java:82) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
      at org.hibernate.engine.jdbc.internal.proxy.ConnectionProxyHandler.continueInvocation(ConnectionProxyHandler.java:138) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
      at org.hibernate.engine.jdbc.internal.proxy.AbstractProxyHandler.invoke(AbstractProxyHandler.java:81) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
      at $Proxy169.prepareStatement(Unknown Source)   at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$5.doPrepare(StatementPreparerImpl.java:147) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
      at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:166) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
      at org.hibernate.engine.jdbc.internal.StatementPreparerImpl.prepareQueryStatement(StatementPreparerImpl.java:145) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
      at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1739) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
      at org.hibernate.loader.Loader.doQuery(Loader.java:828) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
      at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:289) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
      at org.hibernate.loader.Loader.doList(Loader.java:2463) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
      at org.hibernate.loader.Loader.doList(Loader.java:2449) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
      at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2279) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
      at org.hibernate.loader.Loader.list(Loader.java:2274) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
      at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:470) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
      at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:355) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
      at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:196) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
      at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1115) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
      at org.hibernate.internal.QueryImpl.list(QueryImpl.java:101) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
      at org.hibernate.ejb.QueryImpl.getSingleResult(QueryImpl.java:280) [hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final]
      at org.hibernate.ejb.criteria.CriteriaQueryCompiler$3.getSingleResult(CriteriaQueryCompiler.java:264) [hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final]
      at org.mainco.subco.core.repo.AbstractHibernateDAO.findByUniqueConstraint(AbstractHibernateDAO.java:100) [core-0.0.1-SNAPSHOT.jar:]
      at org.mainco.subco.user.repo.RoleDaoImpl.findRoleByName(RoleDaoImpl.java:17) [user-0.0.1-SNAPSHOT.jar:]
      at org.mainco.subco.myproject.service.TrainingSessionServiceImpl.addUserLinks(TrainingSessionServiceImpl.java:222) [pd-0.0.1-SNAPSHOT.jar:]
      at org.mainco.subco.myproject.service.TrainingSessionServiceImpl.createOrUpdateTrainingSessionFromOrder(TrainingSessionServiceImpl.java:141) [pd-0.0.1-SNAPSHOT.jar:]
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [classes.jar:1.6.0_37]
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [classes.jar:1.6.0_37]
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [classes.jar:1.6.0_37]
      at java.lang.reflect.Method.invoke(Method.java:597) [classes.jar:1.6.0_37]
      at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:318) [spring-aop-3.1.1.RELEASE.jar:3.1.1.RELEASE]
      at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) [spring-aop-3.1.1.RELEASE.jar:3.1.1.RELEASE]
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) [spring-aop-3.1.1.RELEASE.jar:3.1.1.RELEASE]
      at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110) [spring-tx-3.1.1.RELEASE.jar:3.1.1.RELEASE]
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) [spring-aop-3.1.1.RELEASE.jar:3.1.1.RELEASE]
      at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) [spring-aop-3.1.1.RELEASE.jar:3.1.1.RELEASE]
      at $Proxy132.createOrUpdateTrainingSessionFromOrder(Unknown Source) at org.mainco.subco.myproject.quartz.ProcessPDWorker.createTrainingSessions(ProcessPDWorker.java:106) [classes:]
      at org.mainco.subco.myproject.quartz.ProcessPDWorker.createOrUpdateTrainingSessions(ProcessPDWorker.java:85) [classes:]
      at org.mainco.subco.myproject.quartz.ProcessPDWorker.work(ProcessPDWorker.java:67) [classes:]
      at org.mainco.subco.myproject.controller.IndexController.execute(IndexController.java:66) [classes:]
      at org.mainco.subco.myproject.controller.IndexController.refreshPD(IndexController.java:38) [classes:]
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [classes.jar:1.6.0_37]
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [classes.jar:1.6.0_37]
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [classes.jar:1.6.0_37]
      at java.lang.reflect.Method.invoke(Method.java:597) [classes.jar:1.6.0_37]
      at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:213) [spring-web-3.1.1.RELEASE.jar:3.1.1.RELEASE]
      at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:126) [spring-web-3.1.1.RELEASE.jar:3.1.1.RELEASE]
      at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:96) [spring-webmvc-3.1.1.RELEASE.jar:3.1.1.RELEASE]
      at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:617) [spring-webmvc-3.1.1.RELEASE.jar:3.1.1.RELEASE]
      at  org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:578) [spring-webmvc-3.1.1.RELEASE.jar:3.1.1.RELEASE]
      at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80) [spring-webmvc-3.1.1.RELEASE.jar:3.1.1.RELEASE]
      at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:923) [spring-webmvc-3.1.1.RELEASE.jar:3.1.1.RELEASE]
      at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852) [spring-webmvc-3.1.1.RELEASE.jar:3.1.1.RELEASE]
      at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882) [spring-webmvc-3.1.1.RELEASE.jar:3.1.1.RELEASE]
      at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778) [spring-webmvc-3.1.1.RELEASE.jar:3.1.1.RELEASE]
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:734) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.13.Final.jar:]
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]
      at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:322) [spring-security-web-3.1.1.RELEASE.jar:3.1.1.RELEASE]
      at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:116) [spring-security-web-3.1.1.RELEASE.jar:3.1.1.RELEASE]
      at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83) [spring-security-web-3.1.1.RELEASE.jar:3.1.1.RELEASE]
      at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) [spring-security-web-3.1.1.RELEASE.jar:3.1.1.RELEASE]
      at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113) [spring-security-web-3.1.1.RELEASE.jar:3.1.1.RELEASE]
      at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) [spring-security-web-3.1.1.RELEASE.jar:3.1.1.RELEASE]
      at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:103) [spring-security-web-3.1.1.RELEASE.jar:3.1.1.RELEASE]
      at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) [spring-security-web-3.1.1.RELEASE.jar:3.1.1.RELEASE]
      at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113) [spring-security-web-3.1.1.RELEASE.jar:3.1.1.RELEASE]
      at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) [spring-security-web-3.1.1.RELEASE.jar:3.1.1.RELEASE]
      at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54) [spring-security-web-3.1.1.RELEASE.jar:3.1.1.RELEASE]
      at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) [spring-security-web-3.1.1.RELEASE.jar:3.1.1.RELEASE]
      at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45) [spring-security-web-3.1.1.RELEASE.jar:3.1.1.RELEASE]
      at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) [spring-security-web-3.1.1.RELEASE.jar:3.1.1.RELEASE]
      at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:182) [spring-security-web-3.1.1.RELEASE.jar:3.1.1.RELEASE]
      at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) [spring-security-web-3.1.1.RELEASE.jar:3.1.1.RELEASE]
      at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87) [spring-security-web-3.1.1.RELEASE.jar:3.1.1.RELEASE]
      at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) [spring-security-web-3.1.1.RELEASE.jar:3.1.1.RELEASE]
      at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:184) [spring-security-web-3.1.1.RELEASE.jar:3.1.1.RELEASE]
      at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:155) [spring-security-web-3.1.1.RELEASE.jar:3.1.1.RELEASE]
      at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346) [spring-web-3.1.1.RELEASE.jar:3.1.1.RELEASE]
      at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259) [spring-web-3.1.1.RELEASE.jar:3.1.1.RELEASE]
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.13.Final.jar:]
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.13.Final.jar:]
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.13.Final.jar:]
      at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50) [jboss-as-jpa-7.1.1.Final.jar:7.1.1.Final]
      at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.13.Final.jar:]
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.13.Final.jar:]
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.13.Final.jar:]
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) [jbossweb-7.0.13.Final.jar:]
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.13.Final.jar:]
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671) [jbossweb-7.0.13.Final.jar:]
      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930) [jbossweb-7.0.13.Final.jar:]
      at java.lang.Thread.run(Thread.java:680) [classes.jar:1.6.0_37]
  </code></pre>
  
  <p>Here is the persistence.xml I'm using …</p>
  
  <pre><code>&lt;persistence version="2.0"
      xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
          http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"&gt;
      &lt;persistence-unit name="myprojectclientunit" transaction-type="JTA"&gt;
          &lt;!-- &lt;provider&gt;org.hibernate.ejb.HibernatePersistence&lt;/provider&gt; --&gt;
          &lt;jta-data-source&gt;java:jboss/datasources/MySqlDS&lt;/jta-data-source&gt;
          &lt;class&gt;org.mainco.subco.ecom.domain.Product&lt;/class&gt;
          &lt;class&gt;org.mainco.subco.ebook.domain.TableOfContentsItem&lt;/class&gt;
          &lt;class&gt;org.mainco.subco.ebook.domain.Resource&lt;/class&gt;
          &lt;class&gt;org.mainco.subco.ebook.domain.Ebook&lt;/class&gt;
          &lt;class&gt;org.mainco.subco.ebook.domain.Part&lt;/class&gt;
          &lt;class&gt;org.mainco.subco.ebook.domain.Content&lt;/class&gt;
          &lt;class&gt;org.mainco.subco.ebook.domain.ContentTopic&lt;/class&gt;
          &lt;class&gt;org.mainco.subco.standards.domain.AbTopic&lt;/class&gt;
          &lt;class&gt;org.mainco.subco.standards.domain.AbStandard&lt;/class&gt;
          &lt;class&gt;org.mainco.subco.standards.domain.AbMss&lt;/class&gt;
          &lt;class&gt;org.mainco.subco.standards.domain.CorrelationType&lt;/class&gt;
          &lt;class&gt;org.mainco.subco.core.domain.Grade&lt;/class&gt;
          &lt;class&gt;org.mainco.subco.core.domain.Subject&lt;/class&gt;
          &lt;class&gt;org.mainco.subco.ecom.domain.Contract&lt;/class&gt;
          &lt;class&gt;org.mainco.subco.organization.domain.Country&lt;/class&gt;
          &lt;class&gt;org.mainco.subco.organization.domain.State&lt;/class&gt;
          &lt;class&gt;org.mainco.subco.organization.domain.Address&lt;/class&gt;
          &lt;class&gt;org.mainco.subco.organization.domain.OrganizationType&lt;/class&gt;
          &lt;class&gt;org.mainco.subco.organization.domain.Organization&lt;/class&gt;
          &lt;class&gt;org.mainco.subco.user.domain.User&lt;/class&gt;
          &lt;class&gt;org.mainco.subco.user.domain.UserContract&lt;/class&gt;
          &lt;class&gt;org.mainco.subco.user.domain.Role&lt;/class&gt;
          &lt;class&gt;org.mainco.subco.pd.domain.AccessCode&lt;/class&gt;
          &lt;class&gt;org.mainco.subco.pd.domain.Link&lt;/class&gt;
          &lt;class&gt;org.mainco.subco.pd.domain.LinkType&lt;/class&gt;
          &lt;class&gt;org.mainco.subco.pd.domain.TrainingSession&lt;/class&gt;
          &lt;class&gt;org.mainco.subco.pd.domain.TrainingSessionTrainer&lt;/class&gt;
          &lt;class&gt;org.mainco.subco.pd.domain.TrainingSessionMaterial&lt;/class&gt;
          &lt;class&gt;org.mainco.subco.pd.domain.TrainingSessionTeacher&lt;/class&gt;
          &lt;class&gt;org.mainco.subco.pd.domain.SBTrainer&lt;/class&gt;
          &lt;properties&gt;
              &lt;property name="hibernate.ejb.cfgfile" value="/hibernate.cfg.xml" /&gt;
              &lt;property name="jboss.entity.manager.factory.jndi.name"
                  value="java:jboss/subco/myprojectpersistence" /&gt;
          &lt;/properties&gt;
      &lt;/persistence-unit&gt;
  &lt;/persistence&gt;
  </code></pre>
  
  <p>and here's how I setup my datasource/entitymanager in my Spring application context:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jee="http://www.springframework.org/schema/jee"
      xmlns:tx="http://www.springframework.org/schema/tx"
      xsi:schemaLocation="http://www.springframework.org/schema/beans
             http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
             http://www.springframework.org/schema/tx
             http://www.springframework.org/schema/tx/spring-tx.xsd
             http://www.springframework.org/schema/jee 
             http://www.springframework.org/schema/jee/spring-jee.xsd"&gt;
  
      &lt;!-- JNDI name for EntityManagerFactory is defined in src/main/resources/META-INF/persistence.xml --&gt;
      &lt;jee:jndi-lookup jndi-name="java:jboss/subco/myprojectpersistence"
          id="entityManagerFactory" expected-type="javax.persistence.EntityManagerFactory" /&gt;
  
      &lt;bean id="entityManager" class="org.springframework.orm.jpa.support.SharedEntityManagerBean"&gt;
          &lt;property name="entityManagerFactory" ref="entityManagerFactory" /&gt;
      &lt;/bean&gt;
  
      &lt;!-- Application properties --&gt;
      &lt;bean id="propertyConfigurer"
          class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"&gt;
          &lt;property name="locations"&gt;
              &lt;list&gt;
                  &lt;value&gt;classpath:application.properties&lt;/value&gt;
              &lt;/list&gt;
          &lt;/property&gt;
          &lt;property name="ignoreUnresolvablePlaceholders" value="true" /&gt;
      &lt;/bean&gt;
  
      &lt;jee:jndi-lookup jndi-name="java:jboss/datasources/MySqlDS" id="dataSource" expected-type="javax.sql.DataSource"/&gt;
  
      &lt;tx:jta-transaction-manager /&gt;
  
  &lt;/beans&gt;
  </code></pre>
  
  <p>My datasources element in my $JBOSS_HOME/standalone/configuration/standalone.xml file looks like this …</p>
  
  <pre><code>        &lt;datasources&gt;
              &lt;datasource jndi-name="java:jboss/datasources/MySqlDS" pool-name="MySqlDS" enabled="true" use-java-context="true"&gt;
                  &lt;connection-url&gt;jdbc:mysql://localhost:3306/mydb&lt;/connection-url&gt;
                  &lt;driver&gt;mysql&lt;/driver&gt;
                  &lt;transaction-isolation&gt;TRANSACTION_READ_COMMITTED&lt;/transaction-isolation&gt;
                  &lt;pool&gt;
                      &lt;min-pool-size&gt;10&lt;/min-pool-size&gt;
                      &lt;max-pool-size&gt;100&lt;/max-pool-size&gt;
                      &lt;prefill&gt;true&lt;/prefill&gt;
                  &lt;/pool&gt;
                  &lt;security&gt;
                      &lt;user-name&gt;username&lt;/user-name&gt;
                      &lt;password&gt;password&lt;/password&gt;
                  &lt;/security&gt;
                  &lt;statement&gt;
                      &lt;prepared-statement-cache-size&gt;32&lt;/prepared-statement-cache-size&gt;
                      &lt;share-prepared-statements&gt;true&lt;/share-prepared-statements&gt;
                  &lt;/statement&gt;
              &lt;/datasource&gt;
              &lt;drivers&gt;
                  &lt;driver name="mysql" module="com.mysql"/&gt;
              &lt;/drivers&gt;
          &lt;/datasources&gt;
  </code></pre>
  
  <p>Any ideas how I attack this?</p>
  
  <p><b>Edit:</b>  Adding the method that I mark as @Transactional ...</p>
  
  <pre><code>@Service("trainingSessionService")
  @Transactional
  public class TrainingSessionServiceImpl implements TrainingSessionService
  {
      …
      public TrainingSession createOrUpdateTrainingSessionFromOrder(final Order order)
      {
          TrainingSession trSession = m_trainingSessionDao.findByOrderNumber(order.getId());
  
          LOG.info("Creating/updating training session associated with order #" + order.getId() + " associated with account " + (order.getAccount() != null ? order.getAccount().getAccountName() : "unknown"));;
          if (trSession == null)
          {
              trSession = new TrainingSession();
          } // if
          // Update training session fields from the order from which it
          // originated.
          trSession.setDescription("");
          trSession.setOrderNum(order.getId());
          final Set&lt;Organization&gt; implementingSchools = getImplementingSchools(order);
          trSession.setImplementingSchools(implementingSchools);
          final java.util.Date startDate = order.getDay1() != null ? order.getDay1() : Calendar.getInstance().getTime();
          trSession.setStartDate(startDate);
          trSession.setEndDate(order.getLastDay());
          trSession.setSubject(order.getInstituteSubject());
          trSession.setStatus(order.getStatus());
          addImplementationManager(trSession, order);
          m_trainingSessionDao.save(trSession);
          LOG.info("Finished saving training session with order id " + order.getId());
          // Adds SB coordinator and teacher links if they didn't already
          // exist before.
          addUserLinks(trSession);
          return trSession;
      }   // createOrUpdateTrainingSessionFromOrder  
  </code></pre>