hmm so @CommitAfter works as REQUIRES_NEW. A new transaction is created for each method.
It would be great if the core support for hibernate would add more transactional support. Maybe for 5.2? :) Does anybody know if there are plans for something like this? On Thu, May 28, 2009 at 8:04 PM, Robert Zeigler <robe...@scazdl.org> wrote: > Not quite. > The commit happens immediately after function exit, and it commit the > current transaction, subsequent actions will then be performed in a new > transaction, as detailed by Igor. > So, the flow for your scenario is (assuming you haven't committed the > current transaction (t1) before calling function A): > > call function A (t1) > call function B (t1) > end function B (t1) > commit current transaction (t1), replace current with a new transaction > (t2) > end function A (t2) > commit current transaction (t2), replace with a new transaction (t3) > > Remainder of request happens with transaction t3. > > HTH, > > Robert > > > On May 26, 2009, at 5/262:42 AM , sodium wrote: > > >> Thanks Igor, >> >> I think i understand it now. Basically every function which is annotated >> with @CommitAfter will be commited at the end of the request when session >> is >> detached. I guess the only way is to group together whatever i wanted to >> achieve into a single function and have it @CommitAfter. >> >> >> Igor Drobiazko wrote: >> >>> >>> @CommitAfter commits the transaction of the request. The transaction is >>> created when the session is attached to the request. When functionB() is >>> called the transaction will be committed and a new one will be created. >>> So >>> functionA() will commit the later transaction. >>> >>> On Tue, May 26, 2009 at 5:46 AM, sodium <sodiu...@yahoo.com> wrote: >>> >>> >>>> A quick question about tapestry-hibernate rollback propagation. As far >>>> as >>>> i >>>> know, any function annotated with @CommitAfter will create a new >>>> transaction >>>> similar to EJB required_new. But how would the nested functions behave? >>>> >>>> For eg. >>>> >>>> @CommitAfter >>>> public void functionA() { >>>> functionB(); >>>> } >>>> >>>> @CommitAfter >>>> public void functionB() {} >>>> >>>> >>>> If functionB failed to commit: >>>> 1) Will functionA be rollback? >>>> 2) Or will functionA be commited under another new transaction >>>> regardless >>>> of >>>> functionB? >>>> >>>> >>>> -- >>>> View this message in context: >>>> >>>> http://www.nabble.com/%40CommitAfter-rollback-propagation-tp23716428p23716428.html >>>> Sent from the Tapestry - User mailing list archive at Nabble.com. >>>> >>>> >>>> --------------------------------------------------------------------- >>>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org >>>> For additional commands, e-mail: users-h...@tapestry.apache.org >>>> >>>> >>>> >>> >>> -- >>> Best regards, >>> >>> Igor Drobiazko >>> >>> >>> >> -- >> View this message in context: >> http://www.nabble.com/%40CommitAfter-rollback-propagation-tp23716428p23718188.html >> Sent from the Tapestry - User mailing list archive at Nabble.com. >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org >> For additional commands, e-mail: users-h...@tapestry.apache.org >> > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > >