Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Transaction Implementation.

 
Anton Golovin
Ranch Hand
Posts: 531
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How exactly is transaction implemented in code?
[ September 09, 2008: Message edited by: Anton Golovin ]
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
session.beginTransaction();

//do stuff

session.getTransaction().commit();

That's how we did it with a Hibernate Session. Using an Entity Manager shouldn't be much different. It's pretty simple. Check out the JavaDoc for the UserTransaction object for methods.

-Cameron McKenzie
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!