Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tatuya Kamada
erp5
Commits
95e7d36a
Commit
95e7d36a
authored
May 19, 2017
by
Vincent Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ZMySQLDA: Allow BEGIN xor LOCK to reconnect
Saves one round-trip to server.
parent
fe6fe6c4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
4 deletions
+2
-4
product/ZMySQLDA/db.py
product/ZMySQLDA/db.py
+2
-4
No files found.
product/ZMySQLDA/db.py
View file @
95e7d36a
...
@@ -403,12 +403,10 @@ class DB(TM):
...
@@ -403,12 +403,10 @@ class DB(TM):
"""Begin a transaction (when TM is enabled)."""
"""Begin a transaction (when TM is enabled)."""
try
:
try
:
self
.
_transaction_begun
=
True
self
.
_transaction_begun
=
True
# Ping the database to reconnect if connection was closed.
self
.
_query
(
"SELECT 1"
,
allow_reconnect
=
True
)
if
self
.
_transactions
:
if
self
.
_transactions
:
self
.
_query
(
"BEGIN"
)
self
.
_query
(
"BEGIN"
,
allow_reconnect
=
True
)
if
self
.
_mysql_lock
:
if
self
.
_mysql_lock
:
self
.
_query
(
"SELECT GET_LOCK('%s',0)"
%
self
.
_mysql_lock
)
self
.
_query
(
"SELECT GET_LOCK('%s',0)"
%
self
.
_mysql_lock
,
allow_reconnect
=
not
self
.
_transactions
)
except
:
except
:
LOG
(
'ZMySQLDA'
,
ERROR
,
"exception during _begin"
,
LOG
(
'ZMySQLDA'
,
ERROR
,
"exception during _begin"
,
error
=
sys
.
exc_info
())
error
=
sys
.
exc_info
())
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment