public abstract class AbstractControlDAOImpl extends Object implements ControlDAO
Provides any basic logic.
Constructor and Description |
---|
AbstractControlDAOImpl() |
Modifier and Type | Method and Description |
---|---|
Savepoint |
createSavepoint(String savepoint)
Create a "Save Point" in the current transaction, for later selective rollback.
|
void |
releaseSavepoint(Savepoint savepoint)
No-op
|
void |
rollbackToSavepoint(Savepoint savepoint)
No-op
|
int |
setTransactionIsolationLevel(int isolationLevel)
Change the current transaction isolation level.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
executeBatch, startBatch
public Savepoint createSavepoint(String savepoint)
ControlDAO
ControlDAO.rollbackToSavepoint(Savepoint)
or ControlDAO.releaseSavepoint(Savepoint)
.
Savepoint savepoint = controlDAO.createSavepoint("functionF");
try
{
// Do something that could fail e.g. blind insert that might violate unique constraints
...
// Success, so remove savepoint or risk crashing on long-running transactions
controlDAO.releaseSavepoint(savepoint);
}
catch (Throwable e)
{
controlDAO.rollbackToSavepoint(savepoint);
// Throw something that client code might be able to react to or try something else
...
}
createSavepoint
in interface ControlDAO
savepoint
- the name of the save pointpublic void rollbackToSavepoint(Savepoint savepoint)
rollbackToSavepoint
in interface ControlDAO
savepoint
- a previously-created savepointControlDAO.createSavepoint(String)
public void releaseSavepoint(Savepoint savepoint)
releaseSavepoint
in interface ControlDAO
savepoint
- the name of the save pointControlDAO.createSavepoint(String)
public int setTransactionIsolationLevel(int isolationLevel)
ControlDAO
setTransactionIsolationLevel
in interface ControlDAO
isolationLevel
- the transaction isolation levelCopyright © 2005–2017 Alfresco Software. All rights reserved.