Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Project for JTA » TransactionSynchronizationRegistry.registerInterposedSynchronization() when marked for rollback(Clarification on spec for TransactionSynchronizationRegistry when marked for rollback)
TransactionSynchronizationRegistry.registerInterposedSynchronization() when marked for rollback [message #1845117] Thu, 07 October 2021 16:35 Go to next message
Norbert Wirges is currently offline Norbert WirgesFriend
Messages: 1
Registered: October 2021
Junior Member
Most methods of TransactionSynchronizationRegistry throw an IllegalStateException "if no transaction is active", most notably : TransactionSynchronizationRegistry.registerInterposedSynchronization()

Does "if no transaction is active" mean
a) if no transaction is present on the current thread
b) if no transaction in state ACTIVE is present on the current thread
(or something entirely different)?

More concrete: how should registerInterposedSynchronization() behave in case current transaction is marked for rollback? Should it reject the action with an IllegalStateException or accept the registered synchronization and execute afterCompletion() when the rollback actually happens?

For reference: I'm asking because of the discussion on WFLY-15377

[Updated on: Fri, 08 October 2021 07:30]

Report message to a moderator

Re: TransactionSynchronizationRegistry.registerInterposedSynchronization() when marked for rollback [message #1847063 is a reply to message #1845117] Wed, 13 October 2021 12:08 Go to previous message
Michael Musgrove Hat is currently offline Michael Musgrove HatFriend
Messages: 1
Registered: October 2021
Junior Member
The JTA 1.1 version of the specification has improved the wording in this area. In the section with the title "Interface TransactionSynchronizationRegistry` where it describes the registerInterposedSynchronization method (at the bottom of page 46) it says:

"If this method is invoked without an active transaction context, an IllegalStateException is thrown."

and then it says what exceptions are thrown:

" Throws: IllegalStateException
Thrown if the current thread is not associated with a transaction."

which implies that "without an active transaction context" has the same meaning as "the current thread is not associated with a transaction". In other words the "active transaction context" is whatever transaction is currently associated with the calling thread.
Goto Forum:
  


Current Time: Thu Apr 25 21:12:15 GMT 2024

Powered by FUDForum. Page generated in 0.03413 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top