|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ControlDAO
DAO services for database control statements. It is sometimes necessary to issue control statements on a database connection; these are not usually supported in the ANSI SQL standard.
Method Summary | |
---|---|
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. |
Method Detail |
---|
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 point
void 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 level
java.lang.IllegalStateException
- if the isolation level is invalid or cannot be changed
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |