org.objectweb.jonas.dbm
Class PoolItem

java.lang.Object
  |
  +--org.objectweb.jonas.dbm.PoolItem
All Implemented Interfaces:
org.objectweb.transaction.api.ResourceManagerEvent, javax.transaction.Synchronization

public class PoolItem
extends java.lang.Object
implements org.objectweb.transaction.api.ResourceManagerEvent, javax.transaction.Synchronization

This class represents a connection stored in the pool. It may be in different states: - available and reuseable for this user (open=0, tx=null) - reusable for the same transaction, not already committed (open=?, tx!=null) - still open, but not involved in a Tx (open=1, tx=null) These 2 cases must be considered: close after commit, commit after close. We cannot suppose what shema the user will use and we must handle both correctly.


Field Summary
 javax.transaction.Transaction enlistedInTx
           
 long lMaxAgeMillis
           
 int number
           
 int open
           
 javax.transaction.Transaction tx
           
 java.lang.String user
           
 javax.sql.XAConnection xaConn
           
 
Constructor Summary
PoolItem(Pool pool, javax.sql.XAConnection xac, java.lang.String user, long maxage)
           
 
Method Summary
 void afterCompletion(int status)
          synchronization implementation
 void beforeCompletion()
          synchronization implementation
 void enlistConnection(javax.transaction.Transaction transaction)
          implementation of resource manager event
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

xaConn

public javax.sql.XAConnection xaConn

user

public java.lang.String user

open

public int open

tx

public javax.transaction.Transaction tx

enlistedInTx

public javax.transaction.Transaction enlistedInTx

lMaxAgeMillis

public long lMaxAgeMillis

number

public int number
Constructor Detail

PoolItem

public PoolItem(Pool pool,
                javax.sql.XAConnection xac,
                java.lang.String user,
                long maxage)
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

enlistConnection

public void enlistConnection(javax.transaction.Transaction transaction)
                      throws javax.transaction.SystemException
implementation of resource manager event
Specified by:
enlistConnection in interface org.objectweb.transaction.api.ResourceManagerEvent

beforeCompletion

public void beforeCompletion()
synchronization implementation
Specified by:
beforeCompletion in interface javax.transaction.Synchronization

afterCompletion

public void afterCompletion(int status)
synchronization implementation
Specified by:
afterCompletion in interface javax.transaction.Synchronization