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
ConstructorsConstructorDescriptionDataSourceWorkResource(DataSourceResource dataSourceResource, Connection connection) -
Method Summary
Modifier and TypeMethodDescriptionvoidbegin()voidclose()voidcommit()static StringcomputeWorkUnitResourceKey(String dataSourceName) static DataSourceWorkResourceget(DataSourceResource dataSourceResource, ThrowingSupplier<Connection, SQLException> supplier) Get a work resource from the work unit.voidrollback()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.zfabrik.work.IWorkResource
afterCompletion, beforeCompletion, begin
-
Constructor Details
-
DataSourceWorkResource
public DataSourceWorkResource(DataSourceResource dataSourceResource, Connection connection) 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:
beginin interfaceIWorkResource
-
close
- Specified by:
closein interfaceIWorkResource- Throws:
WorkException
-
commit
public void commit()- Specified by:
commitin interfaceIWorkResource
-
rollback
- Specified by:
rollbackin interfaceIWorkResource- Throws:
WorkException
-