Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Transaction Implementation.  RSS feed

 
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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!