Win a copy of Java Challengers this week in the Java in General forum!
  • 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
  • Paul Clapham
  • Ron McLeod
  • paul wheaton
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • Mikalai Zaikin
  • Himai Minh

Springmvc-Single insert or update statment is required for transaction management?

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

My application is running in spring MVC. we are using transaction template used only multiple insert or update statement.

For single table insert or update we are not using any transaction management.

Is it right or we need to handle transaction management for every statement(insert,update)..

Thanks,
selva
 
ranger
Posts: 17346
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
Whenever I have any code dealing in any way with the database, I always run that in a Transaction. Even when I am just reading. There are still things that I need especially isolation level if my application is being used by more than one person. So in a query, I might still need to be fully isoloated from other user's transactions.

Also, I use Hibernate 99.99999% of the time and Hibernate always requires a Transaction to talk to the database.

So my answer for many reasons is to always use transactions when talking to a database. With any Data Access Technology and any CRUD operations.

Good Luck

Mark
 
selva raja
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks...
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic