public Transaction getTransactionForConnection(OTMConnection connection)
	{
        if (!(connection instanceof BaseConnection))
        {
            throw new TransactionFactoryException("Unknown connection type");
        }
        BaseConnection baseConnection = (BaseConnection) connection;

		javax.transaction.Transaction jtaTx = getJTATransaction();
        if (jtaTx == null)
        {
            throw new TransactionFactoryException("Unable to get the JTA Transaction");
        }

        Transaction tx = (Transaction) _transactionMap.get(jtaTx);
        if (tx == null)
        {
            tx = new Transaction();
            _transactionMap.put(jtaTx, tx);
        }

        // ensure that this connection is registered into this transaction
        tx.registerConnection(baseConnection);
        return tx;
	}
public Transaction getTransactionForConnection ( OTMConnection connection ) { if ( ! ( connection instanceof BaseConnection ) ) { throw new TransactionFactoryException ( "Unknown connection type" ) ; } BaseConnection baseConnection = ( BaseConnection ) connection ; javax . transaction . Transaction jtaTx = getJTATransaction ( ) ; if ( jtaTx == null ) { throw new TransactionFactoryException ( "Unable to get the JTA Transaction" ) ; } Transaction tx = ( Transaction ) _transactionMap . get ( jtaTx ) ; if ( tx == null ) { tx = new Transaction ( ) ; _transactionMap . put ( jtaTx , tx ) ; } tx . registerConnection ( baseConnection ) ; return tx ; }
@see org.apache.ojb.otm.transaction.TransactionFactory#getTransactionForConnection(OTMConnection)