Business Components

oracle.jbo.server
Class DBTransactionImpl2

java.lang.Object
  |
  +--oracle.jbo.server.DBTransactionImpl
        |
        +--oracle.jbo.server.DBTransactionImpl2
All Implemented Interfaces:
DBTransaction, oracle.jbo.pcoll.PCollManagerHelper, Transaction, oracle.jbo.server.TransactionManager, ValidationManager

public class DBTransactionImpl2
extends DBTransactionImpl

Implementation of DBTransaction interface for representing both "connected" and "not connected" state. In pre 9.0.3 versions the disconnected and connected state implementation was provided by NullDBTransactionImpl and DBTransactionImpl respectivey. DBTransactionImpl instance was created only when clients initiated the acquisition of a jdbc connection by calling the one of Transaction.connect() or Transaction.connectToDataSource() methods.

Beginning from 9.0.3 Creation of root application module results in creation DBTransactionImpl2 instance in disconnected state. Later when clients request acquistion of jdbc connection this instance migrates from disconnected to connected state.

Since:
JDeveloper 9.0.3
See Also:
DatabaseTransactionFactory

Fields inherited from class oracle.jbo.server.DBTransactionImpl
MAX_CURSORS_UNINITIALIZED, mConnectionCredentials, mInternalCredentials, mSQLBuilder, mTxnListeners, POST_ABORT_ON_FIRST_EXCEPTION, POST_ALL_NO_RESET_ON_EXCEPTION, POST_ALL_RESET_ON_EXCEPTION
 
Fields inherited from interface oracle.jbo.server.DBTransaction
DEFAULT
 
Fields inherited from interface oracle.jbo.Transaction
LOCK_NONE, LOCK_OPTIMISTIC, LOCK_PESSIMISTIC
 
Constructor Summary
DBTransactionImpl2()
           
 
Method Summary
 void connect(java.sql.Connection sqlConnection)
          Implementation of connect method.
 void connect(java.lang.String url)
          Implementation of connect method.
 void connect(java.lang.String url, java.util.Properties info)
          Implementation of connect method.
 void connect(java.lang.String url, java.lang.String user, java.lang.String password)
          Implementation of connect method.
 void connectToDataSource(javax.sql.DataSource ds, boolean isJTAbased)
          Implementation of connectToDataSource method.
 void connectToDataSource(javax.sql.DataSource ds, java.lang.String user, java.lang.String passwd, boolean isJTAbased)
          Implementation of connectToDataSource method.
 void connectToDataSource(java.util.Hashtable env, java.lang.String dsName, boolean isJTABased)
          Implementation of connectToDataSource method.
 void connectToDataSource(java.util.Hashtable env, java.lang.String dsName, java.lang.String user, java.lang.String passwd, boolean isJTABased)
          Implementation of connectToDataSource method.
 void connectToDataSource(java.lang.String nsUrl, java.lang.String nsUser, java.lang.String nsPasswd, java.lang.String dsUrl)
          Looks up a datasource from Oracle 8i namespace using the jdbc_access protocol and acquires the default jdbc connection from the looked up datasource using the javax.sql.Datasource.getConnection() method.
 void connectToDataSource(java.lang.String nsUrl, java.lang.String nsUser, java.lang.String nsPasswd, java.lang.String dsUrl, java.lang.String user, java.lang.String passwd)
          Looks up a datasource from Oracle 8i namespace using the jdbc_access protocol and acquires the jdbc connection from the looked up datasource using the javax.sql.Datasource.getConnection(String user, String password) method.
 java.sql.CallableStatement createCallableStatement(java.lang.String str, int noRowsPrefetch)
          Implementation of createCallableStatement method.
 EntityImpl createEntityInstance(EntityDefImpl entityDef, AttributeList al)
          Implementation of createEntityInstance method.
 EntityImpl createEntityInstance(java.lang.String entityDefName, AttributeList al)
          Implementation of createEntityInstance method.
 java.sql.PreparedStatement createPreparedStatement(java.lang.String str, int noRowsPrefetch)
          Implementation of createPreparedStatement method.
 java.lang.Object createRef(java.lang.String structName, byte[] data)
          Checks to see if jdbc connection was acquired.
 java.sql.Statement createStatement(int noRowsPrefetch)
          Implementation of createStatement method.
 ViewObject createViewObjectFromQueryClauses(java.lang.String eoName, java.lang.String selectClause, java.lang.String fromClause, java.lang.String whereClause, java.lang.String orderByClause)
          Implementation of createViewObjectFromQueryClauses method.
 ViewObject createViewObjectFromQueryStmt(java.lang.String sqlStatement)
          Implementation of createViewObjectFromQueryStmt method.
 void disconnect(boolean retainState)
          Implementation of disconnect method.
 EntityImpl findByPrimaryKey(EntityDefImpl entityDef, Key key)
          Implementation of findByPrimaryKey method.
 EntityImpl findByPrimaryKey(java.lang.String entityDefName, Key key)
          Implementation of findByPrimaryKey method.
 void reconnect()
          Implementation of recconnect method.
 void reconnect(boolean force)
          Implementation of reconnect method.
 
Methods inherited from class oracle.jbo.server.DBTransactionImpl
addToValidationListeners, addTransactionListener, addTransactionListenerNoCheck, addTransactionPostListener, addTransactionPostListenerNoCheck, addTransactionStateListener, addViewClearCacheListener, addWarning, applyChangeSet, checkConnected, clearEntityCache, closeTransaction, commit, commitAndSaveChangeSet, createApplicationModule, createApplicationModule, createViewLink, createViewLinkBetweenViewObjects, createViewLinkFromEntityAssocName, createViewObject, disconnect, doCommit, doRollback, dumpEntityCaches, dumpQueryResult, executeCommand, findApplicationModule, getBatchPostExceptionThreshold, getConnectionMetadata, getJdbcConnection, getLockingMode, getPersistManagerConnection, getPostChangesFlag, getPostThreshold, getRootApplicationModule, getSession, getSQLBuilder, getTransactionHandler, getTransactionState, getTxnApplicationModuleImpl, getValidationThreshold, isBundledExceptionMode, isClearCacheOnCommit, isClearCacheOnRollback, isConnected, isConnected, isDirty, isTrackNewAndModifiedRowsOnly, postChanges, postChanges, removeChangeSet, removeTransactionListener, removeTransactionPostListener, removeTransactionStateListener, removeViewClearCacheListener, rollback, setBatchModeForEntity, setBatchPostExceptionThreshold, setBundledExceptionMode, setClearCacheOnCommit, setClearCacheOnRollback, setLockingMode, setPostChangesFlag, setPostThreshold, setTrackNewAndModifiedRowsOnly, setTransactionHandler, setValidationThreshold, showCursorUsage, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DBTransactionImpl2

public DBTransactionImpl2()
Method Detail

connect

public void connect(java.sql.Connection sqlConnection)
Implementation of connect method.
Overrides:
connect in class DBTransactionImpl
Throws:
AlreadyConnectedException - if the jdbc connection has already been acquired.

connect

public void connect(java.lang.String url)
Implementation of connect method.
Overrides:
connect in class DBTransactionImpl
Throws:
AlreadyConnectedException - if the jdbc connection has already been acquired.

connect

public void connect(java.lang.String url,
                    java.util.Properties info)
Implementation of connect method.
Overrides:
connect in class DBTransactionImpl
Throws:
AlreadyConnectedException - if the jdbc connection has already been acquired.

connect

public void connect(java.lang.String url,
                    java.lang.String user,
                    java.lang.String password)
Implementation of connect method.
Overrides:
connect in class DBTransactionImpl
Throws:
AlreadyConnectedException - if the jdbc connection has already been acquired.

connectToDataSource

public void connectToDataSource(java.lang.String nsUrl,
                                java.lang.String nsUser,
                                java.lang.String nsPasswd,
                                java.lang.String dsUrl)
Deprecated. Since Jdeveloper 9.0.2

Description copied from interface: Transaction
Looks up a datasource from Oracle 8i namespace using the jdbc_access protocol and acquires the default jdbc connection from the looked up datasource using the javax.sql.Datasource.getConnection() method.

Overrides:
connectToDataSource in class DBTransactionImpl
Throws:
AlreadyConnectedException - if the jdbc connection has already been acquired.
java.lang.UnSupportedOperationException - if not connected.

connectToDataSource

public void connectToDataSource(java.lang.String nsUrl,
                                java.lang.String nsUser,
                                java.lang.String nsPasswd,
                                java.lang.String dsUrl,
                                java.lang.String user,
                                java.lang.String passwd)
Deprecated. Since Jdeveloper 9.0.2

Description copied from interface: Transaction
Looks up a datasource from Oracle 8i namespace using the jdbc_access protocol and acquires the jdbc connection from the looked up datasource using the javax.sql.Datasource.getConnection(String user, String password) method.

Overrides:
connectToDataSource in class DBTransactionImpl
Throws:
AlreadyConnectedException - if the jdbc connection has already been acquired.
java.lang.UnSupportedOperationException - if not connected.

connectToDataSource

public void connectToDataSource(javax.sql.DataSource ds,
                                boolean isJTAbased)
Implementation of connectToDataSource method.
Overrides:
connectToDataSource in class DBTransactionImpl
Throws:
AlreadyConnectedException - if the jdbc connection has already been acquired.

connectToDataSource

public void connectToDataSource(javax.sql.DataSource ds,
                                java.lang.String user,
                                java.lang.String passwd,
                                boolean isJTAbased)
