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 -aRecordStoreInstanceName
-t Type [-h HostName] [-l true|false] [-pPortNumber
]
where:
-a
(or--instanceName
) specifies the name of a Record Store instance. Required.-h
(or--host
) specifies the host where the CAS Service is running. If the flag is omitted, the default is the value of thecom.endeca.itl.cas.server.host
property incommandline.properties
. If the property is not set, the value then defaults tolocalhost
. Optional.-l
(or--isPortSsl
) specifies whether to communicate with the service using an HTTPS connection. A value oftrue
uses HTTPS and treats thecom.endeca.itl.cas.server.port
property as an SSL port. A value offalse
uses HTTP and treatscom.endeca.itl.cas.server.port
as a non-SSL port. Specifyfalse
if you enabled redirects from a non-SSL port to an SSL port. Optional.-p
(or--port
) specifies the port of the CAS Service. If the flag is omitted, the default is the value of thecom.endeca.itl.cas.server.port
property incommandline.properties
. If the property is not set, the value then defaults to8500
. Optional.-t
(or--transactionType
) specifies the type of transaction to be performed:READ
(which supports only Read operations) orREAD_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 40. 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