Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jta-dev] What is the specified behavior of enlistResource when called with the same payload twice?

The XA specification (on which JTA is based) says, in the definition of the xa_start ( ) method, that the TM should pass in a flag to indicate whether or not it wants a thread to join the work of an existing branch or wants a new one. In your example it is clear that the same branch should be used.

On Thu, Nov 10, 2022 at 8:29 PM Laird Nelson <ljnelson@xxxxxxxxx> wrote:
On Thu, Nov 10, 2022 at 11:36 AM Laird Nelson <ljnelson@xxxxxxxxx> wrote:
Right. I know that in Narayana, for example, there are two checks: one is an instance-based check (did the caller supply the same object reference twice or more in a row?), and then an isSameRM call.

(My mistake: the first is not an instance-based check, but an ordinary equals()-based check (it's not an IdentityHashMap lookup or anything like that, just a regular Hashtable lookup). So if I invoke enlistResource twice with two different XAResource object references that are equal according to the contract of Object#equals(Object), the second one will be ignored, and no isSameRM call will be issued.  I don't know whether that is implied by or stated in the specification or not but as these little things build up it would be nice to have some specification text around them, even if it's non-normative.)

Best,
Laird
_______________________________________________
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