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 givenOperation
in 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 givenOperation
inside a new database transaction.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
afterInvoke(java.lang.Object result, LegacyConnection connection)
void
finishTransaction()
Must be called if the caller calls with an operation take requires to open JniConnector, before calling invoke.T
getResult()
T
invoke()
void
startTransaction()
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 givenOperation
inside a new database transaction.- Parameters:
toInvoke
- TheOperation
to invoke. UseApplyBatch
as 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.RemoteException
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:
java.rmi.RemoteException
-
finishTransaction
public void finishTransaction() throws java.rmi.RemoteException
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:
java.rmi.RemoteException
-
afterInvoke
public void afterInvoke(java.lang.Object result, LegacyConnection connection)
- Specified by:
afterInvoke
in interfacecom.lexmark.saperion.remote.common.operations.Operation<T extends java.io.Serializable,SaBasicException,LegacyConnection>
- Overrides:
afterInvoke
in classcom.lexmark.saperion.remote.common.operations.AbstractOperation<T extends java.io.Serializable,SaBasicException,LegacyConnection>
-
getResult
public T getResult()
- Specified by:
getResult
in interfacecom.lexmark.saperion.remote.common.operations.Operation<T extends java.io.Serializable,SaBasicException,LegacyConnection>
- Overrides:
getResult
in classcom.lexmark.saperion.remote.common.operations.AbstractOperation<T extends java.io.Serializable,SaBasicException,LegacyConnection>
-
-