public class TransactionImpl extends HandleResource implements TransactionResource, Deletable
| Modifier and Type | Class and Description |
|---|---|
private static class |
TransactionImpl.WorkArea
Context-local state.
|
| Modifier and Type | Field and Description |
|---|---|
private boolean |
defaultCommit
The current value of the DEFAULT-COMMIT attribute.
|
private static CentralLogger |
LOG
Logger
|
private boolean |
openByTxInitProc
Flag indicating the current tx was open by TRANS-INIT-PROCEDURE.
|
private boolean |
pendingCommit
Flag turned on when a pending commit is active, via
setCommit(). |
private boolean |
pendingRollback
Flag turned on when a pending rollback is active, via
setRollback(). |
private handle |
txInitProcedure
The current value of the TRANS-INIT-PROCEDURE attribute.
|
private static ContextLocal<TransactionImpl.WorkArea> |
work
Context local state for the TRANSACTION handle.
|
instProc, pm| Modifier | Constructor and Description |
|---|---|
private |
TransactionImpl()
Private c'tor, to allow a singleton instance of this resource, per each context.
|
| Modifier and Type | Method and Description |
|---|---|
void |
delete()
Perform actual delete of an resource.
|
(package private) static TransactionImpl |
get()
Get the TRANSACTION resource for this context.
|
handle |
getTxInitProcedure()
Get the TRANS-INIT-PROCEDURE attribute.
|
handle |
instantiatingProcedure()
Getter for the INSTANTIATING-PROCEDURE attribute.
|
logical |
isDefaultCommit()
Check the value of the DEFAULT-COMMIT attribute.
|
logical |
isOpen()
Getter of IS-OPEN attribute - it will return the value of the
TransactionManager.isTransactionActive() call. |
(package private) static boolean |
isOpenByTxInitProc()
Get the
openByTxInitProc flag. |
(package private) static boolean |
isTxInitProcedure(java.lang.Object referent)
Check if the given external program instance is the
TRANS-INIT-PROCEDURE attribute. |
(package private) static boolean |
requestFinished(boolean chained,
boolean implicit)
Notification that a top-level request has been finished, in the context of a top-level block
belonging to the TRANS-INIT-PROCEDURE external program.
|
logical |
setCommit()
If we are in a TRANSACTION-MODE AUTOMATIC state and a tx is open, mark a pending commit for
the current top-level block.
|
void |
setDefaultCommit(boolean l)
Set the value of the DEFAULT-COMMIT attribute.
|
void |
setDefaultCommit(logical l)
Set the value of the DEFAULT-COMMIT attribute.
|
(package private) static void |
setOpenByTxInitProc(boolean l)
Set the
openByTxInitProc flag. |
logical |
setRollback()
If we are in a TRANSACTION-MODE AUTOMATIC state and a tx is open, mark a pending rollback for
the current top-level block.
|
(package private) static void |
setTxInitProcedure(java.lang.Object referent)
Explicitly assign the
TRANS-INIT-PROCEDURE attribute. |
boolean |
valid()
Implementation for the
WrappedResource.valid() API. |
_instantiatingProcedure, addToPool, doDelete, equals, hashCode, id, id, implicitDeletion, incrementTrigger, invalidAttribute, processResource, readOnlyError, readOnlyError, registerResource, resourceDelete, resourceType, setInstantiatingProcedure, toString, type, unableToAssignUnknown, unknownclone, finalize, getClass, notify, notifyAll, wait, wait, waitallowDeleteprivate static final CentralLogger LOG
private static final ContextLocal<TransactionImpl.WorkArea> work
private handle txInitProcedure
private boolean defaultCommit
private boolean pendingRollback
setRollback().private boolean pendingCommit
setCommit().private boolean openByTxInitProc
private TransactionImpl()
static TransactionImpl get()
public boolean valid()
WrappedResource.valid() API.valid in interface WrappedResourcepublic void delete()
HandleResource
The method first calls HandleResource.resourceDelete(), if the method returns false, the deletion
is aborted.
delete in interface Deletabledelete in class HandleResourcepublic handle instantiatingProcedure()
instantiatingProcedure in interface InstantiatingProcedureinstantiatingProcedure in class HandleResourcepublic logical isOpen()
TransactionManager.isTransactionActive() call.public logical isDefaultCommit()
isDefaultCommit in interface TransactionResourcepublic void setDefaultCommit(logical l)
setDefaultCommit in interface TransactionResourcel - The value of the DEFAULT-COMMIT attribute.public void setDefaultCommit(boolean l)
setDefaultCommit in interface TransactionResourcel - The value of the DEFAULT-COMMIT attribute.public handle getTxInitProcedure()
getTxInitProcedure in interface TransactionResourcepublic logical setCommit()
setCommit in interface TransactionResourcetrue if the pending commit was set or a tx is not open.public logical setRollback()
setRollback in interface TransactionResourcetrue if the pending rollback was set or a tx is not open.static void setTxInitProcedure(java.lang.Object referent)
TRANS-INIT-PROCEDURE attribute.referent - The new procedure having a TRANSACTION-MODE AUTOMATIC statement, or null
to clear this attribute and the pending flags.static boolean isTxInitProcedure(java.lang.Object referent)
TRANS-INIT-PROCEDURE attribute.referent - The external program instance to check.true if the refernet is the same as the txInitProcedure.static boolean isOpenByTxInitProc()
openByTxInitProc flag.openByTxInitProc.static void setOpenByTxInitProc(boolean l)
openByTxInitProc flag.l - The new state of the openByTxInitProc.static boolean requestFinished(boolean chained,
boolean implicit)