Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle ADF Model
11g Release 2 (11.1.2.2.0)

E17483-03


oracle.jbo.server
Class DBTransactionImpl2

java.lang.Object
  extended by oracle.jbo.server.DBTransactionImpl
      extended by oracle.jbo.server.DBTransactionImpl2

All Implemented Interfaces:
ExprWrappable, PCollManagerHelper, JboTransAttrValidationManager, JboTransValidationManager, DBTransaction, ValidationManager, Transaction

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

Field Summary

 

Fields inherited from class oracle.jbo.server.DBTransactionImpl
MAX_CURSORS_UNINITIALIZED, mConnectionCredentials, mDMLOperationTimeOut, mInternalCredentials, mLongRunningDMLOperationHandles, 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
DML_OPERATION_TIMEOUT_WAIT_FOREVER, LOCK_NONE, LOCK_OPTIMISTIC, LOCK_OPTUPDATE, 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)
          Deprecated. Since Jdeveloper 9.0.2
 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
 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.
 ViewObject createViewObjectFromQueryStmt(java.lang.String sqlStatement, java.lang.String voImplClassName)
          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.
 ViewObject findViewObject(java.lang.String voName)
          Implementation of findViewObject method.
 java.sql.Timestamp getCurrentDbTime()
          Checks to see if jdbc connection was acquired.
 void reconnectToDataSource()
           

 

Methods inherited from class oracle.jbo.server.DBTransactionImpl
addLongRunningDMLOperationHandle, addToValidationListeners, addTransactionListener, addTransactionListenerNoCheck, addTransactionPostListener, addTransactionPostListenerNoCheck, addTransactionStateListener, addViewClearCacheListener, addWarning, applyChangeSet, cancelDMLOperations, checkConnected, clearEntityCache, closeTransaction, commit, commitAndSaveChangeSet, createApplicationModule, createApplicationModule, createViewLink, createViewLinkBetweenViewObjects, createViewLinkFromEntityAssocName, createViewObject, diagCleanURL, disconnect, doAfterCommit, doBeforeCommit, doCommit, doRollback, doValidatePostChanges, dumpEntityCaches, dumpQueryResult, executeCommand, findApplicationModule, findEntityCache, getActiveApplicationModuleImpls, getBatchPostExceptionThreshold, getConnectionMetadata, getDMLOperationTimeOut, getEntityCache, getJdbcConnection, getLockingMode, getPersistManagerConnection, getPostChangesFlag, getPostThreshold, getRootApplicationModule, getSession, getSQLBuilder, getSyncLock, getTransactionHandler, getTransactionListenersList, getTransactionPostListenersList, getTransactionState, getTransAttrValidationList, getTransAttrValidationManager, getTransAttrValidations, getTransValidationList, getTransValidationManager, getTransValidations, getTxnApplicationModuleImpl, getValidationListenersList, getValidationThreshold, hasRollbackSavePoint, isBundledExceptionMode, isClearCacheOnCommit, isClearCacheOnRollback, isConnected, isConnected, isDirty, isForceDeferValidation, isLockOptimistic, isTrackNewAndModifiedRowsOnly, lookupEntityCache, postChanges, postChanges, putTransAttrValEntry, putTransValEntry, reconnect, reconnect, removeChangeSet, removeEntityCache, removeEntityCacheByName, removeLongRunningDMLOperationHandle, removeTransactionListener, removeTransactionPostListener, removeTransactionStateListener, removeViewClearCacheListener, rollback, setBatchModeForEntity, setBatchPostExceptionThreshold, setBundledExceptionMode, setClearCacheOnCommit, setClearCacheOnRollback, setDMLOperationTimeOut, setForceDeferValidation, 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

reconnectToDataSource

public void reconnectToDataSource()

connect

public void connect(java.sql.Connection sqlConnection)
Implementation of connect method.
Specified by:
connect in interface DBTransaction
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.
Specified by:
connect in interface Transaction
Overrides:
connect in class DBTransactionImpl
Parameters:
url - a database url of the form jdbc:subprotocol:subname.
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.
Specified by:
connect in interface Transaction
Overrides:
connect in class DBTransactionImpl
Parameters:
url - a database url of the form jdbc:subprotocol:subname.
info - a list of arbitrary string tag/value pairs to be used as connection arguments. Normally, at least "user" and "password" properties should be included.
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.
Specified by:
connect in interface Transaction
Overrides:
connect in class DBTransactionImpl
Parameters:
url - a database url of the form jdbc:subprotocol:subname.
user - the database user on whose behalf the connection is being made.
password - the user's password.
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.
Specified by:
connectToDataSource in interface Transaction
Overrides:
connectToDataSource in class DBTransactionImpl
Parameters:
nsUrl - Url to the jndi namespace where the datasource is bound
nsUser - User name that is used to access the namespace.
nsPasswd - nsUsers' passwd
dsUrl - Datasource name as bound in the namespace. Name can be the fully qaultified url such as jdbc_access://test/ds/db1 otherwise the the url prefix jdbc_acess:// is prepended to the datasource name for lookup.
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.
Specified by:
connectToDataSource in interface Transaction
Overrides:
connectToDataSource in class DBTransactionImpl
Parameters:
nsUrl - Url to the jndi namespace where the datasource is bound
nsUser - User name that is used to access the namespace.
nsPasswd - nsUsers' passwd
dsUrl - Datasource name as bound in the namespace. Name can be the fully qaultified url such as jdbc_access://test/ds/db1 otherwise the the url prefix jdbc_acess:// is prepended to the datasource name for lookup.
user - Username for which the connection is acquired from the datasource
passwd - User's password.
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.
Specified by:
connectToDataSource in interface DBTransaction
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.
Specified by:
connectToDataSource in interface DBTransaction
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.
Specified by:
connectToDataSource in interface Transaction
Overrides:
connectToDataSource in class DBTransactionImpl
Parameters:
env - Envirionment used the create initial context. May be null.
dsName - Datasource name as bound in the namespace.
user - Username for which the connection is acquired from the datasource
passwd - User's password.
isJTABased - True if datasource is XADataSource implementation. If true, the tranasction is assumed to be controlled by an external transaction manager.
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.
Specified by:
connectToDataSource in interface Transaction
Overrides:
connectToDataSource in class DBTransactionImpl
Parameters:
env - Envirionment used the create initial context. May be null.
dsName - Datasource name as bound in the namespace.
isJTABased - True if datasource is XADataSource implementation. If true, the tranasction is assumed to be controlled by an external transaction manager.
Throws:
AlreadyConnectedException - if the jdbc connection has already been acquired.

disconnect

public void disconnect(boolean retainState)
Implementation of disconnect method.
Specified by:
disconnect in interface DBTransaction
Specified by:
disconnect in interface Transaction
Overrides:
disconnect in class DBTransactionImpl

createStatement

public java.sql.Statement createStatement(int noRowsPrefetch)
Implementation of createStatement method.
Specified by:
createStatement in interface DBTransaction
Overrides:
createStatement in class DBTransactionImpl
Parameters:
noRowsPrefetch - the number of rows to prefetch when executing this statement's query.
Returns:
a JDBC Statement instance.
Throws:
NotConnectedException - if no jdbc connection was acquired

createCallableStatement

public java.sql.CallableStatement createCallableStatement(java.lang.String str,
                                                          int noRowsPrefetch)
Implementation of createCallableStatement method.
Specified by:
createCallableStatement in interface DBTransaction
Overrides:
createCallableStatement in class DBTransactionImpl
Parameters:
str - the CallableStatement instance's SQL statement.
noRowsPrefetch - the number of rows to prefetch when executing this statement's query. If this parameter is set to DBTransaction.DEFAULT, then the default value from the jdbc driver is used.
Returns:
a JDBC CallableStatement instance.
Throws:
NotConnectedException - if no jdbc connection was acquired

createPreparedStatement

public java.sql.PreparedStatement createPreparedStatement(java.lang.String str,
                                                          int noRowsPrefetch)
Implementation of createPreparedStatement method.
Specified by:
createPreparedStatement in interface DBTransaction
Overrides:
createPreparedStatement in class DBTransactionImpl
Parameters:
str - the PreparedStatement instance's SQL statement.
noRowsPrefetch - the number of rows to prefetch when executing this statement's query. If this parameter is set to DBTransaction.DEFAULT, then the default value from the jdbc driver is used.
Returns:
a JDBC PreparedStatement instance.
Throws:
NotConnectedException - if no jdbc connection was acquired

createEntityInstance

public EntityImpl createEntityInstance(EntityDefImpl entityDef,
                                       AttributeList al)
