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 Accessor
public void setIsValid(boolean isValid)
setIsValid
in interface Accessor
public boolean isInTransaction()
isInTransaction
in interface Accessor
public boolean isValid()
public boolean isPossibleFailure()
public void setPossibleFailure(boolean possibleFailure)
public boolean usesExternalConnectionPooling()
usesExternalConnectionPooling
in interface Accessor
public void beginTransaction(AbstractSession session) throws DatabaseException
beginTransaction
in interface Accessor
DatabaseException
public void decrementCallCount()
decrementCallCount
in interface Accessor
public void incrementCallCount(AbstractSession session)
incrementCallCount
in interface Accessor
public int getCallCount()
getCallCount
in interface Accessor
public void commitTransaction(AbstractSession session) throws DatabaseException
commitTransaction
in interface Accessor
DatabaseException
public void connect(Login login, AbstractSession session) throws DatabaseException
connect
in interface Accessor
DatabaseException
public Login getLogin()
public void disconnect(AbstractSession session) throws DatabaseException
disconnect
in interface Accessor
DatabaseException
public void closeConnection()
closeConnection
in interface Accessor
public java.lang.Object executeCall(Call call, AbstractRecord translationRow, AbstractSession session) throws DatabaseException
executeCall
in interface Accessor
DatabaseException
public void reestablishConnection(AbstractSession session) throws DatabaseException
reestablishConnection
in interface Accessor
DatabaseException
public DatasourcePlatform getDatasourcePlatform()
public void setDatasourcePlatform(DatasourcePlatform platform)
public java.lang.Object getDatasourceConnection()
getDatasourceConnection
in interface Accessor
public java.sql.Connection getConnection()
getConnection
in interface Accessor
public 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 Accessor
DatabaseException
public 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 Accessor
DatabaseException
public void rollbackTransaction(AbstractSession session) throws DatabaseException
rollbackTransaction
in interface Accessor
DatabaseException
public boolean usesExternalTransactionController()
usesExternalTransactionController
in interface Accessor
public boolean isConnected()
isConnected
in interface Accessor
public void flushSelectCalls(AbstractSession session)
flushSelectCalls
in interface Accessor
org.eclipse.persistence.internal.helper.LOBValueWriter#buildAndExecuteCallForLocator(DatabaseCall,Session,Accessor)
public void writesCompleted(AbstractSession session)
writesCompleted
in interface Accessor
public SequencingCallback getSequencingCallback(SequencingCallbackFactory sequencingCallbackFactory)
getSequencingCallback
in interface Accessor
public void createCustomizer(AbstractSession session)
createCustomizer
in interface Accessor
public void releaseCustomizer()
releaseCustomizer
in interface Accessor
public void releaseCustomizer(AbstractSession session)
releaseCustomizer
in interface Accessor
public ConnectionPool getPool()
public void setPool(ConnectionPool pool)
EclipseLink 2.6.3, "build v20160428-59c81c5" API Reference