|
The Spring Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.jdbc.datasource.JdbcTransactionObjectSupport
public abstract class JdbcTransactionObjectSupport
Convenient base class for JDBC-aware transaction objects. Can contain a ConnectionHolder, and implements the SavepointManager interface based on that ConnectionHolder.
Implements the SavepointManager interface to allow for programmatic management of JDBC 3.0 Savepoints. DefaultTransactionStatus will automatically delegate to this, as it auto-detects transaction objects that implement the SavepointManager interface.
Note that savepoints are only supported for JDBC 3.0.
Savepoint
Constructor Summary | |
---|---|
JdbcTransactionObjectSupport()
|
Method Summary | |
---|---|
Object |
createSavepoint()
This implementation creates a JDBC 3.0 Savepoint and returns it. |
ConnectionHolder |
getConnectionHolder()
|
protected ConnectionHolder |
getConnectionHolderForSavepoint()
|
Integer |
getPreviousIsolationLevel()
|
boolean |
hasConnectionHolder()
|
boolean |
isSavepointAllowed()
|
void |
releaseSavepoint(Object savepoint)
This implementation releases the given JDBC 3.0 Savepoint. |
void |
rollbackToSavepoint(Object savepoint)
This implementation rolls back to the given JDBC 3.0 Savepoint. |
void |
setConnectionHolder(ConnectionHolder connectionHolder)
|
void |
setPreviousIsolationLevel(Integer previousIsolationLevel)
|
void |
setSavepointAllowed(boolean savepointAllowed)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.springframework.transaction.support.SmartTransactionObject |
---|
isRollbackOnly |
Constructor Detail |
---|
public JdbcTransactionObjectSupport()
Method Detail |
---|
public void setConnectionHolder(ConnectionHolder connectionHolder)
public ConnectionHolder getConnectionHolder()
public boolean hasConnectionHolder()
public void setPreviousIsolationLevel(Integer previousIsolationLevel)
public Integer getPreviousIsolationLevel()
public void setSavepointAllowed(boolean savepointAllowed)
public boolean isSavepointAllowed()
public Object createSavepoint() throws TransactionException
createSavepoint
in interface SavepointManager
NestedTransactionNotSupportedException
- if the underlying
transaction does not support savepoints
TransactionException
- if the savepoint could not be created,
for example because the transaction is not in an appropriate stateConnection.setSavepoint()
public void rollbackToSavepoint(Object savepoint) throws TransactionException
rollbackToSavepoint
in interface SavepointManager
savepoint
- the savepoint to roll back to
NestedTransactionNotSupportedException
- if the underlying
transaction does not support savepoints
TransactionException
- if the rollback failedConnection.rollback(java.sql.Savepoint)
public void releaseSavepoint(Object savepoint) throws TransactionException
releaseSavepoint
in interface SavepointManager
savepoint
- the savepoint to release
NestedTransactionNotSupportedException
- if the underlying
transaction does not support savepoints
TransactionException
- if the release failedConnection.releaseSavepoint(java.sql.Savepoint)
protected ConnectionHolder getConnectionHolderForSavepoint() throws TransactionException
TransactionException
|
The Spring Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |