Package net.sf.basedb.core.hibernate
Class SavePointWork<R>
- java.lang.Object
-
- net.sf.basedb.core.hibernate.SavePointWork<R>
-
- All Implemented Interfaces:
org.hibernate.jdbc.ReturningWork<R>
public class SavePointWork<R> extends Object implements org.hibernate.jdbc.ReturningWork<R>
A wrapper work that protects a parent work with a savepoint. Before executing the parent work, aSavepoint
is created on theConnection
. If the parent work results throws anSQLException
the connection is rolled back to the savepoint. Other exceptions and a normal completion just releases the savepoint.- Since:
- 3.1
- Author:
- nicklas
- Last modified
- $Date: 2014-06-10 13:27:02 +0200 (ti, 10 jun 2014) $
-
-
Constructor Summary
Constructors Constructor Description SavePointWork(org.hibernate.jdbc.ReturningWork<R> work)
Create a new work item.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description R
execute(Connection connection)
From the Work interface -----------------------
-
-
-
Field Detail
-
work
private final org.hibernate.jdbc.ReturningWork<R> work
-
-
Constructor Detail
-
SavePointWork
public SavePointWork(org.hibernate.jdbc.ReturningWork<R> work)
Create a new work item.- Parameters:
work
- The parent work
-
-
Method Detail
-
execute
public R execute(Connection connection) throws SQLException
From the Work interface ------------------------ Specified by:
execute
in interfaceorg.hibernate.jdbc.ReturningWork<R>
- Throws:
SQLException
-
-