Package com.zfabrik.impl.db.data
Class DataSourceWorkResource
java.lang.Object
com.zfabrik.impl.db.data.DataSourceWorkResource
- All Implemented Interfaces:
IWorkResource
Work resource, keeping the connection per data source on the work unit.
-
Constructor Summary
ConstructorDescriptionDataSourceWorkResource(DataSourceResource dataSourceResource, Connection conn)
-
Method Summary
Modifier and TypeMethodDescriptionvoid
begin()
void
close()
void
commit()
static String
computeWorkUnitResourceKey(String dataSourceName)
static DataSourceWorkResource
get(DataSourceResource dataSourceResource, ThrowingSupplier<Connection,SQLException> supplier)
Get a work resource from the work unit.void
rollback()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.zfabrik.work.IWorkResource
afterCompletion, beforeCompletion, begin
-
Constructor Details
-
DataSourceWorkResource
public DataSourceWorkResource(DataSourceResource dataSourceResource, Connection conn) throws Exception- Throws:
Exception
-
-
Method Details
-
get
public static DataSourceWorkResource get(DataSourceResource dataSourceResource, ThrowingSupplier<Connection,SQLException> supplier)Get a work resource from the work unit. Bind a new one, if none present -
computeWorkUnitResourceKey
-
getConnection
-
begin
public void begin()- Specified by:
begin
in interfaceIWorkResource
-
close
- Specified by:
close
in interfaceIWorkResource
- Throws:
WorkException
-
commit
public void commit()- Specified by:
commit
in interfaceIWorkResource
-
rollback
- Specified by:
rollback
in interfaceIWorkResource
- Throws:
WorkException
-