Commit cd031e83 authored by Tim Peters's avatar Tim Peters

Merge rev 38779 from 3.5 branch.

A wordier stab at Florent's rev 38766.

More words in the subtransaction deprecation warning.
parent 4d7082ea
...@@ -361,16 +361,20 @@ class Transaction(object): ...@@ -361,16 +361,20 @@ class Transaction(object):
subtransaction = 0 subtransaction = 0
elif deprecation_wng: elif deprecation_wng:
from ZODB.utils import deprecated37 from ZODB.utils import deprecated37
deprecated37("subtransactions are deprecated; use " deprecated37("subtransactions are deprecated; instead of "
"transaction.savepoint() instead of " "transaction.commit(1), use "
"transaction.commit(1)") "transaction.savepoint(optimistic=True) in "
"contexts where a subtransaction abort will never "
"occur, or sp=transaction.savepoint() if later "
"rollback is possible and then sp.rollback() "
"instead of transaction.abort(1)")
if self._savepoint2index: if self._savepoint2index:
self._invalidate_all_savepoints() self._invalidate_all_savepoints()
if subtransaction: if subtransaction:
# TODO deprecate subtransactions # TODO deprecate subtransactions
self._subtransaction_savepoint = self.savepoint(1) self._subtransaction_savepoint = self.savepoint(optimistic=True)
return return
if self.status is Status.COMMITFAILED: if self.status is Status.COMMITFAILED:
......
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