Oracle Fusion Middleware Java API Reference for Oracle ADF Mobile Client
11g Release 1 (11.1.1)

E17503-02

oracle.jbo.server
Interface DBTransaction

All Superinterfaces:
Transaction, ValidationManager
All Known Implementing Classes:
DBTransactionImpl, DBTransactionImpl2

public interface DBTransaction
extends Transaction, ValidationManager


Field Summary
static int DEFAULT
          interface constant to inicate that row prefetch should be left as driver default
 
Fields inherited from interface oracle.jbo.Transaction
DML_OPERATION_TIMEOUT_WAIT_FOREVER, LOCK_NONE, LOCK_OPTIMISTIC, LOCK_OPTUPDATE, LOCK_PESSIMISTIC
 
Method Summary
 void addTransactionListener(TransactionListener listener)
          Adds a listener to the transaction's list of event subscribers.
 void addTransactionListenerNoCheck(TransactionListener listener)
          Adds a listener to the transaction's event subscribers list, without checking whether the listener is already on the list.
 void addTransactionPostListener(TransactionPostListener listener)
          Adds a listener to the transaction's list of post-phase event subscribers.
 void addTransactionPostListenerNoCheck(TransactionPostListener listener)
           
 void commit()
          Commits all changes in this transaction to the database
 void connect(ConnectionDetails metaData)
          Attempts to establish a connection to a database identified by a URL.
 PreparedStatement createPreparedStatement(java.lang.String sql)
          Create a PreparedStatement object to efficiently execute multiple queries
 PreparedStatement createPreparedStatement(java.lang.String str, int noRowsPrefetch)
          Creates a JDBC PreparedStatement instance.
 Statement createStatement()
          Create a Statement object to execute SQL queries
 Statement createStatement(int noRowsPrefetch)
          Creates a JDBC Statement instance.
 ViewObject createViewObjectFromQueryClauses(java.lang.String eoName, java.lang.String selectClause, java.lang.String fromClause, java.lang.String whereClause, java.lang.String orderByClause)
          Creates an updatable View Object.
 void disconnect()
          Closes the JDBC connection object and removes this transaction from the root application module.
 ApplicationModule getRootApplicationModule()
           
 SQLBuilder getSQLBuilder()
           
 TransactionHandler getTransactionHandler()
          Internal: Applications should not use this method.
 int getValidationThreshold()
          Gets the threshold value for the commit-cycle's validation phase.
 boolean isConnected()
          Checks if the transaction is connected to the database
 boolean isTrackNewAndModifiedRowsOnly()
          Advanced: Most applications should not use this method
 void reconnect()
          Re-establish the transaction JDBC connection using previously supplied database credentials.
 void removeTransactionListener(TransactionListener listener)
          Removes the listener from the transactions list of event subscribers.
 void removeTransactionPostListener(TransactionPostListener listener)
          Removes a listener from the transaction's list of post-phase event subscribers.
 void setValidationThreshold(int count)
          Sets the threshold value for the commit-cycle's validation phase.
 
Methods inherited from interface oracle.jbo.Transaction
addTransactionStateListener, addViewClearCacheListener, applyChangeSet, cancelDMLOperations, clearEntityCache, commitAndSaveChangeSet, connect, connect, connect, connectToDataSource, connectToDataSource, connectToDataSource, connectToDataSource, createRef, disconnect, dumpQueryResult, executeCommand, getConnectionMetadata, getDMLOperationTimeOut, getLockingMode, isBundledExceptionMode, isClearCacheOnCommit, isClearCacheOnRollback, isDirty, postChanges, reconnect, removeChangeSet, removeTransactionStateListener, removeViewClearCacheListener, rollback, setBundledExceptionMode, setClearCacheOnCommit, setClearCacheOnRollback, setDMLOperationTimeOut, setLockingMode, validate
 
Methods inherited from interface oracle.jbo.server.ValidationManager
addToValidationListeners, validate
 

Field Detail

DEFAULT

static final int DEFAULT
interface constant to inicate that row prefetch should be left as driver default

See Also:
Constant Field Values
Method Detail

connect

void connect(ConnectionDetails metaData)
Attempts to establish a connection to a database identified by a URL. Call isConnected to see if the connection was successful.

Parameters:
metaData - Defines connection parameters such as username, database name

disconnect

void disconnect()
Description copied from interface: Transaction
Closes the JDBC connection object and removes this transaction from the root application module.

Specified by:
disconnect in interface Transaction

createViewObjectFromQueryClauses

ViewObject createViewObjectFromQueryClauses(java.lang.String eoName,
                                            java.lang.String selectClause,
                                            java.lang.String fromClause,
                                            java.lang.String whereClause,
                                            java.lang.String orderByClause)
Creates an updatable View Object.

The View Object is constructed from an Entity Object and parts of a SQL statement.

The caller should invoke remove() to dispose of the instance.

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.

isConnected

boolean isConnected()
Checks if the transaction is connected to the database

Specified by:
isConnected in interface Transaction
Returns:
true if connected; false if disconnected.

reconnect

void reconnect()
Re-establish the transaction JDBC connection using previously supplied database credentials.

Specified by:
reconnect in interface Transaction

setValidationThreshold

void setValidationThreshold(int count)
Sets the threshold value for the commit-cycle's validation phase.

When commit() is invoked the framework attempts to validate the transaction's modifications, making count attempts before failing with an exception. This mechanism allows applications to update data in the cache within the validation phase, and validate them before they are posted.

Parameters:
count - the new threshold value.

getValidationThreshold

int getValidationThreshold()
Gets the threshold value for the commit-cycle's validation phase.


addTransactionListener

void addTransactionListener(TransactionListener listener)
Adds a listener to the transaction's list of event subscribers.

Listeners are notified of commit and rollback events spawned by the commit() or rollback() methods. The framework adds modified top-level Entity Objects to this list.

Parameters:
listener - the subscriber to be added.

addTransactionListenerNoCheck

void addTransactionListenerNoCheck(TransactionListener listener)
Adds a listener to the transaction's event subscribers list, without checking whether the listener is already on the list.

Listeners are notified of commit and rollback events spawned by the commit() or rollback() methods. The framework adds modified top-level Entity Objects to this list.

Parameters:
listener - the subscriber to be added.

removeTransactionListener

void removeTransactionListener(TransactionListener listener)
Removes the listener from the transactions list of event subscribers.

Parameters:
listener - the subscriber to be removed.

createStatement

Statement createStatement()
Create a Statement object to execute SQL queries

Returns:
Statement object

createPreparedStatement

PreparedStatement createPreparedStatement(java.lang.String sql)
Create a PreparedStatement object to efficiently execute multiple queries

Parameters:
sql - Parameterized SQL query
Returns:
PreparedStatement object

commit

void commit()
Commits all changes in this transaction to the database

Specified by:
commit in interface Transaction
See Also:
TransactionListener.beforeCommit(TransactionEvent), TransactionListener.afterCommit(TransactionEvent), DBTransaction, Transaction.postChanges()

getSQLBuilder

SQLBuilder getSQLBuilder()

addTransactionPostListener

void addTransactionPostListener(TransactionPostListener listener)
Adds a listener to the transaction's list of post-phase event subscribers.

Listeners are notified of events spawned by the postChanges() method. The framework adds modified top-level Entity Objects to this list.

Parameters:
listener - the subscriber to be added.

removeTransactionPostListener

void removeTransactionPostListener(TransactionPostListener listener)
Removes a listener from the transaction's list of post-phase event subscribers.


isTrackNewAndModifiedRowsOnly

boolean isTrackNewAndModifiedRowsOnly()
Advanced: Most applications should not use this method

Returns true if this transaction allows entities to be in STATUS_INITIALIZED state.


getRootApplicationModule

ApplicationModule getRootApplicationModule()

createStatement

Statement createStatement(int noRowsPrefetch)
Creates a JDBC Statement instance.

Applications may use this method to create a JDBC statement object to execute application specific SQL statements directly, so that the modifications are committed to the database in a single transaction through this object.

Parameters:
noRowsPrefetch - the number of rows to prefetch when executing this statement's query.
Returns:
a JDBC Statement instance.

getTransactionHandler

TransactionHandler getTransactionHandler()
Internal: Applications should not use this method.


createPreparedStatement

PreparedStatement createPreparedStatement(java.lang.String str,
                                          int noRowsPrefetch)
Creates a JDBC PreparedStatement instance.

Applications may use this method to create a JDBC callable statement object to execute application specific SQL statements directly, so that the modifications are committed to the database in a single transaction through this object.

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.

addTransactionPostListenerNoCheck

void addTransactionPostListenerNoCheck(TransactionPostListener listener)

Oracle Fusion Middleware Java API Reference for Oracle ADF Mobile Client
11g Release 1 (11.1.1)

E17503-02

Copyright © 2011, Oracle and/or its affiliates. All rights reserved.