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 SummaryConstructorsConstructorDescription- DatabaseActionTXPNode- (VSActionTXProcess actionProcess, DatabaseActionActor.Settings settings, IDBConnectionPool pool) Constructor.
- Method SummaryModifier and TypeMethodDescription- begin- (ITXProcess process, ITXPid pid) Notifies the node it got associated with a transactional process.- commit- (ITXProcess process) Instructs the node to commit the work.- protected voidCommits 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 ConnectionReturns the connection.- protected voidCleans up: releases back the connection to the pool.- 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 Details- DatabaseActionTXPNodepublic 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 Details- beginDescription 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
 
- getConnectionReturns the connection.- Returns:
- The JDBC connection.
 
- forgetNotifies 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.
 
- commitDescription 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
 
- rollbackDescription 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
 
- setStateSets 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.
 
- commitReadOnlyprotected void commitReadOnly()Commits the local transaction after read only work. The context is released after commit.
- onCleanupprotected void onCleanup()Cleans up: releases back the connection to the pool.- Overrides:
- onCleanupin class- AbstractActionActorTXPNode<DatabaseActionActor.Settings>