# HibernateTransactionManager Help Needed

**URL:** <https://discourse.hibernate.org/t/hibernatetransactionmanager-help-needed/4148>\
**Category:** Hibernate ORM\
**Created:** [May 11, 2020, 8:13pm UTC](https://discourse.hibernate.org/t/hibernatetransactionmanager-help-needed/4148 "2020-05-11T20:13:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![HibeUser](https://avatars.discourse-cdn.com/v4/letter/h/c6cbf5/32.png) [@HibeUser](https://discourse.hibernate.org/u/HibeUser)\
**Post date:** [May 11, 2020, 8:13pm UTC](https://discourse.hibernate.org/t/hibernatetransactionmanager-help-needed/4148/1 "2020-05-11T20:13:50Z")

</div>

I am getting below exception when running a groovy testcase. I use hibernate 5.4.14 and Spring version 4.3

javax.persistence.TransactionRequiredException: Executing an update/delete query at org.hibernate.internal.AbstractSharedSessionContract.checkTransactionNeededForUpdateOperation(AbstractSharedSessionContract.java:413) at org.hibernate.query.internal.AbstractProducedQuery.executeUpdate(AbstractProducedQuery.java:1608) at com.test.portal.example.service.CleanDataSpecification.cleanup(CleanDataSpecification.groovy:35)

Here is the transactionManager Configuration  
\<tx:annotation-driven transaction-manager=“exampleTM” /\>

```
      <bean id="exampleSF"
         class="org.springframework.orm.hibernate5.LocalSessionFactoryBean">  
        <qualifier value="example"/>
       <property name="dataSource" ref="exampleDS"/>
       <property name="hibernateProperties">
    <props>
        <prop key="hibernate.show_sql">false</prop>
        <prop key="hibernate.dialect">org.hibernate.dialect.H2Dialect</prop>
        <!--<prop key="hibernate.current_session_context_class">thread</prop>-->
        <prop key="jadira.usertype.autoRegisterUserTypes">true</prop>
        <prop key="hibernate.hbm2ddl.auto">create-drop</prop>
        <prop key="hibernate.cache.region.factory_class"> 
         org.hibernate.cache.ehcache.EhCacheRegionFactory
        </prop>
        <prop key="hibernate.cache.use_second_level_cache">false</prop>
        <prop key="hibernate.cache.use_query_cache">false</prop>
        <prop key="net.sf.ehcache.configurationResourceName">hibernate/example-ehcache.xml</prop> 
    </props>
  </property>
  <property name="packagesToScan">
      <value>com.test.portal.example.model</value>
  </property>
</bean>

 <bean id="exampleTM"
 class =      
 "org.springframework.orm.hibernate5.HibernateTransactionManager">
      <property name="sessionFactory" ref="exampleSF"/>
      <qualifier value="example"/>
 </bean>

```

```auto

```
