You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
userdata pg_begin_tx(userdata connection)
Execute query CREATE TRANSACTION, set it status 'open' and save into local transactions storage.
userdata pg_rollback_tx(userdata transaction)
Get transaction from storage. If transaction is open and valid, rollback it with ROLLBACK and set 'rollbacked' status.
Abort transaction when has no instances in storage
userdata pg_commit_tx(userdata transaction)
Get transaction from storage and commit it with COMMIT if opened and set 'commited' status.
Abort transaction when has no instances in storage
Client database transactions control implementation may prevent problems with concurrent execution and add more performance features (for instance, execute whole transaction in one query)
The text was updated successfully, but these errors were encountered:
SevDan
changed the title
High level transactions
Clientside transactions
Jan 9, 2021
Maybe should implement easier API (adopted for single thread applications) bool pg_tx_begin(userdata connection)
Creates new transaction only if has no opened other yet
bool pg_tx_commit(userdata connection)
Commit current transaction
bool pg_tx_rollback(userdata connection)
Rollback current transaction
So, API supports operations only one transaction per connection (without subtransactions)
SevDan
added a commit
to SevDan/ml_pgsql
that referenced
this issue
Jan 10, 2021
There is good way to implement user transactions
Example API:
userdata pg_begin_tx(userdata connection)
Execute query
CREATE TRANSACTION
, set it status 'open' and save into local transactions storage.userdata pg_rollback_tx(userdata transaction)
Get transaction from storage. If transaction is open and valid, rollback it with
ROLLBACK
and set 'rollbacked' status.Abort transaction when has no instances in storage
userdata pg_commit_tx(userdata transaction)
Get transaction from storage and commit it with
COMMIT
if opened and set 'commited' status.Abort transaction when has no instances in storage
Client database transactions control implementation may prevent problems with concurrent execution and add more performance features (for instance, execute whole transaction in one query)
The text was updated successfully, but these errors were encountered: