Connection to ZODB for loading and storing objects.
There are no attributes in this class.
abort(transaction)
Abort a transaction and forget all changes.
add(obj)
Add a new object obj
to the database and assign it an oid.
afterCompletion(*ignored)
beforeCompletion(txn)
cacheGC()
Reduce cache size to target size.
cacheMinimize()
Deactivate all unmodified objects in the cache.
close(primary=True)
Close the Connection.
commit(transaction)
Commit changes to an object
db()
Returns a handle to the database this connection belongs to.
exchange(old, new)
exportFile(oid, f=None)
get(oid)
Return the persistent object with oid oid
.
getDebugInfo()
Returns a tuple with different items for debugging the connection.
getTransferCounts(clear=False)
Returns the number of objects loaded and stored.
getVersion()
Returns the version this connection is attached to.
get_connection(database_name)
Return a Connection for the named database.
importFile(f, clue='', customImporters=None)
invalidate(tid, oids)
Notify the Connection that transaction tid
invalidated oids.
invalidateCache()
isReadOnly()
Returns True if the storage for this connection is read only.
modifiedInVersion(oid)
Returns the version the object with the given oid was modified in.
If it wasn't modified in a version, the current version of this connection is returned.
newTransaction(*ignored)
oldstate(obj, tid)
Return copy of obj
that was written by transaction tid
.
onCloseCallback(f)
Register a callable, f, to be called by close().
open(transaction_manager=None, delegate=True)
Register odb, the DB that this Connection uses.
This method is called by the DB every time a Connection is opened. Any invalidations received while the Connection was closed will be processed.
If the global module function resetCaches() was called, the cache will be cleared.
Parameters: odb: database that owns the Connection transaction_manager: transaction manager to use. None means use the default transaction manager. register for afterCompletion() calls.
register(obj)
Register obj with the current transaction manager.
A subclass could override this method to customize the default policy of one transaction manager for each thread.
obj must be an object loaded from this Connection.
root()
Return the database root object.
savepoint()
setDebugInfo(*args)
Add the given items to the debug information of this connection.
setstate(obj)
Turns the ghost obj
into a real object by loading it's from the
database.
sortKey()
Return a consistent sort key for this connection.
sync()
Manually update the view on the database.
tpc_abort(transaction)
tpc_begin(transaction)
Begin commit of a transaction, starting the two-phase commit.
tpc_finish(transaction)
Indicate confirmation that the transaction is done.
tpc_vote(transaction)
Verify that a data manager can commit the transaction.
There are no known subclasses.