Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cta
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dCache
cta
Commits
89902588
Commit
89902588
authored
8 years ago
by
Steven Murray
Browse files
Options
Downloads
Patches
Plain Diff
SqliteStmt now uses DEFERRED transactions
parent
a88c22b4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
rdbms/SqliteStmt.cpp
+4
-4
4 additions, 4 deletions
rdbms/SqliteStmt.cpp
rdbms/SqliteStmt.hpp
+2
-2
2 additions, 2 deletions
rdbms/SqliteStmt.hpp
with
6 additions
and
6 deletions
rdbms/SqliteStmt.cpp
+
4
−
4
View file @
89902588
...
...
@@ -84,7 +84,7 @@ SqliteStmt::SqliteStmt(
break
;
case
AutocommitMode
::
OFF
:
{
if
(
!
m_conn
.
m_transactionInProgress
)
{
begin
Exclusive
Transaction
();
begin
Deferred
Transaction
();
m_conn
.
m_transactionInProgress
=
true
;
}
break
;
...
...
@@ -249,12 +249,12 @@ uint64_t SqliteStmt::getNbAffectedRows() const {
}
//------------------------------------------------------------------------------
// begin
Exclusive
Transaction
// begin
Deferred
Transaction
//------------------------------------------------------------------------------
void
SqliteStmt
::
begin
Exclusive
Transaction
()
{
void
SqliteStmt
::
begin
Deferred
Transaction
()
{
try
{
char
*
errMsg
=
nullptr
;
if
(
SQLITE_OK
!=
sqlite3_exec
(
m_conn
.
m_sqliteConn
,
"BEGIN
EXCLUSIVE
"
,
nullptr
,
nullptr
,
&
errMsg
))
{
if
(
SQLITE_OK
!=
sqlite3_exec
(
m_conn
.
m_sqliteConn
,
"BEGIN
DEFERRED
"
,
nullptr
,
nullptr
,
&
errMsg
))
{
exception
::
Exception
ex
;
ex
.
getMessage
()
<<
"sqlite3_exec failed"
;
if
(
nullptr
!=
errMsg
)
{
...
...
This diff is collapsed.
Click to expand it.
rdbms/SqliteStmt.hpp
+
2
−
2
View file @
89902588
...
...
@@ -172,13 +172,13 @@ private:
uint64_t
m_nbAffectedRows
;
/**
* Begins an SQLite
exclusive
transaction.
* Begins an SQLite
deferred
transaction.
*
* This method is called by the constructor which in turn was called by the
* SqliteStmt::createStmt() method and assumes that a lock has already been
* taken on SqliteStmt::m_mutex;
*/
void
begin
Exclusive
Transaction
();
void
begin
Deferred
Transaction
();
};
// class SqlLiteStmt
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment