|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jodd.db.jtx.DbJtxResourceManager
public class DbJtxResourceManager
Database JtxResourceManager
manages life-cycle of DbSession
resources.
Also acts as an adapter of resource object (of any type) and JTX engine.
Transaction resources may be of any type. The only thing what is important is that resource must be aware of its transactional state - is it in no-transactional mode (i.e. auto-commit), or under the transaction.
Field Summary | |
---|---|
protected ConnectionProvider |
connectionProvider
|
Constructor Summary | |
---|---|
DbJtxResourceManager(ConnectionProvider connectionProvider)
Creates resource manager. |
Method Summary | |
---|---|
DbSession |
beginTransaction(JtxTransactionMode txMode)
Creates new resource and begins new transaction if specified so by propagation behavior . |
void |
close()
Closes manager and free its resources. |
void |
commitTransaction(DbSession resource)
Commits resource and closes it if committing was successful. |
java.lang.Class<DbSession> |
getResourceType()
Returns associated resource type. |
void |
rollbackTransaction(DbSession resource)
Rollback resource and closes it. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final ConnectionProvider connectionProvider
Constructor Detail |
---|
public DbJtxResourceManager(ConnectionProvider connectionProvider)
Method Detail |
---|
public java.lang.Class<DbSession> getResourceType()
getResourceType
in interface JtxResourceManager<DbSession>
public DbSession beginTransaction(JtxTransactionMode txMode)
propagation behavior
.
beginTransaction
in interface JtxResourceManager<DbSession>
public void commitTransaction(DbSession resource)
commitTransaction
in interface JtxResourceManager<DbSession>
public void rollbackTransaction(DbSession resource)
rollbackTransaction
in interface JtxResourceManager<DbSession>
public void close()
close
in interface JtxResourceManager<DbSession>
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |