Unable to commit changes from mailman shell to database
I tried the doing it the way you did and got the same result. After checking with "dir()" I found a "commit" method. I tried running it and it worked.
dir() ['IUserManager', '__builtins__', 'a', 'abort', 'commit', 'config', 'getUtility', 'l', 'm', 'now', 'um', 'user_manager', 'x'] commit
> commit()
Maybe it was there because I'm using PostgreSQL but it worked for me.
On Apr 03, 2016, at 01:30 AM, Gurkirpal Singh wrote:
Maybe it was there because I'm using PostgreSQL but it worked for me.
Cool, so it's working now?
I believe SQLAlchemy opens a transaction automatically, so that the bound commit() and abort() methods operate on that transaction. By creating a new connection and a new transaction, I think you might have created a subtransaction which didn't get flushed to the database. It probably doesn't have anything to do with the db backend specifically, but just how SA works.
Cheers, -Barry
participants (2)
-
Barry Warsaw
-
Gurkirpal Singh