PHP Класс PhpOrient\Protocols\Binary\Transaction\TxCommit

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.
Наследование: extends PhpOrient\Protocols\Binary\Abstracts\Operation, use trait PhpOrient\Protocols\Binary\Abstracts\NeedDBOpenedTrait
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$_operation_records array Records after the transaction
$_operation_stack array List of operation to execute
$_pre_operation_records array Records backup before the transaction execution
$_temp_cluster_position_seq integer When a record is created in transaction it's position is negative
$_txId integer Transaction Id
$opCode The op code.

Открытые методы

Метод Описание
attach ( Operation $operation )
begin ( ) Starts a transaction by initializing params
commit ( )
rollback ( )

Защищенные методы

Метод Описание
_getTransactionId ( ) : integer
_read ( ) : mixed Read the response from the socket.
_write ( ) Write the data to the socket.

Описание методов

_getTransactionId() защищенный Метод

protected _getTransactionId ( ) : integer
Результат integer

_read() защищенный Метод

Read the response from the socket.
protected _read ( ) : mixed
Результат mixed the response.

_write() защищенный Метод

Write the data to the socket.
protected _write ( )

attach() публичный Метод

public attach ( Operation $operation )
$operation PhpOrient\Protocols\Binary\Abstracts\Operation

begin() публичный Метод

Starts a transaction by initializing params
public begin ( )

commit() публичный Метод

public commit ( )

rollback() публичный Метод

public rollback ( )

Описание свойств

$_operation_records защищенное свойство

Records after the transaction
protected array $_operation_records
Результат array

$_operation_stack защищенное свойство

List of operation to execute
protected array $_operation_stack
Результат array

$_pre_operation_records защищенное свойство

Records backup before the transaction execution
protected array $_pre_operation_records
Результат array

$_temp_cluster_position_seq защищенное свойство

When a record is created in transaction it's position is negative
protected int $_temp_cluster_position_seq
Результат integer

$_txId защищенное свойство

Transaction Id
protected int $_txId
Результат integer

$opCode защищенное свойство

The op code.
protected $opCode