public interface ControlDAO
| Modifier and Type | Method and Description |
|---|---|
java.sql.Savepoint |
createSavepoint(java.lang.String savepoint)
Create a "Save Point" in the current transaction, for later selective rollback.
|
void |
executeBatch()
Execute statements that were queued for batching.
|
void |
releaseSavepoint(java.sql.Savepoint savepoint)
Remove a previously-created "Save Point", writing any intervening updates
into the current transaction.
|
void |
rollbackToSavepoint(java.sql.Savepoint savepoint)
Roll back to a previously-created "Save Point", discarding any intervening
changes to the current transaction.
|
int |
setTransactionIsolationLevel(int isolationLevel)
Change the current transaction isolation level.
|
void |
startBatch()
Begin batching prepared statements for later execution.
|
void startBatch()
ControlDAO.executeBatch()void executeBatch()
ControlDAO.startBatch()java.sql.Savepoint createSavepoint(java.lang.String savepoint)
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
...
}
savepoint - the name of the save pointvoid rollbackToSavepoint(java.sql.Savepoint savepoint)
savepoint - a previously-created savepointControlDAO.createSavepoint(String)void releaseSavepoint(java.sql.Savepoint savepoint)
savepoint - the name of the save pointControlDAO.createSavepoint(String)int setTransactionIsolationLevel(int isolationLevel)
isolationLevel - the transaction isolation leveljava.lang.IllegalStateException - if the isolation level is invalid or cannot be changedCopyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.