The doubt i am having is if method1, method2 and method3 executes with 3 independent Transactions and only method 3 results in Runtime Exception. If we are discarding the bean we are discarding the effects caused by method1 and method2 as well. Ideally only effects caused by method3 should get rolled back.
you'll get a reference to a new instance, so instance variable counter (its conversational state) will be set to 0.
Originally posted by Juggy Obhi:
I believe that when you regain the reference (to the new bean), Container should be intelligent enough to return you a bean with counter=10 and Tx1 and Tx2 performed in method1 and method2 respectively committed in the database. In other words a bean exactly similar to the original bean right before method3().
Are you okay? You look a little big. Maybe this tiny ad will help:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koophttps://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton