Commit a870c5db authored by Tim Peters's avatar Tim Peters

Grammar, spelling, English.

parent 41fc1acd
...@@ -115,9 +115,9 @@ class ITransaction(zope.interface.Interface): ...@@ -115,9 +115,9 @@ class ITransaction(zope.interface.Interface):
def savepoint(optimistic=False): def savepoint(optimistic=False):
"""Create a savepoint. """Create a savepoint.
If the optimistic argument is true, then data managers that If the optimistic argument is true, then data managers that don't
don't support savepoints can be used, but an error will be support savepoints can be used, but an error will be raised if the
raised if the savepoint is rolled back. savepoint is rolled back.
An ISavepoint object is returned. An ISavepoint object is returned.
""" """
...@@ -125,12 +125,12 @@ class ITransaction(zope.interface.Interface): ...@@ -125,12 +125,12 @@ class ITransaction(zope.interface.Interface):
def join(datamanager): def join(datamanager):
"""Add a datamanager to the transaction. """Add a datamanager to the transaction.
The if the data manager supports savepoints, it must call this If the data manager supports savepoints, it must call join *before*
*before* making any changes. If the transaction has had any making any changes: if the transaction has made any savepoints, then
savepoints, then it will take a savepoint of the data manager the transaction will take a savepoint of the data manager when join
when join is called and this savepoint must reflct the state is called, and this savepoint must reflect the state of the data
of the data manager before any changes that caused the data manager before any changes that caused the data manager to join the
manager to join the transaction. transaction.
The datamanager must implement the The datamanager must implement the
transactions.interfaces.IDataManager interface, and be transactions.interfaces.IDataManager interface, and be
...@@ -211,16 +211,12 @@ class IDataManager(zope.interface.Interface): ...@@ -211,16 +211,12 @@ class IDataManager(zope.interface.Interface):
"""Objects that manage transactional storage. """Objects that manage transactional storage.
These objects may manage data for other objects, or they may manage These objects may manage data for other objects, or they may manage
non-object storages, such as relational databases. non-object storages, such as relational databases. For example,
a ZODB.Connection.
IDataManagerOriginal is the interface currently provided by ZODB Note that when some data is modified, that data's data manager should
database connections, but the intent is to move to the newer join a transaction so that data can be committed when the user commits
IDataManager.
Note that when data are modified, data managers should join a
transaction so that data can be committed when the user commits
the transaction. the transaction.
""" """
# Two-phase commit protocol. These methods are called by the # Two-phase commit protocol. These methods are called by the
...@@ -321,12 +317,12 @@ class IDataManagerSavepoint(zope.interface.Interface): ...@@ -321,12 +317,12 @@ class IDataManagerSavepoint(zope.interface.Interface):
Datamanager savepoints are used by, and only by, transaction savepoints. Datamanager savepoints are used by, and only by, transaction savepoints.
Note that data manager savepoints don't have any notion of or Note that data manager savepoints don't have any notion of, or
responsibility for validity. It isn't the responsibility of responsibility for, validity. It isn't the responsibility of
data-manager savepoints to prevent multiple rollbacks or rollbacks data-manager savepoints to prevent multiple rollbacks or rollbacks after
after transaction termination. Preventing invalid savepoint transaction termination. Preventing invalid savepoint rollback is the
rollback is the responsibility of transaction rollbacks. responsibility of transaction rollbacks. Application code should never
Application code should never use data-manager savepoints. use data-manager savepoints.
""" """
def rollback(): def rollback():
...@@ -340,9 +336,7 @@ class ISavepoint(zope.interface.Interface): ...@@ -340,9 +336,7 @@ class ISavepoint(zope.interface.Interface):
def rollback(): def rollback():
"""Rollback any work done since the savepoint. """Rollback any work done since the savepoint.
An InvalidSavepointRollbackError is raised if the savepoint InvalidSavepointRollbackError is raised if the savepoint isn't valid.
isn't valid.
""" """
valid = zope.interface.Attribute( valid = zope.interface.Attribute(
......
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