GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
KSQL_TRANS_OPEN(3) FreeBSD Library Functions Manual KSQL_TRANS_OPEN(3)

ksql_trans_exclopen, ksql_trans_open, ksql_trans_singleopen
open a database transaction

library “ksql”

#include <sys/types.h>
#include <stdint.h>
#include <ksql.h>

enum ksqlc
ksql_trans_exclopen(struct ksql *sql, size_t id);

enum ksqlc
ksql_trans_open(struct ksql *sql, size_t id);

enum ksqlc
ksql_trans_singleopen(struct ksql *sql, size_t id);

The ksql_trans_exclopen(), ksql_trans_open(), and ksql_trans_singleopen() functions open transactions with different lock states. All functions accept sql, the database connection; and id, an identifier used in error reporting and in making sure that transaction calls are symmetric. Each of these functions must be followed by ksql_trans_commit(3) or ksql_trans_rollback(3).

If ksql_trans_open() is used (a “DEFERRED” transaction, in SQLite terms), the database is locked only when the first database operation is invoked. The lock is read-shared (multiple readers, no writers) for a read operation and is upgraded to write-single (multiple readers, single writer) on a write.

If ksql_trans_singleopen() is used (“IMMEDIATE”), the database is immediately locked in write-single mode.

If ksql_trans_exclopen() (“EXCLUSIVE”), the database is opened in a write-exclusive lock, where only the calling process may write or read from the database.

Recursive transactions are disallowed.

This returns KSQL_NOTOPEN if the database connection is not open, KSQL_TRANS if a transaction is already open, KSQL_DB if errors occurred on the database, or KSQL_OK on success.

sqlite3_exec(3)
April 3, 2018 FreeBSD 13.1-RELEASE

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.