ConfigurableTransactionSupport SPI

The J2EE Connector 1.5 specification allows a resource adapter to use the "Transactional Support" attribute to specify
the level of tx support the RA handles. However the resource adapter vendor does not have a mechanism to figure out the current transactional context in which a ManagedConnectionFactory is used. For example, in GlassFish the MCF instance (tied to a connector connection pool) is currently unaware of the "transaction-support" configured in the pool.

From GlassFishV2, a ManagedConnectionFactory could implement an optional interface called ConfigurableTransactionSupport, to be notified by the application server to indicate the "transaction-support" configured for the pool. This setting would be done when the MCF instance is created for a pool.

Please note though the application server would set the current configured "transaction-support" value of the connection pool, connections obtained from the connection pool could be used in a transaction level lower than the configured value. For example, a connection obtained from a pool that is configured as XA_TRANSACTION could be used as a LOCAL resource in a LAO transaction (or) a connection obtained from a XA_TRANSACTION pool could be used in a non-transactional context.

package com.sun.appserv.connectors.spi;

public enum TransactionSupport { NO_TRANSACTION, LOCAL_TRANSACTION, XA_TRANSACTION };

/**
 * An optional interface that could be implemented by a resource adapter's
 * ManagedConnectionFactory to be notified of the configured "transaction-support"
 * of the connection pool associated with the ManagedConnectionFactory instance
 */
public interface ConfigurableTransactionSupport {

    public void setTransactionSupport(TransactionSupport ts);

}