Class InTransaction<T extends java.io.Serializable>

  • 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 given Operation in a transaction. Useful in combination with ApplyBatch.
    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 given Operation 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.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 Detail

      • InTransaction

        public InTransaction​(com.lexmark.saperion.remote.common.operations.Operation<T,​SaBasicException,​LegacyConnection> toInvoke)
        Creates a new instance of InTransaction that invokes the given Operation inside a new database transaction.
        Parameters:
        toInvoke - The Operation to invoke. Use ApplyBatch as parameter to apply a batch in a transaction.
    • Method Detail

      • 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 interface com.lexmark.saperion.remote.common.operations.Operation<T extends java.io.Serializable,​SaBasicException,​LegacyConnection>
        Overrides:
        afterInvoke in class com.lexmark.saperion.remote.common.operations.AbstractOperation<T extends java.io.Serializable,​SaBasicException,​LegacyConnection>
      • getResult

        public T getResult()
        Specified by:
        getResult in interface com.lexmark.saperion.remote.common.operations.Operation<T extends java.io.Serializable,​SaBasicException,​LegacyConnection>
        Overrides:
        getResult in class com.lexmark.saperion.remote.common.operations.AbstractOperation<T extends java.io.Serializable,​SaBasicException,​LegacyConnection>