• 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:

Hello All I am working on TransactionManagement is SpringJDBC

 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
http://ayushsuman.blogspot.com/2010/05/spring-transaction-using-jdbctemplate.html

While working on that example application. The application is not caring about Transaction. Did any one worked on Transactions can suggest what went wrong in this application? In this if there is any error in child table insert parent table record should also rollback. The rollback doesn't happen.

Regards,

Swaroop Kunduru.
 
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
I wouldn't follow that post. While it works, it isn't the best practice way to do Transactions in Spring.

Transactions should be scoped to a use case, not to an individual database query. This way the entire use case is transactional, and we can share one connection to the database, and if any part of the use case fails it will rollback the transaction for all the database calls in that use case.

I recommend looking at the Spring Framework documentation at www.springframework.org or buy the Spring In Action Edition 3 book.

Mark
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic