public abstract class DatasourceAccessor extends java.lang.Object implements Accessor
DatasourceAccessor is an abstract implementation
of the Accessor interface providing common functionality to the concrete database and EIS accessors.
It is responsible for
connecting,
transactions,
call executionCall,
Login| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
READ_STATEMENTS_COUNT_PROPERTY |
int |
readStatementsCount
Keep track of the number of the read statement that being executed.
|
static boolean |
shouldCheckConnection
Back-door to allow isConnect checks.
|
static java.lang.String |
STOREDPROCEDURE_STATEMENTS_COUNT_PROPERTY |
int |
storedProcedureStatementsCount
Keep track of the number of the storedprocedure statement that being executed.
|
static java.lang.String |
WRITE_STATEMENTS_COUNT_PROPERTY |
int |
writeStatementsCount
Keep track of the number of the write statement that being executed.
|
| Constructor and Description |
|---|
DatasourceAccessor()
Default Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
beginTransaction(AbstractSession session)
Begin a transaction on the database.
|
java.lang.Object |
clone()
Clone the accessor.
|
void |
closeConnection()
Close the accessor's connection.
|
void |
closeJTSConnection()
Called from beforeCompletion external transaction synchronization listener callback
to close the external connection corresponding to the completing external transaction.
|
void |
commitTransaction(AbstractSession session)
Commit a transaction on the database.
|
void |
connect(Login login,
AbstractSession session)
Connect to the datasource.
|
void |
createCustomizer(AbstractSession session)
Attempts to create ConnectionCustomizer.
|
void |
decrementCallCount()
Used for load balancing and external pooling.
|
void |
disconnect(AbstractSession session)
Disconnect from the datasource.
|
java.lang.Object |
executeCall(Call call,
AbstractRecord translationRow,
AbstractSession session)
Execute the call.
|
void |
flushSelectCalls(AbstractSession session)
Added as a result of Bug 2804663 - satisfy the Accessor interface
implementation.
|
int |
getCallCount()
Used for load balancing and external pooling.
|
java.util.Vector |
getColumnInfo(java.lang.String catalog,
java.lang.String schema,
java.lang.String tableName,
java.lang.String columnName,
AbstractSession session)
Return column information for the specified
database objects.
|
java.sql.Connection |
getConnection()
Helper method to return the JDBC connection for DatabaseAccessor.
|
java.lang.Object |
getDatasourceConnection()
Return the driver level connection.
|
DatasourcePlatform |
getDatasourcePlatform()
Return the platform.
|
Login |
getLogin()
Return the login
|
ConnectionPool |
getPool()
Return the associated connection pool this connection was obtained from.
|
int |
getReadStatementsCount()
Return the number of read statements.
|
SequencingCallback |
getSequencingCallback(SequencingCallbackFactory sequencingCallbackFactory)
Return sequencing callback.
|
int |
getStoredProcedureStatementsCount()
Return the number of stored procedure call.
|
java.util.Vector |
getTableInfo(java.lang.String catalog,
java.lang.String schema,
java.lang.String tableName,
java.lang.String[] types,
AbstractSession session)
Return table information for the specified
database objects.
|
int |
getWriteStatementsCount()
Return the number of write statements.
|
void |
incrementCallCount(AbstractSession session)
Used for load balancing and external pooling.
|
boolean |
isConnected()
Return true if the accessor is currently connected to a data source.
|
boolean |
isInTransaction()
Return the transaction status of the receiver.
|
boolean |
isPossibleFailure() |
boolean |
isValid()
Returns true if this Accessor can continue to be used.
|
void |
reestablishConnection(AbstractSession session)
PUBLIC:
Reconnect to the database.
|
void |
releaseCustomizer()
Clear customizer if it's active and set it to null.
|
void |
releaseCustomizer(AbstractSession session)
Clear and remove customizer if its session is the same as the passed one;
in case prevCustomizer exists set it as a new customizer.
|
void |
reset()
Reset statement count.
|
void |
rollbackTransaction(AbstractSession session)
Rollback the transaction on the datasource.
|
void |
setDatasourcePlatform(DatasourcePlatform platform)
Set the platform.
|
void |
setIsValid(boolean isValid)
This should be set to false if a communication failure occurred during a call execution.
|
void |
setPool(ConnectionPool pool)
Set the associated connection pool this connection was obtained from.
|
void |
setPossibleFailure(boolean possibleFailure) |
boolean |
usesExternalConnectionPooling()
Return true if some external connection pool is in use.
|
boolean |
usesExternalTransactionController()
Return true if some external transaction service is controlling transactions.
|
void |
writesCompleted(AbstractSession session)
This method will be called after a series of writes have been issued to
mark where a particular set of writes has completed.
|
public int storedProcedureStatementsCount
public int readStatementsCount
public int writeStatementsCount
public static final java.lang.String READ_STATEMENTS_COUNT_PROPERTY
public static final java.lang.String WRITE_STATEMENTS_COUNT_PROPERTY
public static final java.lang.String STOREDPROCEDURE_STATEMENTS_COUNT_PROPERTY
public static boolean shouldCheckConnection
public java.lang.Object clone()
public void closeJTSConnection()
closeJTSConnection in interface Accessorpublic void setIsValid(boolean isValid)
setIsValid in interface Accessorpublic boolean isInTransaction()
isInTransaction in interface Accessorpublic boolean isValid()
public boolean isPossibleFailure()
public void setPossibleFailure(boolean possibleFailure)
public boolean usesExternalConnectionPooling()
usesExternalConnectionPooling in interface Accessorpublic void beginTransaction(AbstractSession session) throws DatabaseException
beginTransaction in interface AccessorDatabaseExceptionpublic void decrementCallCount()
decrementCallCount in interface Accessorpublic void incrementCallCount(AbstractSession session)
incrementCallCount in interface Accessorpublic int getCallCount()
getCallCount in interface Accessorpublic void commitTransaction(AbstractSession session) throws DatabaseException
commitTransaction in interface AccessorDatabaseExceptionpublic void connect(Login login, AbstractSession session) throws DatabaseException
connect in interface AccessorDatabaseExceptionpublic Login getLogin()
public void disconnect(AbstractSession session) throws DatabaseException
disconnect in interface AccessorDatabaseExceptionpublic void closeConnection()
closeConnection in interface Accessorpublic java.lang.Object executeCall(Call call, AbstractRecord translationRow, AbstractSession session) throws DatabaseException
executeCall in interface AccessorDatabaseExceptionpublic void reestablishConnection(AbstractSession session) throws DatabaseException
reestablishConnection in interface AccessorDatabaseExceptionpublic DatasourcePlatform getDatasourcePlatform()
public void setDatasourcePlatform(DatasourcePlatform platform)
public java.lang.Object getDatasourceConnection()
getDatasourceConnection in interface Accessorpublic java.sql.Connection getConnection()
getConnection in interface Accessorpublic java.util.Vector getColumnInfo(java.lang.String catalog,
java.lang.String schema,
java.lang.String tableName,
java.lang.String columnName,
AbstractSession session)
throws DatabaseException
getColumnInfo in interface AccessorDatabaseExceptionpublic int getReadStatementsCount()
public int getWriteStatementsCount()
public int getStoredProcedureStatementsCount()
public java.util.Vector getTableInfo(java.lang.String catalog,
java.lang.String schema,
java.lang.String tableName,
java.lang.String[] types,
AbstractSession session)
throws DatabaseException
getTableInfo in interface AccessorDatabaseExceptionpublic void rollbackTransaction(AbstractSession session) throws DatabaseException
rollbackTransaction in interface AccessorDatabaseExceptionpublic boolean usesExternalTransactionController()
usesExternalTransactionController in interface Accessorpublic boolean isConnected()
isConnected in interface Accessorpublic void flushSelectCalls(AbstractSession session)
flushSelectCalls in interface Accessororg.eclipse.persistence.internal.helper.LOBValueWriter#buildAndExecuteCallForLocator(DatabaseCall,Session,Accessor)public void writesCompleted(AbstractSession session)
writesCompleted in interface Accessorpublic SequencingCallback getSequencingCallback(SequencingCallbackFactory sequencingCallbackFactory)
getSequencingCallback in interface Accessorpublic void createCustomizer(AbstractSession session)
createCustomizer in interface Accessorpublic void releaseCustomizer()
releaseCustomizer in interface Accessorpublic void releaseCustomizer(AbstractSession session)
releaseCustomizer in interface Accessorpublic ConnectionPool getPool()
public void setPool(ConnectionPool pool)
EclipseLink 2.6.3, "build v20160428-59c81c5" API Reference