Lines Matching refs:transaction

655 ** ^If an [sqlite3] object is destroyed while a transaction is open,
656 ** the transaction is automatically rolled back.
1196 ** current transaction. This hint is not guaranteed to be accurate but it
1249 ** and sent to the VFS after a transaction has been committed immediately
1276 ** files used for transaction control
1300 ** a write transaction to indicate that, unless it is rolled back for some
1302 ** transaction. This is used by VACUUM operations.
1499 ** transaction open on the database or not. It is only available on unix.The
1503 ** currently has an SQL transaction open on the database. It is set to 0 if
1513 ** If there is currently no transaction open on the database, and the
1516 ** transaction, or if the db is a temp-db, this opcode is a no-op, not an error.
2882 ** part of committing a transaction (e.g. to flush data accumulated in memory
3055 ** that is inside an explicit transaction, then the entire transaction
4812 ** statements that are holding a transaction open.
5260 ** or occurs outside of an explicit transaction, then you can retry the
5262 ** explicit transaction then you should rollback the transaction before
6897 ** transaction (errors including [SQLITE_FULL], [SQLITE_IOERR],
6899 ** transaction might be rolled back automatically. The only way to
6900 ** find out whether SQLite automatically rolled back the transaction after
6987 ** CAPI3REF: Determine the transaction state of a database
6991 ** [transaction state] of schema S in database connection D. ^If S is NULL,
6992 ** then the highest transaction state of any schema on database connection D
7006 ** KEYWORDS: {transaction state}
7008 ** These constants define the current transaction state of a database file.
7010 ** constants in order to describe the transaction state of schema S
7015 ** <dd>The SQLITE_TXN_NONE state means that no transaction is currently
7020 ** in a read transaction. Content has been read from the database file
7021 ** but nothing in the database file has changed. The transaction state
7023 ** no other conflicting concurrent write transactions. The transaction
7029 ** in a write transaction. Content has been written to the database file
7030 ** but has not yet committed. The transaction state will change to
7058 ** function to be invoked whenever a transaction is [COMMIT | committed].
7062 ** function to be invoked whenever a transaction is [ROLLBACK | rolled back].
7092 ** ^For the purposes of this API, a transaction is said to have been
7095 ** ^The rollback callback is not invoked if a transaction is
7119 ** modified as part of a transaction commit, then the autovacuum pages
8085 ** commit if the transaction continues to completion.)^
8148 ** blob handles or active write statements, the current transaction is
8149 ** committed. ^If an error occurs while committing the transaction, an error
8150 ** code is returned and the transaction rolled back.
9078 ** transaction rollback or database recovery operations are not included.
9086 ** been written to disk in the middle of a transaction due to the page
9088 ** to disk all at once. When pages spill mid-transaction, that introduces
9465 ** ^SQLite holds a write transaction open on the destination database file
9501 ** there is already a read or read-write transaction open on the
9581 ** active write-transaction on the destination database is rolled back.
9669 ** its current transaction, either by committing it or rolling it back.
9678 ** when the blocking connections current transaction is concluded. ^The
9680 ** call that concludes the blocking connection's transaction.
9684 ** concluded its transaction by the time sqlite3_unlock_notify() is invoked.
9718 ** When a blocking connection's transaction is concluded, there may be
9733 ** connection Y's transaction to be concluded, and similarly connection
9734 ** Y is waiting on connection X's transaction, then neither connection
9742 ** callback on the conclusion of connection B's transaction, and connection
9744 ** A's transaction is concluded. ^Indirect deadlock is also detected, so
9747 ** C's transaction, where connection C is waiting on connection A. ^Any
9897 ** after committing a transaction if there are N or
10103 ** is able to roll back a statement or database transaction, and abandon
10142 ** instruct the query planner to begin at least a read transaction on
10642 ** CAPI3REF: Flush caches to disk mid-transaction
10645 ** ^If a write-transaction is open on [database connection] D when the
10814 ** transaction, that connection sees an unchanging copy of the database
10815 ** as it existed for the point in time when the transaction first started.
10817 ** by the reader until a new read transaction is started.
10821 ** transaction that sees that historical version of the database rather than
10837 ** If there is not already a read-transaction open on schema S when
10850 ** <li> There must not be a write transaction open on schema S of database
10856 ** file immediately after it is first opened. At least one transaction
10862 ** whether or not a read transaction is opened on schema S is undefined.
10878 ** CAPI3REF: Start a read transaction on an historical snapshot
10882 ** transaction or upgrades an existing one for schema S of
10883 ** [database connection] D such that the read transaction refers to
10890 ** is already a read transaction open on schema S, then the database handle
10900 ** If there is already a read transaction open when this function is
10901 ** invoked, then the same read transaction remains open (on the same
10905 ** read transaction is undefined. If SQLITE_OK is returned, then the
10906 ** read transaction is now open on database snapshot P.
10978 ** will only be able to open the last transaction added to the WAL file
10984 ** transaction open on the database, or if the database is not a WAL mode
11082 ** database is currently in a read transaction or is involved in a backup
12537 ** All changes made by these functions are enclosed in a savepoint transaction.
12539 ** write to the target database) occurs, then the savepoint transaction is
12606 ** caller has an open transaction or savepoint when apply_v2() is called,
13905 ** the aborted transaction. This could lead to database corruption.
17753 int nSavepoint; /* Number of non-transaction savepoints */
17755 i64 nDeferredCons; /* Net deferred constraints this transaction. */
18342 ** transaction, these accesses need to be made via the same database
18568 ** causes the operation in process to fail and for the current transaction
18571 ** but the transaction is not rolled back. FAIL processing means that
18597 #define OE_Rollback 1 /* Fail the operation and rollback the transaction */
18598 #define OE_Abort 2 /* Back out changes but do no rollback transaction */
19824 yDbMask writeMask; /* Start a write transaction on these databases */
26176 ** transaction has been committed. Injecting a fault at this point
26178 ** but the transaction is committed anyway.
38651 ** transaction counter in bytes 24-27 of database files are updated
38653 ** occur if a file is updated without also updating the transaction
38657 unsigned char transCntrChng; /* True if the transaction counter changed */
39073 ** transaction crashes and leaves behind hot journals, then any
40263 /* Set up the transaction-counter change checking flags when
40341 ** transaction counter was updated if any part of the database
40342 ** file changed. If the transaction counter is not updated,
41534 ** transaction counter was updated if any part of the database
41535 ** file changed. If the transaction counter is not updated,
41885 ** has changed. If the transaction counter is modified, record that
41897 pFile->transCntrChng = 1; /* The transaction counter has changed */
42126 ** the directory entry for the journal was never created) and the transaction
42459 ** it hence it is OK for the transaction change counter to be
43448 ** may be a normal SQL client upgrading to a write transaction. In this
53820 ** journalled during a transaction, or which pages have the "dont-write"
53838 ** start of a transaction, and is thus usually less than a few thousand,
54251 ** page to eject from the cache mid-transaction. It is better to eject
56990 /* Macros for extracting appropriate sync flags for either transaction
57034 ** snapshot is like a read-transaction. It is the state of the database
57038 ** transaction and releases the lock.
57149 ** the transaction has been written into the rollback journal and
57152 ** (b) The page was a freelist leaf page at the start of the transaction.
57155 ** the database file at the start of the transaction.
57163 ** transaction other than the update of the transaction sequence
57169 ** transaction.
57193 ** equivalent to the database file at the beginning of the transaction.
57195 ** (8) When a transaction is rolled back, the xTruncate method of the VFS
57197 ** the beginning of the transaction. (In some VFSes, the xTruncate
57210 ** of every transaction.
57286 ** * No read or write transaction is active.
57294 ** was) in exclusive-locking mode, a user-level read transaction is
57298 ** it opens a read-transaction on the database and returns to state
57299 ** OPEN after the read-transaction is completed. However a connection
57301 ** this state even after the read-transaction is closed. The only way
57305 ** * A read transaction may be active (but a write-transaction cannot).
57308 ** transaction is not active). The dbOrigSize and dbFileSize variables
57311 ** * Even if a read-transaction is not open, it is guaranteed that
57316 ** The pager moves to this state from READER when a write-transaction
57318 ** required to start a write-transaction are held, but no actual
57321 ** In rollback mode, a RESERVED or (if the transaction was opened with
57324 ** to in this state. If the transaction is committed or rolled back while
57332 ** * A write transaction is active.
57335 ** * If the connection is open in WAL-mode, a WAL write transaction
57350 ** * A write transaction is active.
57363 ** * A write transaction is active.
57375 ** state after the entire transaction has been successfully written into the
57376 ** database file. In this state the transaction may be committed simply
57379 ** layer must either commit or rollback the transaction.
57381 ** * A write transaction is active.
57385 ** commit the transaction. If an error did occur, the caller will need
57386 ** to rollback the transaction.
57413 ** when a read-transaction is next opened on the pager (transitioning
57434 ** statement executed within a transaction. In this case, if the error
57500 ** transaction in another process, causing SQLite to read from the database
57528 ** savepoint and statement transaction in the system. All such structures
57592 ** relinquished on the database file. Each time a transaction is committed,
57594 ** updating the change-counter is omitted for the current transaction.
57597 ** need only update the change-counter once, for the first transaction
57602 ** When PagerCommitPhaseOne() is called to commit a transaction, it may
57607 ** the way in which the journal file is finalized after the transaction is
57618 ** subsequently interrupted transaction that reuses the journal file.
57652 ** write-transaction is opened.
57669 ** During a write-transaction, if pages with page-numbers greater than
57676 ** variable at the start of the transaction. It is used during rollback,
57680 ** Throughout a write-transaction, dbFileSize contains the size of
57682 ** write-transaction is first opened, and updated when VFS calls are made
57686 ** unnecessary calls to xTruncate() after committing a transaction. If,
57687 ** when a transaction is committed, the dbFileSize variable indicates
57691 ** dbFileSize is not used when rolling back a transaction. In this case
57702 ** write-transaction is opened (at the same time as dbFileSize and
57720 ** lower two bits, and sync flags used for transaction commits in the WAL
57723 ** sync flags for transaction commit, use ((walSyncFlags>>2)&0x03). Note
57724 ** that with synchronous=NORMAL in WAL mode, transaction commit is not synced
57761 Pgno dbOrigSize; /* dbSize before the current transaction */
58037 ** a rollback transaction that switches from journal_mode=off
58480 ** within the current transaction (i.e. if Pager.journalOff==0).
58515 /* At this point the transaction is committed but the write lock
58613 ** written by the current transaction and rolled back into the database
58680 ** database before the transaction began, in pages. Also, pPager->cksumInit
58728 ** of the transaction. Return an error code if anything goes wrong.
58810 ** If zSuper is a NULL pointer (occurs for a single database transaction),
58947 ** as a hot-journal and rolled back the next time a read-transaction
59042 ** the contents of the pager-cache. If a transaction was active when
59066 ** The write transaction open on pPager is being committed (bCommit==1)
59089 ** This routine ends a transaction. A transaction is usually ended by
59093 ** database transaction.
59103 ** transaction. Nor will it be considered to be a hot-journal by this
59145 /* Do nothing if the pager does not have an open write transaction
59147 ** is no write-transaction active but a RESERVED or greater lock is
59155 ** read-transaction, this function is called with eState==PAGER_READER
59156 ** and eLock==EXCLUSIVE_LOCK when the read-transaction is closed.
59183 ** cause the last transaction to roll back. See
59245 /* This branch is taken when committing a transaction in rollback-journal
59247 ** At this point the journal has been finalized and the transaction
59275 ** Execute a rollback if a transaction is active and unlock the
59411 /* Either the state is greater than PAGER_WRITER_CACHEMOD (a transaction
59483 ** different from the page content at the start of the transaction.
59547 ** if the page is on the free-list at the start of the transaction, then
59604 ** file for a transaction involving two databases might be:
59734 ** file in the file-system. This only happens when committing a transaction,
59735 ** or rolling back a transaction (including rolling back a hot-journal).
59971 /* If nRec is 0 and this rollback is of a transaction created by this
60046 ** state prior to the start of the transaction, so invoke the
60048 ** assertion that the transaction counter was modified.
60056 ** before the transaction was committed, then the change-counter
60199 ** written into the log file when a WAL transaction is rolled back.
60228 /* Normally, if a transaction is rolled back, any backup processes are
60233 ** also copied into the backup databases) as part of this transaction,
60242 ** This function is called to rollback a transaction on a WAL database.
60297 /* If a WAL transaction is being committed, there is no point in writing
60336 ** Begin a read transaction on the WAL.
60351 ** transaction in locking_mode=EXCLUSIVE. So call it now. If we
60470 ** a ROLLBACK TO command is invoked on a SAVEPOINT that is a transaction
60473 ** When pSavepoint is not NULL (meaning a non-transaction savepoint is
60500 ** (or transaction). No page with a page-number greater than this value
61003 ** This function may only be called when a read-transaction is open on
61062 ** the database file. If a savepoint transaction were rolled back after
61094 ** truncation will be done when the current transaction is committed.
61096 ** This function is only called right before committing a transaction.
61097 ** Once this function has been called, the transaction must either be
61111 ** called right before committing a transaction. So although the
61248 ** If a transaction was in progress when this routine is called, that
61249 ** transaction is rolled back. All outstanding pages are invalidated
61254 ** This function always succeeds. If a transaction is active an attempt
61391 ** previous connection's transaction), and a crash or power-failure
61394 ** transaction), then SQLite may become confused when doing the
62253 ** transaction that populates a new database is being rolled back.
62396 ** and possibly used for a transaction later on. Also, write-access
62545 ** transaction and unlock the pager.
62732 ** page 1 if there is no write-transaction open or the ACQUIRE_READONLY
62890 ** This function is called at the start of every write transaction.
62897 ** opened to write a rollback log for a transaction. It is not used
62986 ** Begin a write-transaction on the specified pager object. If a
62987 ** write-transaction has already been opened, this function is a no-op.
62995 ** within this transaction will be opened as an in-memory file. This
62997 ** running in exclusive mode) or if the transaction does not require a
63046 ** when it has an open transaction, but never to DBMOD or FINISHED.
63089 ** Otherwise, when the transaction is rolled back, the logic in
63132 /* This routine is not called unless a write-transaction has already
63146 ** obtained the necessary locks to begin the write-transaction, but the
63358 ** have been dirty at the start of the transaction. In that case, if
63361 ** current transaction is rolled back.
63389 ** transaction is committed.
63456 ** next time a read transaction is opened the cache will be
63493 ** This function may only be called while a write-transaction is active in
63523 ** super-journal (a single database transaction).
63533 ** The only thing that remains to commit the transaction is to finalize
63616 ** was enabled at compile time, and if this transaction meets the
63621 ** * This commit is not part of a multi-file transaction, and
63627 ** is not applicable to this transaction, call sqlite3JournalCreate()
63635 ** created for this transaction.
63740 ** image was extended as part of the current transaction and then the
63769 ** updated to reflect the changes made by the current transaction and
63772 ** be used as a hot-journal and the current transaction rolled back.
63776 ** for hot-journal rollback. Once this is done the transaction is
63798 ** this transaction, the pager is running in exclusive-mode and is
63823 ** If a write transaction is open, then all changes made within the
63824 ** transaction are reverted and the current write-transaction is closed.
63834 ** in-memory cache pages to the state they were in when the transaction
63844 ** current transaction are either expelled from the cache or reverted to
63845 ** their pre-transaction state by re-reading data from the database or
63846 ** WAL files. The WAL transaction is then closed.
64074 ** transaction is rolled back. This is different to calling
64076 ** the transaction or unlock the database, it just restores the
64139 ** if the VFS used by this pager includes ZipVFS, the entire transaction
64225 ** A transaction must be active when this routine is called. It used to be
64226 ** required that a statement transaction was not active, but this restriction
64228 ** transaction is active).
64231 ** moved as part of a database reorganization just before the transaction
64233 ** pPg refers to will not be written to again within this transaction.
64329 ** to exist, in case the transaction needs to roll back. Use pPgOld
64348 ** this transaction, it may be written to the database file before
64602 ** a transaction to initialize pWal. The PRAGMA table_list statement is
64824 ** read transaction is opened, attempt to read from the snapshot it
64855 ** The caller currently has a read transaction open on the database.
65021 ** To start a read transaction, the reader records the index of the last
65185 ** WALINDEX_MAX_VERSION, then no read-transaction is opened and SQLite
65235 u32 iChange; /* Counter incremented each transaction */
65430 u8 writeLock; /* True if in a write transaction */
65437 WalIndexHdr hdr; /* Wal-index header for current transaction */
65454 WalIndexHdr *pSnapshot; /* Start transaction here if not NULL */
66225 ** must have exited unexpectedly in the middle of a transaction (after
66227 ** Remove the remnants of that writers uncommitted transaction from
67643 ** Open a transaction in a connection where the shared-memory is read-only
67659 ** If this function returns SQLITE_OK, then the read transaction has
67664 ** the caller should retry opening the read transaction from the
67742 ** since this client's last read transaction. */
67772 /* Check to see if a complete transaction has been appended to the
67790 /* If nTruncate is non-zero, then a complete transaction has been
67848 ** Attempt to start a read transaction. This might fail due to a race or
67887 ** When the read transaction is completed, the caller must release the
68354 ** Begin a read transaction on the database.
68363 ** transaction, then *pChanged is set to 1 before returning. The
68377 ** Finish with a read transaction. All this does is release the
68406 /* This routine is only be called from within a read transaction. */
68428 ** current read transaction was opened. Values added after the
68429 ** read transaction was opened may have been written incorrectly -
68431 ** that any slots written before the current read transaction was
68443 ** table after the current read-transaction had started.
68555 ** This function starts a write transaction on the WAL.
68557 ** A read transaction must have already been started by a prior call
68561 ** the read transaction was started, then it is not possible for this
68563 ** returns SQLITE_BUSY in that case and no write transaction is started.
68572 ** read-transaction was even opened, making this call a no-op.
68580 /* Cannot start a write transaction without first holding a read
68581 ** transaction. */
68599 ** time the read transaction on this connection was started, then
68617 ** End a write transaction. The commit has already been done. This
68632 ** function moves the write-pointer back to the start of the transaction.
68635 ** to the WAL since the start of the transaction. If the callback returns
68666 ** page 1 is never written to the log until the transaction is
68706 /* This savepoint was opened immediately after the write-transaction
68759 ** to handle if this transaction is rolled back. */
68846 ** This function is called as part of committing a transaction within which
68848 ** all frames written to the wal file by the current transaction starting
68866 ** transaction restarted the wal file), these values must be read from the
68924 /* If this frame set completes a transaction, then nTruncate>0. If
68925 ** nTruncate==0 then this frame set does not complete the transaction. */
69008 ** the current transaction. If so, overwrite the existing frame and
69010 ** checksums must be recomputed when the transaction is committed. */
69045 /* If this is the end of a transaction, then we might need to pad
69046 ** the transaction and/or sync the WAL file.
69049 ** transaction and if PRAGMA synchronous=FULL. If synchronous==NORMAL
69080 /* If this frame set completes the first transaction in the WAL and
69405 /* Try to open on pSnapshot when the next read-transaction starts
69432 ** The caller currently has a read transaction open on the database.
69822 ** from this list when a transaction is committed or rolled back, or when
69881 ** of the Btree structure. At most one of these may open a write transaction,
69892 # error wrong numeric code for no-transaction
69895 # error wrong numeric code for read-transaction
69898 # error wrong numeric code for write-transaction
69929 ** 1) The current writer (BtShared.pWriter) concludes its transaction, OR
69933 ** transaction.
69963 Bitvec *pHasContent; /* Set of pages moved to free-list this transaction */
69968 Btree *pWriter; /* Btree with currently open write transaction */
70173 /* A bunch of assert() statements to check the transaction state variables
70882 ** transaction on this file. And, obviously, for this to be so there
70883 ** must be an open write transaction on the file itself.
71007 ** transaction. If it does not, then the BTS_PENDING flag
71041 ** transaction. If there currently exists a writer, and p is not
71181 ** transaction, a problem comes up. If the page is not journalled when
71192 ** at the end of every transaction.
71223 ** invoked at the conclusion of each write-transaction.
73010 ** the transaction, for each page restored this routine is called.
73473 /* Rollback any active transaction and free the handle structure.
73530 ** If the number of pages exceeds this limit during a write transaction,
74015 ** of a transaction but there is a read lock on the database, then
74019 ** If there is a transaction in progress, this routine is a no-op.
74092 ** Attempt to start a new transaction. A write-transaction
74094 ** transaction. If the second argument is 2 or more and exclusive
74095 ** transaction is started, meaning that no other process is allowed
74096 ** to access the database. A preexisting transaction may not be
74098 ** exclusivity flag only works for a new transaction.
74100 ** A write-transaction must be started before attempting any
74102 ** will work unless a transaction is started first:
74127 Btree *p, /* The btree in which to start the transaction */
74128 int wrflag, /* True to start a write transaction */
74138 /* If the btree is already in a write-transaction, or it
74139 ** is already in a read-transaction and a read-transaction
74162 /* If another database handle has already opened a write transaction
74163 ** on this shared-btree structure and a second write transaction is
74187 /* Any read-only or read-write transaction implies a read-lock on
74189 ** on page 1, the transaction cannot be opened. */
74199 /* If transitioning from no transaction directly to a write transaction,
74225 /* if there was no transaction opened when this function was
74272 ** re-read the database size from page 1 if a savepoint or transaction
74273 ** rollback occurs within the transaction.
74655 ** A write-transaction must be opened before calling this function.
74696 ** This routine is called prior to sqlite3PagerCommit when a transaction
74793 ** disk and we are still holding all locks, so the transaction has not
74797 ** This call is a no-op if no write-transaction is currently active on pBt.
74802 ** (single database transaction).
74808 ** the write-transaction for this database file is to delete the journal.
74835 ** at the conclusion of a transaction.
74847 ** handle, downgrade to a read-only transaction. The other statements
74852 /* If the handle had any kind of transaction open, decrement the
74853 ** transaction count of the shared btree. If the transaction count
74864 /* Set the current transaction state to TRANS_NONE and unlock the
74865 ** pager if this call closed the only read or write transaction. */
74874 ** Commit the transaction currently in progress.
74882 ** the rollback journal (which causes the transaction to commit) and
74888 ** is non-zero then this b-tree transaction is part of a multi-file
74889 ** transaction. In this case, the transaction has already been committed
74893 ** transaction has been closed. This is quite safe, as the pager will have
74905 /* If the handle has a write-transaction open, commit the shared-btrees
74906 ** transaction and set the shared state to TRANS_READ.
74956 ** tripped. In general, writeOnly is false if the transaction being
75009 ** Rollback the transaction in progress.
75068 ** back independently of the main transaction. You must start a transaction
75070 ** if the main transaction commits or rolls back.
75075 ** can be rolled back without having to rollback the entire transaction.
75077 ** A statement sub-transaction is implemented as an anonymous savepoint. The
75093 /* At the pager level, a statement transaction is a savepoint with
75096 ** such savepoints while the statement transaction savepoint is active.
75111 ** contents of the entire transaction are rolled back. This is different
75112 ** from a normal transaction rollback, as no locks are released and the
75113 ** transaction remains open.
75136 ** the transaction was started. Otherwise, it must be at least 1. */
75147 ** the caller already has at least a read-only transaction open
75149 ** the caller is assumed to have an open write transaction.
75167 ** 4: There must be an active transaction.
75210 /* Assert that the caller has opened the required transaction. */
77206 ** current transaction has already run one or more incremental-vacuum
80852 ** has a read or write transaction open on the database.
81552 ** A read-only or read-write transaction must be opened before calling
81747 ** to describe the current transaction state of Btree p.
81759 ** transaction on the shared-cache the argument Btree is connected to.
81899 ** (b) there is a read/write transaction open,
81982 ** If no transaction is active and the database is not a temp-db, clear
82037 int bDestLocked; /* True once a write-transaction is open on pDest */
82131 ** Check that there is no open read-transaction on the b-tree passed as the
82133 ** is an open read-transaction, return SQLITE_ERROR and leave an error
82207 ** error was hit. Or there is a transaction open on the destination
82349 /* If the source pager is currently in a write-transaction, return
82358 /* If there is no open read-transaction on the source database, open
82359 ** one now. If a transaction is opened here, then it will be closed
82546 /* Finish committing the transaction to the destination database. */
82555 /* If bCloseTrans is true, then this function opened a read transaction
82556 ** on the source database. Close the read transaction here. There is
82558 ** "committing" a read-only transaction cannot fail.
82611 /* If a transaction is still open on the Btree, roll it back. */
82683 ** has been modified by a transaction on the source pager. Copy
82723 ** Copy the complete content of pBtFrom into pBtTo. A transaction
82727 ** goes wrong, the transaction on pTo is rolled back. If successful, the
82728 ** transaction is committed before returning.
85587 ** throw an ABORT exception (causing the statement, but not entire transaction
87018 ** and reset(). Inserts are grouped into a transaction.
87724 ** A read or write transaction may or may not be active on database handle
87725 ** db. If a transaction is active, commit it. If there is a
87726 ** write-transaction spanning more than one database file, this routine
87731 int nTrans = 0; /* Number of databases with an active write-transaction
87745 ** virtual module tables written in this transaction. This has to
87748 ** to the transaction.
87755 ** one database file has an open write transaction, a super-journal
87800 ** TEMP database) has a transaction active. There is no need for the
87834 /* The complex case - There is a multi-file write-transaction active.
87835 ** This requires a super-journal file to ensure the transaction is
87887 /* Write the name of each database file in the transaction into the new
87924 /* Sync all the db files involved in the transaction. The same call
87947 /* Delete the super-journal file. This commits the transaction. After
87949 ** transaction files are deleted.
87962 ** transaction is already guaranteed, but some stray 'cold' journals
88016 ** If the Vdbe passed as the first argument opened a statement-transaction,
88019 ** transaction is rolled back. If eOp is SAVEPOINT_RELEASE, then the
88020 ** statement transaction is committed.
88062 /* If the statement transaction is being rolled back, also restore the
88064 ** the statement transaction was opened. */
88080 ** This function is called when a transaction opened by the database
88123 ** transaction will be committed or rolled back as a result of the
88134 ** state. We need to rollback the statement transaction, if there is
88135 ** one, or the complete transaction if there is no statement transaction.
88168 ** transaction must be rolled back to restore the database to a
88172 ** a statement or transaction rollback operation. If the error
88182 /* We are forced to roll back the active transaction. Before doing
88199 ** VM, then we do either a commit or rollback of the current transaction.
88222 ** key constraints to hold up the transaction. This means a commit
88260 /* If eStatementOp is non-zero, then a statement transaction needs to
88281 /* If this was an INSERT, UPDATE or DELETE and no statement transaction
91095 ** This function is called after a transaction has been committed. It
93746 ** the number of non-transaction savepoints currently in the
94336 ** whether or not to rollback the current transaction. Do not rollback
94339 ** VDBE, but do not rollback the transaction.
96860 ** transaction, then there cannot be any savepoints.
96879 /* This call is Ok even if this savepoint is actually a transaction
96881 ** If this is a transaction savepoint being opened, it is guaranteed
96895 /* If there is no open transaction, then mark this as a special
96896 ** "transaction savepoint". */
96936 /* Determine whether or not this is a transaction savepoint. If so,
96937 ** and this is a RELEASE command, then the current transaction
97056 sqlite3VdbeError(p, "cannot commit transaction - "
97080 (!desiredAutoCommit)?"cannot start a transaction within a transaction":(
97081 (iRollback)?"cannot rollback - no transaction is active":
97082 "cannot commit - no transaction is active"));
97092 ** Begin a transaction on database P1 if a transaction is not already
97094 ** If P2 is non-zero, then a write-transaction is started, or if a
97095 ** read-transaction is already active, it is upgraded to a write-transaction.
97096 ** If P2 is zero, then a read-transaction is started. If P2 is 2 or more
97097 ** then an exclusive transaction is started.
97099 ** P1 is the index of the database file on which the transaction is
97104 ** If a write-transaction is started and the Vdbe.usesStmtJournal flag is
97106 ** throw an ABORT exception), a statement transaction may also be opened.
97107 ** More specifically, a statement transaction is opened iff the database
97109 ** active statements. A statement transaction allows the changes made by this
97111 ** entire transaction. If no error is encountered, the statement transaction
97142 ** transaction */
97180 ** counter. If the statement transaction needs to be rolled back,
97234 ** There must be a read-lock on the database (either a transaction
97265 ** A transaction must be started before executing this opcode.
101021 "cannot change %s wal mode from within a transaction",
101043 /* Open a transaction on the database file. Regardless of the journal
101044 ** mode, this transaction always uses a rollback journal.
102533 ** vdbe program will take advantage of the various transaction,
102543 ** transaction.
106230 ** journal file may be written as part of committing the transaction. */
116337 /* Begin a transaction for database iDb. Then modify the schema cookie
121568 ** transaction on each used database and to verify the schema cookie
126642 ** This routine starts a new transaction if we are not already within
126643 ** a transaction. If we are already within a transaction, then a checkpoint
126647 ** rollback the whole transaction. For operations where all constraints
126674 ** sure that the statement is protected by a statement transaction.
126694 ** and/or current transaction is rolled back.
131426 ** statement transaction rolled back. If a
131429 ** transaction before fixing the constraint violation, the attempt fails.
131433 ** database transaction is opened. Each time a statement is executed
131436 ** the database, the counter is decremented. When the transaction is
131445 ** transaction is opened, this may cause the mechanism to malfunction.
131492 ** and the statement transaction is rolled back. An exception is an INSERT
131496 ** an INSERT does not open a statement transaction.
131847 ** generated for will not open a statement transaction. */
132168 ** the statement transaction will not be rolled back even if FK
134726 ** any ROLLBACK The current transaction is rolled back and
134737 ** transaction is not rolled back and any
138881 "from within a transaction");
139837 "Safety level may not be changed inside a transaction");
141276 ** transaction for efficiency */
141761 0, /* xBegin - begin transaction */
141762 0, /* xSync - sync transaction */
141763 0, /* xCommit - commit transaction */
141764 0, /* xRollback - rollback transaction */
142050 /* If there is not already a read-only (or read-write) transaction opened
142051 ** on the b-tree database, open one now. If a transaction is opened, it
142301 int openedTransaction = 0; /* True if a transaction is opened */
142305 /* If there is not already a read-only (or read-write) transaction opened
142306 ** on the b-tree database, open one now. If a transaction is opened, it
142328 /* Close the transaction, if one was opened. */
155134 sqlite3SetString(pzErrMsg, db, "cannot VACUUM from within a transaction");
155175 ** (possibly synchronous) transaction opened on the main database before
155215 /* Begin a transaction and take an exclusive lock on the main database
155293 /* At this point, there is a write transaction open on both the
155296 ** transaction by sqlite3BtreeCopyFile() and the other by an explicit
155358 /* Currently there is an SQL level transaction open on the vacuum
155360 ** was committed at the btree level). So it safe to end the transaction
156414 ** If the virtual table pVtab supports the transaction interface
156415 ** (xBegin/xRollback/xCommit and optionally xSync) and a transaction is
156468 ** virtual tables that currently have an open transaction. Pass iSavepoint
156474 ** an open transaction is invoked.
181043 /* If a transaction is open, the disconnectAllVtab() call above
181085 ** Return the transaction state for a single databse, or the maximum
181086 ** transaction state over all attached databases if zSchema is null.
181154 /* If a transaction is open, roll it back. This also ensures that if
181155 ** any database schemas have been modified by an uncommitted transaction
181266 ** This is important in case the transaction being rolled back has
182064 ** Register a function to be invoked when a transaction commits.
182115 ** Register a callback to be invoked each time a transaction is rolled
182218 ** a database after committing a transaction if there are nFrame or
182245 ** Register a callback to be invoked each time a transaction is written
182350 ** If a transaction is open on the database being checkpointed, this
184731 ** Open a read-transaction on the snapshot identified by pSnapshot.
185046 /* The blocking transaction has been concluded. Or there never was a
185047 ** blocking transaction. In either case, invoke the notify callback
185077 ** until connection pBlocker concludes its current transaction.
185090 ** the transaction opened by database db has just finished. Locks held
185155 ** is returned the transaction on connection db will still be
185859 ** populated as documents are inserted/updated/deleted in a transaction
185860 ** and used to create a new segment when the transaction is committed.
185861 ** However if this limit is reached midway through a transaction, a new
186088 /* State variables used for validating that the transaction control
190043 ** because an "ALTER TABLE RENAME TABLE" statement inside a transaction
190044 ** always opens a savepoint transaction. And the xSavepoint() method
196998 ** a transaction, causing SQLite to return SQLITE_LOCKED or
197002 ** committing a transaction, the whole transaction will be rolled back.
210481 u8 inWrTrans; /* True if inside write transaction */
213550 ** Called when a transaction starts.
213560 ** Called when a transaction completes (either by COMMIT or ROLLBACK).
213687 rtreeBeginTransaction, /* xBegin - begin transaction */
213688 rtreeEndTransaction, /* xSync - sync transaction */
213689 rtreeEndTransaction, /* xCommit - commit transaction */
213690 rtreeRollback, /* xRollback - rollback transaction */
216388 rtreeBeginTransaction, /* xBegin - begin transaction */
216389 rtreeEndTransaction, /* xSync - sync transaction */
216390 rtreeEndTransaction, /* xCommit - commit transaction */
216391 rtreeEndTransaction, /* xRollback - rollback transaction */
217601 ** Writing a transaction containing a large number of operations on
217608 ** single leaf that is modified more than once as part of the transaction
217623 ** large transaction to be broken down into sub-transactions performed
217633 ** transmitted via a wireless network to a mobile device. A transaction
217639 ** An "RBU update" transaction is subject to the following limitations:
217641 ** * The transaction must consist of INSERT, UPDATE and DELETE operations
221131 ** other client appends a transaction to the wal file in the middle of
221645 ** is already a transaction open, so the prepared statement cannot
222201 ** transaction is committed in rollback mode) currently stored on
222360 /* Commit the transaction to the *-oal file. */
222580 ** that the values are always trustworthy within an open transaction.
224842 ** written by the sqlite_dbpage virtual table, start a write transaction
249642 ** xBegin(): Start of a new transaction.
249645 ** xRollback(): Rollback the transaction.
249657 ** During a write-transaction the fts5_index.c module may cache some data
249663 ** structure is used to record the current transaction state. This information
251267 /* A transaction must be open when this is called. */