Implementation of createEntityInstance method.
Specified by:
createEntityInstance in interface DBTransaction
Overrides:
createEntityInstance in class DBTransactionImpl
Parameters:
entityDef - the EntityDef defintion to use to create the EntityImpl.
al - attribute list to pass to the create() method on the EntityImpl.
Returns:
the new EntityImpl instance.
Throws:
NotConnectedException - if no jdbc connection was acquired

createEntityInstance

public EntityImpl createEntityInstance(java.lang.String entityDefName,
                                       AttributeList al)
Implementation of createEntityInstance method.
Specified by:
createEntityInstance in interface DBTransaction
Overrides:
createEntityInstance in class DBTransactionImpl
Parameters:
entityDefName - the String name of entity defintion to use to create the EntityImpl.
al - attribute list to pass to the create method on the EntityImpl.
Returns:
the new EntityImpl instance.
Throws:
NotConnectedException - if no jdbc connection was acquired

findByPrimaryKey

public EntityImpl findByPrimaryKey(EntityDefImpl entityDef,
                                   Key key)
Implementation of findByPrimaryKey method.
Specified by:
findByPrimaryKey in interface DBTransaction
Overrides:
findByPrimaryKey in class DBTransactionImpl
Parameters:
entityDef - the Entity Def object to to be used to find the instance.
key - the Primary Key.
Returns:
the Entity Object matching Key, or null if not found.
Throws:
NotConnectedException - if no jdbc connection was acquired

findByPrimaryKey

public EntityImpl findByPrimaryKey(java.lang.String entityDefName,
                                   Key key)
Implementation of findByPrimaryKey method.
Specified by:
findByPrimaryKey in interface DBTransaction
Overrides:
findByPrimaryKey in class DBTransactionImpl
Parameters:
entityDefName - the name of the defintion to to be used to find the instance.
key - the Primary Key.
Returns:
the Entity Object matching Key, or null if not found.
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.
Specified by:
createViewObjectFromQueryClauses in interface DBTransaction
Overrides:
createViewObjectFromQueryClauses in class DBTransactionImpl
Parameters:
eoName - the name of a EntityObject beaninfo class.
selectClause - an SQL statement SELECT clause.
fromClause - an SQL statement FROM clause.
whereClause - an SQL statement WHERE clause.
orderByClause - an SQL statement ORDERBY clause.
Throws:
NotConnectedException - if no jdbc connection was acquired

createViewObjectFromQueryStmt

public ViewObject createViewObjectFromQueryStmt(java.lang.String sqlStatement)
Implementation of createViewObjectFromQueryStmt method.
Specified by:
createViewObjectFromQueryStmt in interface DBTransaction
Overrides:
createViewObjectFromQueryStmt in class DBTransactionImpl
Parameters:
sqlStatement - a SQL statement.
Throws:
NotConnectedException - if no jdbc connection was acquired

createViewObjectFromQueryStmt

public ViewObject createViewObjectFromQueryStmt(java.lang.String sqlStatement,
                                                java.lang.String voImplClassName)
Implementation of createViewObjectFromQueryStmt method.
Specified by:
createViewObjectFromQueryStmt in interface DBTransaction
Overrides:
createViewObjectFromQueryStmt in class DBTransactionImpl
Parameters:
sqlStatement - a SQL statement.
voImplClassName - the name of a subclass of oracle.jbo.server.ViewObjectImpl
Returns:
the ViewObject instance of the Class name passed as the argument
Throws:
NotConnectedException - if no jdbc connection was acquired

findViewObject

public ViewObject findViewObject(java.lang.String voName)
Implementation of findViewObject method.
Specified by:
findViewObject in interface DBTransaction
Overrides:
findViewObject in class DBTransactionImpl
Parameters:
voName - the name of the view object.
Returns:
the view object. null if the view object is not found.
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
Specified by:
createRef in interface Transaction
Overrides:
createRef in class DBTransactionImpl
Throws:
NotConnectedException - if no jdbc connection was acquired

getCurrentDbTime

public java.sql.Timestamp getCurrentDbTime()
Checks to see if jdbc connection was acquired. Otherwise delegates to the the super class implementation
Overrides:
getCurrentDbTime in class DBTransactionImpl
Throws:
NotConnectedException - if no jdbc connection was acquired

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle ADF Model
11g Release 2 (11.1.2.2.0)

E17483-03


Copyright © 1997, 2012, Oracle. All rights reserved.