• 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 ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Rob Spoor
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Carey Brown
Bartenders:

How to Handle Transactions with Spring HibernateTemplate.

 
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I want to insert data in two tables the corresponding pojo classes are mypojo1 and mypojo2. my code and problem is like bellow.



if second saveOrUpdate() method is failed i want to rollback first mypojo1 data insertion also. how can i achieve this with the
HibernateTemplate.

if any one know the solution please post..

Thanks,
Praneeth.
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do you know how to do Spring transactions? configure a TransactionManager and then declare which methods you want to be transactional. You don't have to do anything with HibernateTemplate or Hibernate directly to get it to work with Spring Transactions.

Mark
reply
    Bookmark Topic Watch Topic
  • New Topic