Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

what happen if we call another method within the transaction block

 
Samanthi perera
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this is my class


what happen if we call another method within the transaction block
1)Does that method also join the transaction or not?
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kind of depends on your TransactionManager. If you use the built in Hibernate transaction, meaning it doesn't say join a JTA Transaction that is already running and you call another method where you pass one of your domain objects that you loaded from the Session, then Hibernate will still be managing your domain object, and if you change a value in the domain object in that other method, then return and call commit, then that change will be flushed to the database.

Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic