Commit 89db8a28 authored by Jason Madden's avatar Jason Madden

Connection.new_oid delegates to its storage, not the DB.

Fixes #139
parent 93baff53
......@@ -2,6 +2,13 @@
Change History
================
5.1.2 (unreleased)
==================
- ``Connection.new_oid`` delegates to its storage, not the DB. This is
helpful for improving concurrency in MVCC storages like RelStorage.
See `issue 139 <https://github.com/zopefoundation/ZODB/issues/139`_.
5.1.1 (2016-11-18)
==================
......
......@@ -126,7 +126,6 @@ class Connection(ExportImport, object):
storage = storage.new_instance()
self._normal_storage = self._storage = storage
self.new_oid = db.new_oid
self._savepoint_storage = None
# Do we need to join a txn manager?
......@@ -200,6 +199,9 @@ class Connection(ExportImport, object):
self._reader = ObjectReader(self, self._cache, self._db.classFactory)
def new_oid(self):
return self._storage.new_oid()
def add(self, obj):
"""Add a new object 'obj' to the database and assign it an oid."""
if self.opened is None:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment