-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(database): add support for nested transactions using savepoints #8833
base: 4.6
Are you sure you want to change the base?
Commits on May 16, 2024
-
test(transaction): add some test cases for nested transactions
Test whether we can start two nested transactions ... 1. ... complete them and see the result in the database 2. ... rollback the outer one after completing the inner one, and see that the result is _not_ in the database. 3. ... roll back the inner one and see if the result of the outer one is in the database after completing.
Configuration menu - View commit details
-
Copy full SHA for 4bf87b1 - Browse repository at this point
Copy the full SHA 4bf87b1View commit details -
feat(database): add option enableNestedTransactions to BaseConnection
This option will be false by default, so the previous documented behaviour of CodeIgniter gets kept & to avoid introducing a breaking change. CodeIgniter allows for nesting transactions, but only ever cared about, actually committing/rolling back the most outer one. This commit keeps this behaviour by default, but adds the database driver option 'enableNestedTransactions' to the BaseConnection. When set to true, codeigniter now will call _transBeginNested()/_transCommitNested()/_transRollbackNested() on the respective driver implemented, when further transactions are nested into the outermost transaction.
Configuration menu - View commit details
-
Copy full SHA for 287ad8f - Browse repository at this point
Copy the full SHA 287ad8fView commit details -
feat(database): add support for nested transactions using savepoints
By using SAVEPOINT SQL statements to manage transactions deeper than 1 level, it's possible to provide full nested transaction semantics for the following drivers: - SQLite3: - https://sqlite.org/lang_transaction.html - Savepoints: https://sqlite.org/lang_savepoint.html - MySQLi - https://mariadb.com/kb/en/savepoint/ - Postgre - https://www.postgresql.org/docs/current/sql-savepoint.html The implementation starts a transaction when transBegin() is first called as before. But then all nested transactions will be managed by creating, releasing (commiting) or rolling back savepoint. Only when the outermost transaction is completed a COMMIT or ROLLBACK will be executed, either committing the transaction and all inner _committed_ transactions, or rolling everything back. This feature is currently disabled for SQLSrv & OCI8 and they keep on. working with just 1 transaction layer & nested ones getting ignored. Revert "feat(sqlite3): add support for nested transactions using SAVEPOINT" This reverts commit 47db608. feat(database): use savepoints for nested transactions for MySQLi, SQLite3 + Postgre driver
Configuration menu - View commit details
-
Copy full SHA for 7a9f89c - Browse repository at this point
Copy the full SHA 7a9f89cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 277b505 - Browse repository at this point
Copy the full SHA 277b505View commit details -
tests(transaction): add more test cases for when transaction nesting …
…is enabled, plus an extreme example
Configuration menu - View commit details
-
Copy full SHA for 9015529 - Browse repository at this point
Copy the full SHA 9015529View commit details -
Configuration menu - View commit details
-
Copy full SHA for 92f5094 - Browse repository at this point
Copy the full SHA 92f5094View commit details -
feature(transaction): implement nested transactions for SQLsrv using …
…their own syntax
Configuration menu - View commit details
-
Copy full SHA for 4a9aca8 - Browse repository at this point
Copy the full SHA 4a9aca8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 98e9702 - Browse repository at this point
Copy the full SHA 98e9702View commit details -
fix(db): make sure we reset the transStrict flag, also when calling j…
…ust transRollback()
Configuration menu - View commit details
-
Copy full SHA for 48e3742 - Browse repository at this point
Copy the full SHA 48e3742View commit details -
Configuration menu - View commit details
-
Copy full SHA for d5c99bd - Browse repository at this point
Copy the full SHA d5c99bdView commit details -
Configuration menu - View commit details
-
Copy full SHA for f531ef2 - Browse repository at this point
Copy the full SHA f531ef2View commit details -
feature(savepoints): dont disable savepoints for OCI8/SQLSRV as they …
…are implemented now
Configuration menu - View commit details
-
Copy full SHA for f5b5fed - Browse repository at this point
Copy the full SHA f5b5fedView commit details -
Configuration menu - View commit details
-
Copy full SHA for 6970c48 - Browse repository at this point
Copy the full SHA 6970c48View commit details -
Configuration menu - View commit details
-
Copy full SHA for f35c71f - Browse repository at this point
Copy the full SHA f35c71fView commit details -
Configuration menu - View commit details
-
Copy full SHA for c0285f2 - Browse repository at this point
Copy the full SHA c0285f2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4bf49f9 - Browse repository at this point
Copy the full SHA 4bf49f9View commit details