Package com.saperion.operations
Class InTransaction<T extends Serializable>
java.lang.Object
com.lexmark.saperion.remote.common.operations.AbstractOperation<T,SaBasicException,LegacyConnection>
com.saperion.operations.LegacyOperation<T>
com.saperion.operations.InTransaction<T>
- Type Parameters:
T
-
- All Implemented Interfaces:
com.lexmark.saperion.remote.common.operations.Operation<T,
,SaBasicException, LegacyConnection> Serializable
Invokes the given
Operation
in a transaction. Useful in combination with ApplyBatch
.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionInTransaction
(com.lexmark.saperion.remote.common.operations.Operation<T, SaBasicException, LegacyConnection> toInvoke) Creates a new instance of InTransaction that invokes the givenOperation
inside a new database transaction. -
Method Summary
Modifier and TypeMethodDescriptionvoid
afterInvoke
(Object result, LegacyConnection connection) void
Must be called if the caller calls with an operation take requires to open JniConnector, before calling invoke.invoke()
void
Must be called if the caller calls with an operation take requires to open JniConnector, before calling invoke.Methods inherited from class com.saperion.operations.LegacyOperation
beforeInvoke, beforeInvoke, getClientToken, mapEcmException, mapException
Methods inherited from class com.lexmark.saperion.remote.common.operations.AbstractOperation
toArrayList, toCaseInsensitiveMap, toHashMap, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.lexmark.saperion.remote.common.operations.Operation
audit, dispatchEvent, isAuditable, isEventDispatcher
-
Constructor Details
-
InTransaction
public InTransaction(com.lexmark.saperion.remote.common.operations.Operation<T, SaBasicException, LegacyConnection> toInvoke) Creates a new instance of InTransaction that invokes the givenOperation
inside a new database transaction.- Parameters:
toInvoke
- TheOperation
to invoke. UseApplyBatch
as parameter to apply a batch in a transaction.
-
-
Method Details
-
invoke
- Throws:
SaBasicException
-
startTransaction
Must be called if the caller calls with an operation take requires to open JniConnector, before calling invoke. It's because the InTransaction isn't capable of closing the connector which will be opened by the operation it is invoking SECM-2085 ClassicConnector: invoke method creates a warning in combination with InTransaction and applyBatch- Throws:
RemoteException
-
finishTransaction
Must be called if the caller calls with an operation take requires to open JniConnector, before calling invoke. It's because the InTransaction isn't capable of closing the connector which will be opened by the operation it is invoking SECM-2085 ClassicConnector: invoke method creates a warning in combination with InTransaction and applyBatch- Throws:
RemoteException
-
afterInvoke
- Specified by:
afterInvoke
in interfacecom.lexmark.saperion.remote.common.operations.Operation<T extends Serializable,
SaBasicException, LegacyConnection> - Overrides:
afterInvoke
in classcom.lexmark.saperion.remote.common.operations.AbstractOperation<T extends Serializable,
SaBasicException, LegacyConnection>
-
getResult
- Specified by:
getResult
in interfacecom.lexmark.saperion.remote.common.operations.Operation<T extends Serializable,
SaBasicException, LegacyConnection> - Overrides:
getResult
in classcom.lexmark.saperion.remote.common.operations.AbstractOperation<T extends Serializable,
SaBasicException, LegacyConnection>
-