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
Labels
Merge Requests
138
Merge Requests
138
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
4f133d81
Commit
4f133d81
authored
Oct 07, 2024
by
Kazuhiko Shiozaki
2
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ERP5Site: force READ-COMMITTED isolation for cmf_activity_sql_connection.
parent
e0b4a5bb
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
10 deletions
+17
-10
product/ERP5/ERP5Site.py
product/ERP5/ERP5Site.py
+4
-2
product/ERP5Type/tests/ERP5TypeTestCase.py
product/ERP5Type/tests/ERP5TypeTestCase.py
+12
-7
product/ERP5Type/tests/runUnitTest.py
product/ERP5Type/tests/runUnitTest.py
+1
-1
No files found.
product/ERP5/ERP5Site.py
View file @
4f133d81
...
@@ -50,6 +50,7 @@ from Products.ERP5Type.mixin.response_header_generator import ResponseHeaderGene
...
@@ -50,6 +50,7 @@ from Products.ERP5Type.mixin.response_header_generator import ResponseHeaderGene
from
zLOG
import
LOG
,
INFO
,
WARNING
,
ERROR
from
zLOG
import
LOG
,
INFO
,
WARNING
,
ERROR
from
zExceptions
import
BadRequest
from
zExceptions
import
BadRequest
import
os
import
os
import
re
import
warnings
import
warnings
import
transaction
import
transaction
from
App.config
import
getConfiguration
from
App.config
import
getConfiguration
...
@@ -84,7 +85,7 @@ def manage_addERP5Site(self,
...
@@ -84,7 +85,7 @@ def manage_addERP5Site(self,
validate_email
=
0
,
validate_email
=
0
,
erp5_catalog_storage
=
'erp5_mysql_innodb_catalog'
,
erp5_catalog_storage
=
'erp5_mysql_innodb_catalog'
,
erp5_sql_connection_string
=
default_sql_connection_string
,
erp5_sql_connection_string
=
default_sql_connection_string
,
cmf_activity_sql_connection_string
=
default_sql_connection_string
,
cmf_activity_sql_connection_string
=
'!READ-COMMITTED %s'
%
default_sql_connection_string
,
bt5_repository_url
=
''
,
bt5_repository_url
=
''
,
bt5
=
''
,
bt5
=
''
,
id_store_interval
=
''
,
id_store_interval
=
''
,
...
@@ -2281,7 +2282,8 @@ class ERP5Generator(PortalGenerator):
...
@@ -2281,7 +2282,8 @@ class ERP5Generator(PortalGenerator):
# The only difference compared to activity connection is the
# The only difference compared to activity connection is the
# minus prepended to the connection string.
# minus prepended to the connection string.
if
id
==
'erp5_sql_transactionless_connection'
:
if
id
==
'erp5_sql_transactionless_connection'
:
connection_string
=
'-'
+
p
.
cmf_activity_sql_connection_string
# omit isolation-level and add '-' sign in front of the database.
connection_string
=
re
.
sub
(
r'((?:[%*][^ ]+ )*)(![^ ]+ )?(.+)'
,
r'\1-\3'
,
p
.
cmf_activity_sql_connection_string
)
else
:
else
:
connection_string
=
getattr
(
p
,
id
+
'_string'
)
connection_string
=
getattr
(
p
,
id
+
'_string'
)
manage_add
(
id
,
title
,
connection_string
,
**
kw
)
manage_add
(
id
,
title
,
connection_string
,
**
kw
)
...
...
product/ERP5Type/tests/ERP5TypeTestCase.py
View file @
4f133d81
...
@@ -102,17 +102,22 @@ def _getConnectionStringDict():
...
@@ -102,17 +102,22 @@ def _getConnectionStringDict():
connection_string_dict
=
{}
connection_string_dict
=
{}
default
=
os
.
environ
.
get
(
'erp5_sql_connection_string'
)
default
=
os
.
environ
.
get
(
'erp5_sql_connection_string'
)
for
connection
in
(
'erp5_sql_connection_string'
,
for
connection
in
(
'erp5_sql_connection_string'
,
'erp5_sql_deferred_connection_string'
,
'erp5_sql_deferred_connection_string'
):
# default value for transactionless is derived from value
# for cmf_activity, so process it last
'cmf_activity_sql_connection_string'
):
connection_string
=
os
.
environ
.
get
(
connection
,
default
)
connection_string
=
os
.
environ
.
get
(
connection
,
default
)
if
connection_string
:
if
connection_string
:
connection_string_dict
[
connection
]
=
connection_string
connection_string_dict
[
connection
]
=
connection_string
connection
=
'cmf_activity_sql_connection_string'
# force READ-COMMITTED isolation-level.
connection_string_dict
[
connection
]
=
\
os
.
environ
.
get
(
connection
,
re
.
sub
(
r'((?:[%*][^ ]+ )*)(![^ ]+ )?(.+)'
,
r'\1!READ-COMMITTED \3'
,
connection_string_dict
[
'erp5_sql_connection_string'
]))
# default value for transactionless is derived from value
# for cmf_activity, so process it last
connection
=
'erp5_sql_transactionless_connection_string'
connection
=
'erp5_sql_transactionless_connection_string'
if
os
.
environ
.
get
(
connection
,
connection_string
):
# omit isolation-level and add '-' sign in front of the database.
connection_string_dict
[
connection
]
=
\
connection_string_dict
[
connection
]
=
\
os
.
environ
.
get
(
connection
,
'-'
+
connection_string
)
os
.
environ
.
get
(
connection
,
re
.
sub
(
r'((?:[%*][^ ]+ )*)(![^ ]+ )?(.+)'
,
r'\1-\3'
,
connection_string_dict
[
'cmf_activity_sql_connection_string'
]))
return
connection_string_dict
return
connection_string_dict
def
_getConversionServerUrlList
():
def
_getConversionServerUrlList
():
...
...
product/ERP5Type/tests/runUnitTest.py
View file @
4f133d81
...
@@ -65,7 +65,7 @@ Options:
...
@@ -65,7 +65,7 @@ Options:
--cmf_activity_sql_connection_string=STRING
--cmf_activity_sql_connection_string=STRING
ZSQL Connection string for
ZSQL Connection string for
cmf_activity_sql_connection (if unset, defaults to
cmf_activity_sql_connection (if unset, defaults to
erp5_sql_connection_string)
erp5_sql_connection_string
with "!READ-COMMITTED"
)
--extra_sql_connection_string_list=STRING
--extra_sql_connection_string_list=STRING
Used when 2 or more ZSQL connection strings are
Used when 2 or more ZSQL connection strings are
needed. By defaut, it will take the last four
needed. By defaut, it will take the last four
...
...
Kazuhiko Shiozaki
@kazuhiko
mentioned in commit
b393845b
·
Oct 11, 2024
mentioned in commit
b393845b
mentioned in commit b393845b7fc3ac1d08957fbcde36c898124d0996
Toggle commit list
Kazuhiko Shiozaki
@kazuhiko
mentioned in commit
ebe201a1
·
Nov 07, 2024
mentioned in commit
ebe201a1
mentioned in commit ebe201a168b379dee3e51afc96c57396551c64b5
Toggle commit list
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