Starting transactions

The start-transaction task begins a Read or Write transaction. Explictly starting and committing transactions is useful if you want to group multiple operations within a single transaction.

If you choose not to use transactions, all read and write operations are performed in auto-commit mode.

The syntax for this task is:
recordstore-cmd start-transaction -a RecordStoreInstanceName -t Type
[-h HostName] [-l true|false] [-p PortNumber] 
where:
  • -a (or --instanceName) specifies the name of a Record Store instance. Required.
  • -h (or --host) specifies the host where the Endeca CAS Service is running. If the flag is omitted, the default is the value of the com.endeca.itl.cas.server.host property in commandline.properties. If the property is not set, the value then defaults to localhost. Optional.
  • -l (or --isPortSsl) specifies whether to communicate with the service using an HTTPS connection. A value of true uses HTTPS and treats the com.endeca.itl.cas.server.port property as an SSL port. A value of false uses HTTP and treats com.endeca.itl.cas.server.port as a non-SSL port. Specify false if you enabled redirects from a non-SSL port to an SSL port. Optional.
  • -p (or --port) specifies the port of the Endeca CAS Service. If the flag is omitted, the default is the value of the com.endeca.itl.cas.server.port property in commandline.properties. If the property is not set, the value then defaults to 8500. Optional.
  • -t (or --transactionType) specifies the type of transaction to be performed: READ (which supports only Read operations) or READ_WRITE (which supports both Read and Write operations). Note that the transaction-type arguments are case sensitive. Required.
Note: A java.lang.IllegalArgumentException is thrown if the -t argument is invalid (such as using lower case).

Example of starting a transaction

This example starts a Read transaction:
recordstore-cmd start-transaction -a RS1 -t READ
If the command is successful, it prints a message similar to this example:
Started transaction: 15