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 java.util.logging.Logger |
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
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 |
---|---|
(package private) static boolean |
_isDefaultCommit()
Check if the default commit flag is on and no pending rollback or commit exists.
|
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)
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. |
doDelete, getResourceType, id, id, implicitDeletion, incrementTrigger, invalidAttribute, processResource, readOnlyError, readOnlyError, registerResource, resourceDelete, setInstantiatingProcedure, toString, type, unableToAssignUnknown, unknown
private static final java.util.logging.Logger 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 WrappedResource
public void delete()
HandleResource
The method first calls HandleResource.resourceDelete()
, if the method returns false
, the deletion
is aborted.
delete
in interface Deletable
delete
in class HandleResource
public handle instantiatingProcedure()
instantiatingProcedure
in interface InstantiatingProcedure
instantiatingProcedure
in class HandleResource
public logical isOpen()
TransactionManager.isTransactionActive()
call.public logical isDefaultCommit()
isDefaultCommit
in interface TransactionResource
public void setDefaultCommit(logical l)
setDefaultCommit
in interface TransactionResource
l
- The value of the DEFAULT-COMMIT attribute.public void setDefaultCommit(boolean l)
setDefaultCommit
in interface TransactionResource
l
- The value of the DEFAULT-COMMIT attribute.public handle getTxInitProcedure()
getTxInitProcedure
in interface TransactionResource
public logical setCommit()
setCommit
in interface TransactionResource
true
if the pending commit was set or a tx is not open.public logical setRollback()
setRollback
in interface TransactionResource
true
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 _isDefaultCommit()
static boolean requestFinished(boolean chained)