On 30 Jun 01, at 16:19, Ole Husgaard wrote:

> I have to warn against the obvious way of doing local
> transaction numbering:
> A server-wide WeakHashMap that maps Transaction to
> Integer.
> Problem with this is that there may not be a one-to-one
> correspondence between Transaction instances and the
> actual transactions they represent. Not long ago, the
> fast in-VM TX service could create several Transaction
> instances for the same transaction, and these different
> Transaction instances could be active at the same time.
> That is not a violation of the JTA specification. The
> only sure way we can know if different instances are
> the same transaction is by looking at the Xid of the
> transaction. Unfortunately JTA only exposes that to
> resources.

Hi Ole,

I wanted to ask about this... The JTA spec requires (in 3.3.4) that 
the Transaction object's equals and hashCode methods be 
overridden to return true or the same hash number, respectively, if 
the target object and parameter object both refer to the same 
global transaction. These are enough to ensure a HashMap 
functions correctly, and to allow us to find out if different instances 
refer to the same transaction. Did I misunderstand your point (or 
perhaps the spec)?

-Dan


_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to