Technical mailing list archives

Re: How to get a new cursor on new api on Thread

Maxim Litnitskiy
- 09/25/2014 14:22:19
The following seem to work reliably:

            new_cr = sql_db.db_connect(
            uid, context = self.env.uid, self.env.context
            with api.Environment.manage():
                self.env = api.Environment(new_cr, uid, context)



FInally assures that cursor is closed on thready error or exit.

Thanks for advises.

P.S. May be this link can tell more if you are interested -