Interface TargetDataStore

  • All Known Implementing Classes:
    TargetDataStoreImpl

    public interface TargetDataStore
    This interface is used to apply XLA update records from a source datastore to a target datastore. It assumes that the source and target datastore schema are IDENTICAL for the subject tables.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      int apply​(byte[] updateDescriptor)
      Applies XLA update descriptor to the target datastore.
      int apply​(byte[] updateDescriptor, boolean useCommitFlag)
      Applies XLA update descriptor to the target datastore.
      int apply​(byte[] updateDescriptor, boolean useCommitFlag, boolean checkUpdateConflict)
      Applies XLA update descriptor to the target datastore.
      void close()
      Closes the connections to the datastore and releases all the resources in a timely manner.
      int commit()
      Use this method to perform a manual commit.
      boolean getAutoCommitFlag()
      Returns the value of autocommit flag.
      java.lang.String getConnectionString()
      Returns the connection string for this data store.
      boolean getUpdateConflictCheckFlag()
      Returns the value of the flag to check update conflicts.
      boolean isClosed()
      Use this method to check if this object is closed.
      boolean isDataStoreValid()
      Checks if the datastore is valid.
      int rollback()
      Use this method to rollback the last transaction in case of errors.
      void setAutoCommitFlag​(boolean flag)
      Sets the flag for autocommit during apply.
      void setUpdateConflictCheckFlag​(boolean flag)
      Sets the flag for checking update conflicts during apply.
    • Method Detail

      • getConnectionString

        java.lang.String getConnectionString()
        Returns the connection string for this data store.
        Returns:
        Connection string for this datastore.
      • setUpdateConflictCheckFlag

        void setUpdateConflictCheckFlag​(boolean flag)
        Sets the flag for checking update conflicts during apply.
        Parameters:
        flag - If set to true, update conflicts will be checked during apply.
        See Also:
        apply(byte[]), apply(byte[], boolean)
      • getUpdateConflictCheckFlag

        boolean getUpdateConflictCheckFlag()
        Returns the value of the flag to check update conflicts.
        Returns:
        true if update conflicts are checked during apply.
      • setAutoCommitFlag

        void setAutoCommitFlag​(boolean flag)
        Sets the flag for autocommit during apply.
        Parameters:
        flag - If set to true, apply will commit if TT_UPDCOMMIT is set or record type is COMMITONLY.
        See Also:
        apply(byte[]), commit(), rollback()
      • getAutoCommitFlag

        boolean getAutoCommitFlag()
        Returns the value of autocommit flag.
        Returns:
        true if this flag is set.
      • apply

        int apply​(byte[] updateDescriptor)
           throws jakarta.jms.JMSException
        Applies XLA update descriptor to the target datastore. Transactions will be committed if TT_UPDCOMMIT flag is set or if the record type is COMMITONLY. If updateConflictCheckFlag is set, update conflicts will be checked and reported.
        Parameters:
        updateDescriptor - XLA update descriptor. This can be extracted from JMS/XLA TimesTenMapMessage.
        Returns:
        0 if successful. Otherwise, a transient error code is returned. Applications can retry.
        Throws:
        jakarta.jms.JMSException - If there are database errors or schema mismatch, this exception will be thrown.
        See Also:
        setAutoCommitFlag(boolean), setUpdateConflictCheckFlag(boolean)
      • apply

        int apply​(byte[] updateDescriptor,
                  boolean useCommitFlag)
           throws jakarta.jms.JMSException
        Applies XLA update descriptor to the target datastore. If updateConflictCheckFlag is set, update conflicts will be checked and reported.
        Parameters:
        updateDescriptor - XLA update descriptor. This can be extracted from JMS/XLA TimesTenMapMessage.
        useCommitFlag - If set, transactions will be committed if TT_UPDCOMMIT flag is set or if the record type is COMMITONLY.
        Returns:
        0 if successful. Otherwise, a transient error code is returned. Applications can retry.
        Throws:
        jakarta.jms.JMSException - If there are database errors or schema mismatch, this exception will be thrown.
        See Also:
        setUpdateConflictCheckFlag(boolean)
      • apply

        int apply​(byte[] updateDescriptor,
                  boolean useCommitFlag,
                  boolean checkUpdateConflict)
           throws jakarta.jms.JMSException
        Applies XLA update descriptor to the target datastore.
        Parameters:
        updateDescriptor - XLA update descriptor. This can be extracted from JMS/XLA TimesTenMapMessage.
        useCommitFlag - If set, transactions will be committed if TT_UPDCOMMIT flag is set or if the record type is COMMITONLY.
        checkUpdateConflict - If set, check for update conflicts and report.
        Returns:
        0 if successful. Otherwise, a transient error code is returned. Applications can retry.
        Throws:
        jakarta.jms.JMSException - If there are database errors or schema mismatch, this exception will be thrown.
      • commit

        int commit()
            throws jakarta.jms.JMSException
        Use this method to perform a manual commit.
        Returns:
        0 if successful. Otherwise, a transient error code is returned. Applications can retry.
        Throws:
        jakarta.jms.JMSException - if commit fails.
        See Also:
        setAutoCommitFlag(boolean)
      • rollback

        int rollback()
              throws jakarta.jms.JMSException
        Use this method to rollback the last transaction in case of errors.
        Returns:
        0 if successful. Otherwise, a transient error code is returned. Applications can retry.
        Throws:
        jakarta.jms.JMSException - if rollback fails.
      • isDataStoreValid

        boolean isDataStoreValid()
                          throws jakarta.jms.JMSException
        Checks if the datastore is valid.
        Returns:
        true is the datastore is valid. This object should be closed and a new object instantiated. Continued use of this object will result in failures.
        Throws:
        jakarta.jms.JMSException - if it cannot ascertain the status of the datastore.
        See Also:
        close()
      • close

        void close()
            throws jakarta.jms.JMSException
        Closes the connections to the datastore and releases all the resources in a timely manner. Use of close() is highly recommended over relying on the garbage collector to release unneeded resources. Once closed, this object cannot be reused.
        Throws:
        jakarta.jms.JMSException - if some unrecoverable error occurs while closing.
      • isClosed

        boolean isClosed()
        Use this method to check if this object is closed. A closed object cannot be used any longer.
        Returns:
        true if this object is closed.