• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

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: 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
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...
reply
    Bookmark Topic Watch Topic
  • New Topic