Django + Gevent + PostgreSQL = Idle Transaction
I implemented some simple Long Polling with Gevent in a Django View.
The client AJAX an url, enter the update view and wait with
Gevent.event.wait for an update.
Problem: We do not use Autocommit (and don't plan to) and the client
view's Postgres transaction stay open as long as Gevent.event.wait
block the request, even if the visitor navigate away.
This create a quick accumulation of idle transactions.
I'd like to close the transaction before starting Gevent.event.wait.
The transaction is not used after retrieving the request anyway.
What would be the cleanest way to close the Postgres transaction
without closing the request ? I'm currently sending the
request_finished signal manually but it feels like hack.
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home