• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
  • Mikalai Zaikin

Will HibernateTransactionManager rollback jdbc transactions?

Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ... Will HibernateTransactionManager rollback hibernate operations only or will it rollback any operation(like a jdbc insert) on the db.

If it does not rollback jdbc transactions then please let me know as to what could be done to rollback a combination(hibernate/jdbc) of db transactions.

Below is the code that i am using.

<beans xmlns="http://www.springframework.org/schema/beans"

<bean id="transactionInterceptor" class="org.springframework.transaction.interceptor.TransactionInterceptor">
<property name="transactionManager" ref="transactionManager" />
<property name="transactionAttributes">
<prop key="save">PROPAGATION_REQUIRED</prop> ------- adding transaction interceptor on all the save methods.

<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="dataSource" ref="dataSource" />
<property name="sessionFactory" ref="sessionFactory" />

public void save(Product product){
jdbc call to insert into a table; }
public class ProductQohDaoImpl extends HibernateDaoSupport implements ProductQohDao{

public void save(ProductQoh productQoh){
int x = 1/0; ---deliberately throwing an exception to rollback the transactions

Thank you for your help.
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic