The best resource I know is
http://zodb.readthedocs.io/en/latest/transactions.html along with staring
at various implementations of data managers. A good one to look at would be
zope.sqlalchemy which is the data manager implementation for sqlalchemy
sessions. There is also repoze.sendmail with a fairly tricky one for
sending emails.

The main reason to make a data manager for a non-transactional endpoint is
if you want the transaction to abort when the server is inaccessible. Other
than that, you can actually get really far by just using
`tm.addAfterCommitHook()` to do the work after a successful commit. For
example, if writing to elasticsearch is not mission critical you could use
the hook, allow it to fail but still commit data to your rdbms, and have a
background job sync the failed attempt later.

- Michael

On Mon, Jan 23, 2017 at 12:11 PM, Srikanth Bemineni <
bemineni.srika...@gmail.com> wrote:

> Hi,
>
> Are there any tutorials to write custom data mangers.  I am thinking of
> writing a custom data manager for a elastic search object, if database
> commit succeeds. Is this  good approach to solve this problem?
>
> What is the difference between data manager and resource manger. ?
> http://transaction.readthedocs.io/en/latest/api.html
>
> Srikanth Bemineni
>
> --
> You received this message because you are subscribed to the Google Groups
> "pylons-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pylons-discuss+unsubscr...@googlegroups.com.
> To post to this group, send email to pylons-discuss@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/pylons-discuss/14052a61-ebbf-47ed-b8d0-199f61af68a4%
> 40googlegroups.com
> <https://groups.google.com/d/msgid/pylons-discuss/14052a61-ebbf-47ed-b8d0-199f61af68a4%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pylons-discuss+unsubscr...@googlegroups.com.
To post to this group, send email to pylons-discuss@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pylons-discuss/CAKdhhwHu9jMpHY60MoZiARjWby_Lmp5QE2ka6q77tbFjr8w3qw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to