org.cementj.base.trans
Class JNDITransactionContext

java.lang.Object
  extended by org.cementj.support.trans.AbstractTransactionContext
      extended by org.cementj.base.trans.JNDITransactionContext
All Implemented Interfaces:
TransactionContext

public class JNDITransactionContext
extends org.cementj.support.trans.AbstractTransactionContext
implements TransactionContext

JNDI-based TransactionContext for use in J2EE containers without needing EJB.

The default environment context name is "java:/comp/env".

Author:
Derek C. Ashmore

Constructor Summary
JNDITransactionContext()
           
JNDITransactionContext(java.lang.String envContextName)
           
 
Method Summary
 java.lang.String getEnvironmentContextName()
           
 java.sql.Connection getNewConnection(java.lang.String label)
          Provides a JDBC connection given an identifying label.
 void setEnvironmentContextName(java.lang.String string)
           
 
Methods inherited from class org.cementj.support.trans.AbstractTransactionContext
begin, closeAll, commitAll, getConnection, getRegisteredConnection, registerAllocatedConnection, rollbackAll
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.cementj.base.trans.TransactionContext
begin, closeAll, commitAll, getConnection, rollbackAll
 

Constructor Detail

JNDITransactionContext

public JNDITransactionContext()

JNDITransactionContext

public JNDITransactionContext(java.lang.String envContextName)
Method Detail

getNewConnection

public java.sql.Connection getNewConnection(java.lang.String label)
                                     throws TransactionException
Description copied from interface: TransactionContext
Provides a JDBC connection given an identifying label. For applications running under a J2EE container, this label is typically your database connection pool name.

A new connection will be created and returned regardless of other connections previously created by this context.

It is imperitive that you don't issue commits, rollbacks, or close connections received from a TransactionContext. Those tasks should be done via the TransactionContext.

Specified by:
getNewConnection in interface TransactionContext
Specified by:
getNewConnection in class org.cementj.support.trans.AbstractTransactionContext
Returns:
Throws:
TransactionException

getEnvironmentContextName

public java.lang.String getEnvironmentContextName()
Returns:

setEnvironmentContextName

public void setEnvironmentContextName(java.lang.String string)
Parameters:
string -


Copyright © 2003 Delta Vortex Technologies, Inc. All Rights Reserved.