-
Notifications
You must be signed in to change notification settings - Fork 37
PhpOrient Protocols Binary Transaction TxCommit
TX_COMMIT_OP
Commits a transaction. This operation flushes all the pending changes to the server side.
Request: (tx-id:int)(using-tx-log:byte)(tx-entry)*(0-byte indicating end-of-records)
tx-entry: (operation-type:byte)(cluster-id:short)(cluster-position:long)(record-type:byte)(entry-content)
entry-content for CREATE: (record-content:bytes)
entry-content for UPDATE: (version:record-version)(content-changed:boolean)(record-content:bytes)
entry-content for DELETE: (version:record-version)
Response: (created-record-count:int)[(client-specified-cluster-id:short)(client-specified-cluster-position:long)(created-cluster-id:short)(created-cluster-position:long)]*(updated-record-count:int)[(updated-cluster-id:short)(updated-cluster-position:long)(new-record-version:int)]*(count-of-collection-changes:int)[(uuid-most-sig-bits:long)(uuid-least-sig-bits:long)(updated-file-id:long)(updated-page-index:long)(updated-page-offset:int)]*
Where:
- tx-id is the Transaction's Id
- use-tx-log tells if the server must use the Transaction Log to recover the transaction. 1 = true, 0 = false
- operation-type can be:
- 1, for UPDATES
- 2, for DELETES
- 3, for CREATIONS
- record-content depends on the operation type:
- For UPDATED (1): (original-record-version:int)(record-content:bytes)
- For DELETED (2): (original-record-version:int)
- For CREATED (3): (record-content:bytes)
This response contains two parts: a map of 'temporary' client-generated record ids to 'real' server-provided record ids for each CREATED record, and a map of UPDATED record ids to update record-versions.
Look at Optimistic Transaction to know how temporary RecordIDs are managed.
The last part or response is referred to RidBag management. Take a look at the main page for more details.
- Class name: TxCommit
- Namespace: PhpOrient\Protocols\Binary\Transaction
- Parent class: PhpOrient\Protocols\Binary\Abstracts\Operation
protected integer $opCode
- Visibility: protected
protected integer $_txId = -1
Transaction Id
- Visibility: protected
protected array $_operation_stack = array()
List of operation to execute
- Visibility: protected
protected array $_pre_operation_records = array()
Records backup before the transaction execution
- Visibility: protected
protected array $_operation_records = array()
Records after the transaction
- Visibility: protected
protected integer $_temp_cluster_position_seq = -2
When a record is created in transaction it's position is negative
- Visibility: protected
protected \PhpOrient\Protocols\Binary\OrientSocket $_socket
- Visibility: protected
protected array $_writeStack = array()
Stack of elements to compile
- Visibility: protected
protected string $_input_buffer
- Visibility: protected
protected string $_output_buffer
- Visibility: protected
protected \PhpOrient\Protocols\Binary\SocketTransport $_transport
- Visibility: protected
public \Closure $_callback
- Visibility: public
mixed PhpOrient\Protocols\Binary\Abstracts\Operation::_write()
- Visibility: protected
- This method is abstract.
- This method is defined by PhpOrient\Protocols\Binary\Abstracts\Operation
mixed PhpOrient\Protocols\Binary\Abstracts\Operation::_read()
- Visibility: protected
- This method is abstract.
- This method is defined by PhpOrient\Protocols\Binary\Abstracts\Operation
integer PhpOrient\Protocols\Binary\Transaction\TxCommit::_getTransactionId()
- Visibility: protected
\PhpOrient\Protocols\Binary\Transaction\TxCommit PhpOrient\Protocols\Binary\Transaction\TxCommit::begin()
- Visibility: public
mixed PhpOrient\Protocols\Binary\Transaction\TxCommit::commit()
- Visibility: public
mixed PhpOrient\Protocols\Binary\Transaction\TxCommit::rollback()
- Visibility: public
mixed PhpOrient\Protocols\Binary\Transaction\TxCommit::attach(\PhpOrient\Protocols\Binary\Abstracts\Operation $operation)
- Visibility: public
null|void PhpOrient\Protocols\Binary\Abstracts\Operation::_checkConditions(\PhpOrient\Protocols\Binary\SocketTransport $transport)
- Visibility: protected
- This method is defined by PhpOrient\Protocols\Binary\Abstracts\Operation
- $transport PhpOrient\Protocols\Binary\SocketTransport
mixed PhpOrient\Protocols\Binary\Abstracts\Operation::__construct(\PhpOrient\Protocols\Binary\SocketTransport $_transport)
- Visibility: public
- This method is defined by PhpOrient\Protocols\Binary\Abstracts\Operation
- $_transport PhpOrient\Protocols\Binary\SocketTransport
mixed PhpOrient\Protocols\Binary\Abstracts\Operation::_writeHeader()
- Visibility: protected
- This method is defined by PhpOrient\Protocols\Binary\Abstracts\Operation
mixed PhpOrient\Protocols\Binary\Abstracts\Operation::_readHeader()
- Visibility: protected
- This method is defined by PhpOrient\Protocols\Binary\Abstracts\Operation
\PhpOrient\Protocols\Binary\Abstracts\Operation PhpOrient\Protocols\Binary\Abstracts\Operation::prepare()
- Visibility: public
- This method is defined by PhpOrient\Protocols\Binary\Abstracts\Operation
\PhpOrient\Protocols\Binary\Abstracts\Operation PhpOrient\Protocols\Binary\Abstracts\Operation::send()
- Visibility: public
- This method is defined by PhpOrient\Protocols\Binary\Abstracts\Operation
mixed PhpOrient\Protocols\Binary\Abstracts\Operation::_dump_streams()
- Visibility: protected
- This method is defined by PhpOrient\Protocols\Binary\Abstracts\Operation
mixed PhpOrient\Protocols\Binary\Abstracts\Operation::getResponse()
- Visibility: public
- This method is defined by PhpOrient\Protocols\Binary\Abstracts\Operation
mixed PhpOrient\Protocols\Binary\Abstracts\Operation::_writeByte(integer $value)
- Visibility: protected
- This method is defined by PhpOrient\Protocols\Binary\Abstracts\Operation
- $value integer
integer PhpOrient\Protocols\Binary\Abstracts\Operation::_readByte()
- Visibility: protected
- This method is defined by PhpOrient\Protocols\Binary\Abstracts\Operation
mixed PhpOrient\Protocols\Binary\Abstracts\Operation::_writeChar(string $value)
- Visibility: protected
- This method is defined by PhpOrient\Protocols\Binary\Abstracts\Operation
- $value string
integer PhpOrient\Protocols\Binary\Abstracts\Operation::_readChar()
- Visibility: protected
- This method is defined by PhpOrient\Protocols\Binary\Abstracts\Operation
mixed PhpOrient\Protocols\Binary\Abstracts\Operation::_writeBoolean(boolean $value)
- Visibility: protected
- This method is defined by PhpOrient\Protocols\Binary\Abstracts\Operation
- $value boolean
boolean PhpOrient\Protocols\Binary\Abstracts\Operation::_readBoolean()
- Visibility: protected
- This method is defined by PhpOrient\Protocols\Binary\Abstracts\Operation
mixed PhpOrient\Protocols\Binary\Abstracts\Operation::_writeShort(integer $value)
- Visibility: protected
- This method is defined by PhpOrient\Protocols\Binary\Abstracts\Operation
- $value integer
integer PhpOrient\Protocols\Binary\Abstracts\Operation::_readShort()
- Visibility: protected
- This method is defined by PhpOrient\Protocols\Binary\Abstracts\Operation
mixed PhpOrient\Protocols\Binary\Abstracts\Operation::_writeInt(integer $value)
- Visibility: protected
- This method is defined by PhpOrient\Protocols\Binary\Abstracts\Operation
- $value integer
integer PhpOrient\Protocols\Binary\Abstracts\Operation::_readInt()
- Visibility: protected
- This method is defined by PhpOrient\Protocols\Binary\Abstracts\Operation
mixed PhpOrient\Protocols\Binary\Abstracts\Operation::_writeLong(integer $value)
- Visibility: protected
- This method is defined by PhpOrient\Protocols\Binary\Abstracts\Operation
- $value integer
integer PhpOrient\Protocols\Binary\Abstracts\Operation::_readLong()
- Visibility: protected
- This method is defined by PhpOrient\Protocols\Binary\Abstracts\Operation
mixed PhpOrient\Protocols\Binary\Abstracts\Operation::_writeString(string $value)
- Visibility: protected
- This method is defined by PhpOrient\Protocols\Binary\Abstracts\Operation
- $value string
string|null PhpOrient\Protocols\Binary\Abstracts\Operation::_readString()
- Visibility: protected
- This method is defined by PhpOrient\Protocols\Binary\Abstracts\Operation
mixed PhpOrient\Protocols\Binary\Abstracts\Operation::_writeBytes(string $value)
- Visibility: protected
- This method is defined by PhpOrient\Protocols\Binary\Abstracts\Operation
- $value string
string|null PhpOrient\Protocols\Binary\Abstracts\Operation::_readBytes()
- Visibility: protected
- This method is defined by PhpOrient\Protocols\Binary\Abstracts\Operation
\PhpOrient\Exceptions\PhpOrientException PhpOrient\Protocols\Binary\Abstracts\Operation::_readError()
- Visibility: protected
- This method is defined by PhpOrient\Protocols\Binary\Abstracts\Operation
mixed PhpOrient\Protocols\Binary\Abstracts\Operation::_readSerialized()
- Visibility: protected
- This method is defined by PhpOrient\Protocols\Binary\Abstracts\Operation
array PhpOrient\Protocols\Binary\Abstracts\Operation::_readRecord()
record with its content.
In case of null record then -2 as short is passed.
In case of RID -3 is passes as short and then the RID: (-3:short)(cluster-id:short)(cluster-position:long).
In case of record: (0:short)(record-type:byte)(cluster-id:short) (cluster-position:long)(record-version:int)(record-content:bytes)
- Visibility: protected
- This method is defined by PhpOrient\Protocols\Binary\Abstracts\Operation
array<mixed,\PhpOrient\Protocols\Binary\Data\Record> PhpOrient\Protocols\Binary\Abstracts\Operation::_read_prefetch_record()
- Visibility: protected
- This method is defined by PhpOrient\Protocols\Binary\Abstracts\Operation
array|null PhpOrient\Protocols\Binary\Abstracts\Operation::_read_sync()
- Visibility: public
- This method is defined by PhpOrient\Protocols\Binary\Abstracts\Operation
\PhpOrient\Protocols\Common\ConfigurableInterface PhpOrient\Protocols\Common\ConfigurableInterface::configure(array $options)
- Visibility: public
- This method is defined by PhpOrient\Protocols\Common\ConfigurableInterface
- $options array
The options for the object.
static PhpOrient\Protocols\Binary\Abstracts\Operation::fromConfig(array $options)
- Visibility: public
- This method is static.
- This method is defined by PhpOrient\Protocols\Binary\Abstracts\Operation
- $options array
The options for the newly created class instance.