Re: RFC: connection transaction convenience
Jason Madden <[email protected]>
| Newsgroups | gmane.comp.web.zope.zodb |
|---|---|
| Message-ID | <[email protected]> |
> On Jun 16, 2016, at 14:12, Jim Fulton <[email protected]> wrote: > > I often want to use a connection's transaction manager, as in: > > conn.transaction_manager.commit() > > I do this: > > - Interactively **a lot**. I get really tired of typing > transaction_manager (even with completion). > > - Occasionally in lower-level code where I need to affect transaction > lifecycle, but don't want to have the low-level code to assume the use > of a thread-local transaction manager. > > I propose as a convenience: > > - add begin as an alias for sync. > > - Allow commit and abort to be called without arguments to commit and > abort the current transaction. > > (They're currently called with a transaction as part of the > IDataManager API.) > > Thoughts? I'm -0. I would prefer not to see Connection gain any more methods or any more complicated argument interpretation, especially as it relates to transactions (or other independent or semi-independent concepts). There's already enough to learn about transactions and Connections and transaction managers and when to call begin() and so on that the chance for confusion seems high. That said, I almost exclusively either use the thread-local manager or have one passed to me explicitly so I haven't felt the pain you're feeling :). So if you feel that it's a strong addition with low confusion/misuse potential, I won't argue. ~Jason -- You received this message because you are subscribed to the Google Groups "zodb" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.