|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.datanucleus.store.rdbms.AbstractSchemaTransaction
public abstract class AbstractSchemaTransaction
An abstract base class for RDBMSManager transactions that perform some schema operation on the database.
Management transactions may be retried in the face of SQL exceptions to work around failures caused by transient conditions, such as DB deadlocks.
| Field Summary | |
|---|---|
protected int |
isolationLevel
|
protected int |
maxRetries
|
protected org.datanucleus.store.connection.ManagedConnection |
mconn
|
protected RDBMSStoreManager |
rdbmsMgr
|
| Constructor Summary | |
|---|---|
AbstractSchemaTransaction(RDBMSStoreManager rdbmsMgr,
int isolationLevel)
Constructs a new management transaction having the given isolation level. |
|
| Method Summary | |
|---|---|
void |
execute(org.datanucleus.ClassLoaderResolver clr)
Executes the transaction. |
protected Connection |
getCurrentConnection()
Obtains the current connection for the transaction. |
protected abstract void |
run(org.datanucleus.ClassLoaderResolver clr)
Implements the body of the transaction. |
abstract String |
toString()
Returns a description of the management transaction. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected RDBMSStoreManager rdbmsMgr
protected final int isolationLevel
protected final int maxRetries
protected org.datanucleus.store.connection.ManagedConnection mconn
| Constructor Detail |
|---|
public AbstractSchemaTransaction(RDBMSStoreManager rdbmsMgr,
int isolationLevel)
rdbmsMgr - RDBMSManager to useisolationLevel - One of the isolation level constants from java.sql.Connection.| Method Detail |
|---|
public abstract String toString()
toString in class Object
protected abstract void run(org.datanucleus.ClassLoaderResolver clr)
throws SQLException
clr - the ClassLoaderResolver
SQLException - Thrown if the transaction fails due to a database error that should allow
the entire transaction to be retried.
protected Connection getCurrentConnection()
throws SQLException
SQLExceptionpublic final void execute(org.datanucleus.ClassLoaderResolver clr)
A database connection is acquired and the
execute(ClassLoaderResolver)method is invoked.
If the selected isolation level is not Connection.TRANSACTION_NONE,
then commit() or rollback() is called on the connection according to
whether the invocation succeeded or not. If the invocation failed the
sequence is repeated, up to a maximum of maxRetries
times, configurable by the system property datanucleus.store.maxRetries.
clr - the ClassLoaderResolver
org.datanucleus.exceptions.NucleusDataStoreException - If a SQL exception occurred even after "maxRetries" attempts.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||