Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZODB
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
Kirill Smelkov
ZODB
Commits
defa21b4
Commit
defa21b4
authored
Oct 26, 2008
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Get commit from transaction.
parent
a3b87052
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
src/persistent/wref.py
src/persistent/wref.py
+5
-4
No files found.
src/persistent/wref.py
View file @
defa21b4
...
...
@@ -19,6 +19,7 @@ $Id$
__docformat__
=
"reStructuredText"
from
persistent
import
Persistent
import
transaction
WeakRefMarker
=
object
()
...
...
@@ -60,7 +61,7 @@ class WeakRef(object):
>>> conn1 = db.open()
>>> conn1.root()['ob'] = ob
>>> conn1.root()['ref'] = ref
>>>
ZODB.tests.util
.commit()
>>>
transaction
.commit()
If we open a new connection, we can use the reference:
...
...
@@ -73,7 +74,7 @@ class WeakRef(object):
But if we delete the referenced object and pack:
>>> del conn2.root()['ob']
>>>
ZODB.tests.util
.commit()
>>>
transaction
.commit()
>>> ZODB.tests.util.pack(db)
And then look in a new connection:
...
...
@@ -180,7 +181,7 @@ class PersistentWeakKeyDictionary(Persistent):
>>> conn1.root()['d'] = d
>>> conn1.root()['p2'] = p2
>>> conn1.root()['p3'] = p3
>>>
ZODB.tests.util
.commit()
>>>
transaction
.commit()
And things still work, as before:
...
...
@@ -210,7 +211,7 @@ class PersistentWeakKeyDictionary(Persistent):
from the dictionary:
>>> del conn2.root()['p2']
>>>
ZODB.tests.util
.commit()
>>>
transaction
.commit()
And pack the database, so that the no-longer referenced p2 is
actually removed from the database.
...
...
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