On Wed, Aug 01, 2001 at 02:37:45PM +0200, Jung , Dr. Christoph wrote:
> I just stumbled over the following piece of code in
> org.jboss.pool.connector.BaseConnectionManager$XAListener:

This XA stuff makes my head hurt, but I'll give it a go.

>  public void connectionClosed(ConnectionEvent evt) {
>       ...
> 
>             // XAResource is delisted
>             if(trans != null) {
>                 // Delist if closing before transaction was ended
>                 try {
>                     trans.delistResource(xar, XAResource.TMSUCCESS);
>                 } catch(SystemException e) {
>                     e.printStackTrace();
>                 }
>             }
> 
>           ...
>  }
> 
> 
> which basically means that a pooled resource is marked RS_ENDED in the
> TxCapsule after being asked to end(Xid,TMSUCCESS).
> 
> Now imagine that the resource is returned to the pool and dispensed for
> another time within the same persistent transaction. This means that
> the TxCapsule, when asked to enlistResource(), will not call
> start(Xid,TMRESUME) in order to resume the tx association.

I don't follow this.  TxCapsule.enlistResource calls
TxCapsule.startResource, which will call start on the resource
no matter what it thinks the state of the resource is.  My
reading of the code says that in the scenario you describe
above the resource will receive a start(xid, XAResource.TMJOIN)
call, which is fine, I think.

> Wouldn´t it be correct to do a 
> 
>           try {
>                     trans.delistResource(xar, XAResource.TMSUSPEND);
>                 } catch(SystemException e) {
>                     e.printStackTrace();
>                 }
> 
> instead, which would cause the state of the resource to become RS_SUSPENDED
> in the TxCapsule before returning to the pool and forcing
> the IMHO right behaviour ...

The meaning of "suspend" with regards to XA transactions is very
unclear to me.  All I've heard about it is argument (see some old
threads on this list for example).

My, admittedly limited and unclear, understanding is that TMSUCCESS
is correct.

Ole?  Aaron?

Toby.

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

Reply via email to