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 givenOperationinside a new database transaction. -
Method Summary
Modifier and TypeMethodDescriptionvoidafterInvoke(Object result, LegacyConnection connection) voidMust be called if the caller calls with an operation take requires to open JniConnector, before calling invoke.invoke()voidMust 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, mapExceptionMethods inherited from class com.lexmark.saperion.remote.common.operations.AbstractOperation
toArrayList, toCaseInsensitiveMap, toHashMap, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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 givenOperationinside a new database transaction.- Parameters:
toInvoke- TheOperationto invoke. UseApplyBatchas 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:
afterInvokein interfacecom.lexmark.saperion.remote.common.operations.Operation<T extends Serializable,SaBasicException, LegacyConnection> - Overrides:
afterInvokein classcom.lexmark.saperion.remote.common.operations.AbstractOperation<T extends Serializable,SaBasicException, LegacyConnection>
-
getResult
- Specified by:
getResultin interfacecom.lexmark.saperion.remote.common.operations.Operation<T extends Serializable,SaBasicException, LegacyConnection> - Overrides:
getResultin classcom.lexmark.saperion.remote.common.operations.AbstractOperation<T extends Serializable,SaBasicException, LegacyConnection>
-