Implementation of connectToDataSource method.
Overrides:
connectToDataSource in class DBTransactionImpl
Throws:
AlreadyConnectedException - if the jdbc connection has already been acquired.

connectToDataSource

public void connectToDataSource(java.util.Hashtable env,
                                java.lang.String dsName,
                                java.lang.String user,
                                java.lang.String passwd,
                                boolean isJTABased)
Implementation of connectToDataSource method.
Overrides:
connectToDataSource in class DBTransactionImpl
Throws:
AlreadyConnectedException - if the jdbc connection has already been acquired.

connectToDataSource

public void connectToDataSource(java.util.Hashtable env,
                                java.lang.String dsName,
                                boolean isJTABased)
Implementation of connectToDataSource method.
Overrides:
connectToDataSource in class DBTransactionImpl
Throws:
AlreadyConnectedException - if the jdbc connection has already been acquired.

disconnect

public void disconnect(boolean retainState)
Implementation of disconnect method.
Overrides:
disconnect in class DBTransactionImpl
Following copied from interface: oracle.jbo.Transaction
Throws:
NotConnectedException - if the jdbc connection wasn't acquired

reconnect

public void reconnect()
Implementation of recconnect method.
Overrides:
reconnect in class DBTransactionImpl
Following copied from class: oracle.jbo.server.DBTransactionImpl
See Also:
DBTransactionImpl.disconnect(boolean)

reconnect

public void reconnect(boolean force)
Implementation of reconnect method.
Overrides:
reconnect in class DBTransactionImpl
Following copied from class: oracle.jbo.server.DBTransactionImpl
Parameters:
force - force a reconnect, should usually be false.

createStatement

public java.sql.Statement createStatement(int noRowsPrefetch)
Implementation of createStatement method.
Overrides:
createStatement in class DBTransactionImpl
Throws:
NotConnectedException - if no jdbc connection was acquired

createCallableStatement

public java.sql.CallableStatement createCallableStatement(java.lang.String str,
                                                          int noRowsPrefetch)
Implementation of createCallableStatement method.
Overrides:
createCallableStatement in class DBTransactionImpl
Throws:
NotConnectedException - if no jdbc connection was acquired

createPreparedStatement

public java.sql.PreparedStatement createPreparedStatement(java.lang.String str,
                                                          int noRowsPrefetch)
Implementation of createPreparedStatement method.
Overrides:
createPreparedStatement in class DBTransactionImpl
Throws:
NotConnectedException - if no jdbc connection was acquired

createEntityInstance

public EntityImpl createEntityInstance(EntityDefImpl entityDef,
                                       AttributeList al)
Implementation of createEntityInstance method.
Overrides:
createEntityInstance in class DBTransactionImpl
Throws:
NotConnectedException - if no jdbc connection was acquired

createEntityInstance

public EntityImpl createEntityInstance(java.lang.String entityDefName,
                                       AttributeList al)
Implementation of createEntityInstance method.
Overrides:
createEntityInstance in class DBTransactionImpl
Throws:
NotConnectedException - if no jdbc connection was acquired

findByPrimaryKey

public EntityImpl findByPrimaryKey(EntityDefImpl entityDef,
                                   Key key)
Implementation of findByPrimaryKey method.
Overrides:
findByPrimaryKey in class DBTransactionImpl
Throws:
NotConnectedException - if no jdbc connection was acquired

findByPrimaryKey

public EntityImpl findByPrimaryKey(java.lang.String entityDefName,
                                   Key key)
Implementation of findByPrimaryKey method.
Overrides:
findByPrimaryKey in class DBTransactionImpl
Throws:
NotConnectedException - if no jdbc connection was acquired

createViewObjectFromQueryClauses

public ViewObject createViewObjectFromQueryClauses(java.lang.String eoName,
                                                   java.lang.String selectClause,
                                                   java.lang.String fromClause,
                                                   java.lang.String whereClause,
                                                   java.lang.String orderByClause)
Implementation of createViewObjectFromQueryClauses method.
Overrides:
createViewObjectFromQueryClauses in class DBTransactionImpl
Throws:
NotConnectedException - if no jdbc connection was acquired

createViewObjectFromQueryStmt

public ViewObject createViewObjectFromQueryStmt(java.lang.String sqlStatement)
Implementation of createViewObjectFromQueryStmt method.
Overrides:
createViewObjectFromQueryStmt in class DBTransactionImpl
Throws:
NotConnectedException - if no jdbc connection was acquired

createRef

public java.lang.Object createRef(java.lang.String structName,
                                  byte[] data)
Checks to see if jdbc connection was acquired. Otherwise delegates to the the super class implementation
Overrides:
createRef in class DBTransactionImpl
Throws:
NotConnectedException - if no jdbc connection was acquired

Business Components