|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.ojb.broker.accesslayer.ConnectionManagerImpl
Manages Connection ressources.
ConnectionManagerIF| Constructor Summary | |
ConnectionManagerImpl(PersistenceBroker broker)
|
|
| Method Summary | |
void |
clearBatch()
Clear batch (if the batch mode where used). |
void |
executeBatch()
Execute batch (if the batch mode where used). |
void |
executeBatchIfNecessary()
Execute batch if the number of statements in it exceeded the limit (if the batch mode where used). |
java.sql.Connection |
getConnection()
Returns the underlying connection, requested at the ConnectionFactory. |
JdbcConnectionDescriptor |
getConnectionDescriptor()
Returns the associated JdbcConnectionDescriptor |
Platform |
getSupportedPlatform()
Returns the supported Platform
determined by the JdbcConnectionDescriptor. |
ConnectionFactory |
getUnderlyingConnectionFactory()
Returns the underlying used ConnectionFactory
implementation. |
boolean |
isAlive(java.sql.Connection conn)
Check if underlying connection was alive. |
boolean |
isBatchMode()
|
boolean |
isInLocalTransaction()
Hold connection is in local transaction. |
void |
localBegin()
Start transaction on the underlying connection. |
void |
localCommit()
Call commit on the underlying connection. |
void |
localRollback()
Call rollback on the underlying connection. |
void |
releaseConnection()
Release connection to the ConnectionFactory, make
sure that you call the method in either case, it's the only way to free the connection. |
protected void |
restoreAutoCommitState()
Reset autoCommit state. |
void |
setBatchMode(boolean mode)
Sets the batch mode on or off - this switch only works if you set attribute batch-mode
in jdbc-connection-descriptor true and your database
support batch mode. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ConnectionManagerImpl(PersistenceBroker broker)
| Method Detail |
public JdbcConnectionDescriptor getConnectionDescriptor()
JdbcConnectionDescriptor
getConnectionDescriptor in interface ConnectionManagerIFpublic Platform getSupportedPlatform()
ConnectionManagerIFPlatform
determined by the JdbcConnectionDescriptor.
getSupportedPlatform in interface ConnectionManagerIFConnectionManagerIF.getConnectionDescriptor()
public java.sql.Connection getConnection()
throws LookupException
ConnectionFactory.
PB.beginTransaction() opens a single jdbc connection via
serviceConnectionManager().localBegin().
If you call ask serviceConnectionManager().getConnection() later
it returns the already opened connection.
the PB instance will close the connection during
commitTransaction() or abortTransaction().
getConnection in interface ConnectionManagerIFLookupExceptionpublic void localBegin()
localBegin in interface ConnectionManagerIFpublic void localCommit()
localCommit in interface ConnectionManagerIFpublic void localRollback()
localRollback in interface ConnectionManagerIFprotected void restoreAutoCommitState()
public boolean isAlive(java.sql.Connection conn)
isAlive in interface ConnectionManagerIFpublic boolean isInLocalTransaction()
ConnectionManagerIF
isInLocalTransaction in interface ConnectionManagerIFpublic void releaseConnection()
ConnectionFactory, make
sure that you call the method in either case, it's the only way to free the connection.
releaseConnection in interface ConnectionManagerIFpublic ConnectionFactory getUnderlyingConnectionFactory()
ConnectionFactory
implementation.
public void setBatchMode(boolean mode)
batch-mode
in jdbc-connection-descriptor true and your database
support batch mode.
setBatchMode in interface ConnectionManagerIFmode - the batch modepublic boolean isBatchMode()
isBatchMode in interface ConnectionManagerIF
public void executeBatch()
throws OJBBatchUpdateException
executeBatch in interface ConnectionManagerIFOJBBatchUpdateException
public void executeBatchIfNecessary()
throws OJBBatchUpdateException
executeBatchIfNecessary in interface ConnectionManagerIFOJBBatchUpdateExceptionpublic void clearBatch()
clearBatch in interface ConnectionManagerIF
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||