public class TargetDataStoreImpl extends java.lang.Object implements TargetDataStore
Constructor and Description |
---|
TargetDataStoreImpl(java.lang.String connectionString)
TargetDataStore creates connections and XLA handles to the datastore.
|
Modifier and Type | Method and 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.
|
public TargetDataStoreImpl(java.lang.String connectionString) throws jakarta.jms.JMSException
connectionString
- connection string to the datastore. If auto-commit is enabled, applies will
be committed.jakarta.jms.JMSException
- In case of an error while initializing XLApublic int commit() throws jakarta.jms.JMSException
TargetDataStore
commit
in interface TargetDataStore
jakarta.jms.JMSException
- if commit fails.TargetDataStore.setAutoCommitFlag(boolean)
public int rollback() throws jakarta.jms.JMSException
TargetDataStore
rollback
in interface TargetDataStore
jakarta.jms.JMSException
- if rollback fails.public boolean isDataStoreValid() throws jakarta.jms.JMSException
TargetDataStore
isDataStoreValid
in interface TargetDataStore
jakarta.jms.JMSException
- if it cannot ascertain the status of the datastore.TargetDataStore.close()
public void close() throws jakarta.jms.JMSException
TargetDataStore
close
in interface TargetDataStore
jakarta.jms.JMSException
- if some unrecoverable error occurs while closing.public java.lang.String getConnectionString()
TargetDataStore
getConnectionString
in interface TargetDataStore
public int apply(byte[] updateDescriptor, boolean useCommitFlag, boolean checkUpdateConflict) throws jakarta.jms.JMSException
TargetDataStore
apply
in interface TargetDataStore
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.jakarta.jms.JMSException
- If there are database errors or schema mismatch, this exception will be thrown.public int apply(byte[] updateDescriptor, boolean useCommitFlag) throws jakarta.jms.JMSException
TargetDataStore
apply
in interface TargetDataStore
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.jakarta.jms.JMSException
- If there are database errors or schema mismatch, this exception will be thrown.TargetDataStore.setUpdateConflictCheckFlag(boolean)
public int apply(byte[] updateDescriptor) throws jakarta.jms.JMSException
TargetDataStore
apply
in interface TargetDataStore
updateDescriptor
- XLA update descriptor. This can be extracted from JMS/XLA TimesTenMapMessage.jakarta.jms.JMSException
- If there are database errors or schema mismatch, this exception will be thrown.TargetDataStore.setAutoCommitFlag(boolean)
,
TargetDataStore.setUpdateConflictCheckFlag(boolean)
public boolean getAutoCommitFlag()
TargetDataStore
getAutoCommitFlag
in interface TargetDataStore
public boolean getUpdateConflictCheckFlag()
TargetDataStore
getUpdateConflictCheckFlag
in interface TargetDataStore
public void setAutoCommitFlag(boolean flag)
TargetDataStore
setAutoCommitFlag
in interface TargetDataStore
flag
- If set to true, apply will commit if TT_UPDCOMMIT is set or record type is COMMITONLY.TargetDataStore.apply(byte[])
,
TargetDataStore.commit()
,
TargetDataStore.rollback()
public void setUpdateConflictCheckFlag(boolean flag)
TargetDataStore
setUpdateConflictCheckFlag
in interface TargetDataStore
flag
- If set to true, update conflicts will be checked during apply.TargetDataStore.apply(byte[])
,
TargetDataStore.apply(byte[], boolean)
public boolean isClosed()
TargetDataStore
isClosed
in interface TargetDataStore