Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neoppod
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
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
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vincent Pelletier
neoppod
Commits
645920e8
Commit
645920e8
authored
Mar 04, 2016
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
storage: move the commit at tpc_vote from the backends to the unique caller
parent
eaa07e25
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
10 deletions
+13
-10
neo/storage/database/manager.py
neo/storage/database/manager.py
+10
-5
neo/storage/database/mysqldb.py
neo/storage/database/mysqldb.py
+0
-2
neo/storage/database/sqlite.py
neo/storage/database/sqlite.py
+0
-2
neo/storage/transactions.py
neo/storage/transactions.py
+3
-1
No files found.
neo/storage/database/manager.py
View file @
645920e8
...
...
@@ -396,13 +396,18 @@ class DatabaseManager(object):
@
abstract
def
storeTransaction
(
self
,
tid
,
object_list
,
transaction
,
temporary
=
True
):
"""
Store a transaction temporarily, if temporary is true. Note
that this transaction is not finished yet. The list of objects
contains tuples, each of which consists of an object ID,
a data_id and object serial.
"""
Write transaction metadata
The list of objects contains tuples, each of which consists of
a
n object ID, a
data_id and object serial.
The transaction is either None or a tuple of the list of OIDs,
user information, a description, extension information and transaction
pack state (True for packed)."""
pack state (True for packed).
If 'temporary', the transaction is stored into ttrans/tobj tables,
(instead of trans/obj). The caller is in charge of committing, which
is always the case at tpc_vote.
"""
@
abstract
def
_pruneData
(
self
,
data_id_list
):
...
...
neo/storage/database/mysqldb.py
View file @
645920e8
...
...
@@ -465,8 +465,6 @@ class MySQLDatabaseManager(DatabaseManager):
q
(
"REPLACE INTO %s VALUES (%s,%s,%s,'%s','%s','%s','%s',%s)"
%
(
trans_table
,
partition
,
'NULL'
if
temporary
else
tid
,
packed
,
e
(
''
.
join
(
oid_list
)),
e
(
user
),
e
(
desc
),
e
(
ext
),
u64
(
ttid
)))
if
temporary
:
self
.
commit
()
_structLL
=
struct
.
Struct
(
">LL"
)
_unpackLL
=
_structLL
.
unpack
...
...
neo/storage/database/sqlite.py
View file @
645920e8
...
...
@@ -376,8 +376,6 @@ class SQLiteDatabaseManager(DatabaseManager):
(
partition
,
None
if
temporary
else
tid
,
packed
,
buffer
(
''
.
join
(
oid_list
)),
buffer
(
user
),
buffer
(
desc
),
buffer
(
ext
),
u64
(
ttid
)))
if
temporary
:
self
.
commit
()
def
_pruneData
(
self
,
data_id_list
):
data_id_list
=
set
(
data_id_list
).
difference
(
self
.
_uncommitted_data
)
...
...
neo/storage/transactions.py
View file @
645920e8
...
...
@@ -174,7 +174,9 @@ class TransactionManager(object):
txn_info
=
oid_list
,
user
,
desc
,
ext
,
False
,
ttid
transaction
.
has_trans
=
True
# store metadata to temporary table
self
.
_app
.
dm
.
storeTransaction
(
ttid
,
object_list
,
txn_info
)
dm
=
self
.
_app
.
dm
dm
.
storeTransaction
(
ttid
,
object_list
,
txn_info
)
dm
.
commit
()
def
lock
(
self
,
ttid
,
tid
):
"""
...
...
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