Package com.iizix.db.prop
Class DatabaseActionTXPNode
- java.lang.Object
- com.iizix.txp.impl.AbstractTXPNode
- com.iizix.txp.impl.AbstractActionActorTXPNode<DatabaseActionActor.Settings>
- com.iizix.db.prop.DatabaseActionTXPNode
 
 
 
- All Implemented Interfaces:
- IActionActorSettingsReceiver<DatabaseActionActor.Settings>,- ITimeoutListener,- ITXPNode
 - public abstract class DatabaseActionTXPNode extends AbstractActionActorTXPNode<DatabaseActionActor.Settings> Database actor implementation for a TXP node.- Author:
- Christopher Mindus
 
- Nested Class Summary- Nested classes/interfaces inherited from interface com.iizix.txp.ITXPNode- ITXPNode.State
 
 - Field Summary- Fields inherited from class com.iizix.txp.impl.AbstractTXPNode- hasProcessTimedOut, hasTimedOut, hasTimedOutWaiting, pid, process, state, timeout, timeoutTask, txplog
 
 - Constructor Summary- Constructors - Constructor - Description - DatabaseActionTXPNode(VSActionTXProcess actionProcess, DatabaseActionActor.Settings settings, IDBConnectionPool pool)Constructor.
 - Method Summary- All Methods Instance Methods Concrete Methods - Modifier and Type - Method - Description - ITXPNode.State- begin(ITXProcess process, ITXPid pid)Notifies the node it got associated with a transactional process.- ITXPNode.State- commit(ITXProcess process)Instructs the node to commit the work.- protected void- commitReadOnly()Commits the local transaction after read only work.- void- forget(ITXProcess process)Notifies the node it got disassociated from the process ie it can abort, rollback (if needed) and forget about the process.- protected java.sql.Connection- getConnection()Returns the connection.- protected void- onCleanup()Cleans up: releases back the connection to the pool.- ITXPNode.State- rollback(ITXProcess process)Instructs the node to roll back the work.- protected void- setState(ITXPNode.State state)Sets the current state of the node.- Methods inherited from class com.iizix.txp.impl.AbstractActionActorTXPNode- assignSettings, cleanUp, createLogger, execute, executeAction, getAction, getActionProcess, getLoggerInfo, getSettings, getVirtualSpace, prepare, prepareAction
 - Methods inherited from class com.iizix.txp.impl.AbstractTXPNode- cancelTimeout, getPid, getProcess, getState, getTimeout, hasProcessTimedOut, hasTimedOut, hasTimedOutWaiting, isIdempotent, log, onTimeout, processTimeout, ready, recover, retry, setTimeout, timeout, undo
 
 
- Constructor Detail- DatabaseActionTXPNode- public DatabaseActionTXPNode(VSActionTXProcess actionProcess, DatabaseActionActor.Settings settings, IDBConnectionPool pool) Constructor.- Parameters:
- actionProcess- The action process.
- settings- Database action actor settings for transaction.
- pool- The Connection pool.
 
 
 - Method Detail- begin- public ITXPNode.State begin(ITXProcess process, ITXPid pid) Description copied from interface:- ITXPNodeNotifies the node it got associated with a transactional process. The node should set up its local transaction context and set and respond with either- ITXPNode.State.WORKINGor- ITXPNode.State.FAILEDdepending on its state.- Parameters:
- process- the process
- pid- the pid for this node of the process
- Returns:
- the state of the node
 
 - getConnection- protected java.sql.Connection getConnection() Returns the connection.- Returns:
- The JDBC connection.
 
 - forget- public void forget(ITXProcess process) Notifies the node it got disassociated from the process ie it can abort, rollback (if needed) and forget about the process.- Specified by:
- forgetin interface- ITXPNode
- Overrides:
- forgetin class- AbstractActionActorTXPNode<DatabaseActionActor.Settings>
- Parameters:
- process- The process.
 
 - commit- public ITXPNode.State commit(ITXProcess process) Description copied from interface:- ITXPNodeInstructs the node to commit the work. The node should set and respond with either- ITXPNode.State.COMPLETEDor- ITXPNode.State.FAILEDdepending on its state. If a commit failed the node is expected to have rolled back the work.- Parameters:
- process- the process
- Returns:
- the state of the node
 
 - rollback- public ITXPNode.State rollback(ITXProcess process) Description copied from interface:- ITXPNodeInstructs the node to roll back the work. The node should set and respond with either- ITXPNode.State.COMPLETEDor- ITXPNode.State.FAILEDdepending on its state. NOTE if the node failed its work it is already rolled back and will return- ITXPNode.State.COMPLETEDbut remain in state.- ITXPNode.State.FAILED- Parameters:
- process- the process
- Returns:
- the state of the node
 
 - setState- protected void setState(ITXPNode.State state) Sets the current state of the node. If the specified state is READ_ONLY the local transaction is committed immediately. If the state is FAILED the local transaction is immediately rolled back.- Overrides:
- setStatein class- AbstractActionActorTXPNode<DatabaseActionActor.Settings>
- Parameters:
- state- The state to set.
 
 - commitReadOnly- protected void commitReadOnly() Commits the local transaction after read only work. The context is released after commit.
 - onCleanup- protected void onCleanup() Cleans up: releases back the connection to the pool.- Overrides:
- onCleanupin class- AbstractActionActorTXPNode<DatabaseActionActor.Settings>