Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jta-dev] Question on registerInterposedSynchronization() when marked for rollback

I (think) I posted a response on the JTA forum saying the following:

The JTA 1.1 version of the specification has improved the wording. In the section `Interface TransactionSynchronizationRegistry` where it describes the registerInterposedSynchronization method it says:

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

and then it says

  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 "is not associated with a transaction". In other words the "active transaction context" is whatever transaction is currently associated with the calling thread.

On Mon, Oct 11, 2021 at 9:06 AM Norbert Wirges <norbert.wirges00+eclipse@xxxxxxxxx> wrote:
Hi.

I already tried asking this on the JTA forum
(https://www.eclipse.org/forums/index.php/t/1109138/)., but did not
get a response.

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 the 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?
(Maybe  for the next version the wording could be made non-ambiguous?)

For reference: I'm asking because of the discussion on
https://issues.redhat.com/browse/WFLY-15377

Thanks in advance,
Norbert
_______________________________________________
jta-dev mailing list
jta-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/jta-dev



--
Michael Musgrove

JBoss, by Red Hat
Registered Address: Red Hat Ltd, 6700 Cork Airport Business Park, Kinsale Road, Co. Cork.
Registered in the Companies Registration Office, Parnell House, 14 Parnell Square, Dublin 1, Ireland, No.304873
Directors:Michael Cunningham (USA), Vicky Wiseman (USA), Michael O'Neill, Keith Phelan, Matt Parson (USA)



Back to the top