Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Kirill Smelkov
neo
Commits
15f12104
Commit
15f12104
authored
May 24, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
9de09953
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
1 deletion
+13
-1
go/zodb/persistent.go
go/zodb/persistent.go
+1
-1
go/zodb/persistent_test.go
go/zodb/persistent_test.go
+12
-0
No files found.
go/zodb/persistent.go
View file @
15f12104
...
@@ -261,7 +261,7 @@ func (obj *Persistent) PDeactivate() {
...
@@ -261,7 +261,7 @@ func (obj *Persistent) PDeactivate() {
if
obj
.
state
>=
CHANGED
{
if
obj
.
state
>=
CHANGED
{
return
return
}
}
if
obj
.
oid
==
InvalidOid
{
// newly created not-yet committed object
// TODO tests
if
obj
.
oid
==
InvalidOid
{
// newly created not-yet committed object
return
return
}
}
...
...
go/zodb/persistent_test.go
View file @
15f12104
...
@@ -621,6 +621,18 @@ func testPersistentDB(t0 *testing.T, rawcache bool) {
...
@@ -621,6 +621,18 @@ func testPersistentDB(t0 *testing.T, rawcache bool) {
t
.
checkObj
(
obj2
,
102
,
at2
,
UPTODATE
,
0
,
"kitty"
)
t
.
checkObj
(
obj2
,
102
,
at2
,
UPTODATE
,
0
,
"kitty"
)
// newly created object should not go to ghost on deactivate
obj3
:=
NewMyObject
(
t
.
conn
)
obj3
.
value
=
"new"
checkObj
(
t0
,
obj3
,
t
.
conn
,
InvalidOid
,
InvalidTid
,
UPTODATE
,
0
)
assert
.
Equal
(
obj3
.
value
,
"new"
)
t
.
PActivate
(
obj3
)
checkObj
(
t0
,
obj3
,
t
.
conn
,
InvalidOid
,
InvalidTid
,
UPTODATE
,
1
)
obj3
.
PDeactivate
()
checkObj
(
t0
,
obj3
,
t
.
conn
,
InvalidOid
,
InvalidTid
,
UPTODATE
,
0
)
assert
.
Equal
(
obj3
.
value
,
"new"
)
// finish tnx3 and txn2 - conn1 and conn2 go back to db pool
// finish tnx3 and txn2 - conn1 and conn2 go back to db pool
t
.
Abort
()
t
.
Abort
()
t2
.
Abort
()
t2
.
Abort
()
...
...
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