Package com.saperion.operations
Class InTransaction<T extends java.io.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>,java.io.Serializable
public class InTransaction<T extends java.io.Serializable> extends LegacyOperation<T>
Invokes the givenOperationin a transaction. Useful in combination withApplyBatch.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description 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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterInvoke(java.lang.Object result, LegacyConnection connection)voidfinishTransaction()Must be called if the caller calls with an operation take requires to open JniConnector, before calling invoke.TgetResult()Tinvoke()voidstartTransaction()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
-
-
-
-
Constructor Detail
-
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 Detail
-
invoke
public T invoke() throws SaBasicException
- Throws:
SaBasicException
-
startTransaction
public void startTransaction() throws java.rmi.RemoteExceptionMust 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:
java.rmi.RemoteException
-
finishTransaction
public void finishTransaction() throws java.rmi.RemoteExceptionMust 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:
java.rmi.RemoteException
-
afterInvoke
public void afterInvoke(java.lang.Object result, LegacyConnection connection)- Specified by:
afterInvokein interfacecom.lexmark.saperion.remote.common.operations.Operation<T extends java.io.Serializable,SaBasicException,LegacyConnection>- Overrides:
afterInvokein classcom.lexmark.saperion.remote.common.operations.AbstractOperation<T extends java.io.Serializable,SaBasicException,LegacyConnection>
-
getResult
public T getResult()
- Specified by:
getResultin interfacecom.lexmark.saperion.remote.common.operations.Operation<T extends java.io.Serializable,SaBasicException,LegacyConnection>- Overrides:
getResultin classcom.lexmark.saperion.remote.common.operations.AbstractOperation<T extends java.io.Serializable,SaBasicException,LegacyConnection>
-
-