Re: [pylons-discuss] Pyramid_tm reason for ROLLBACK

2017-10-06 Thread Jonathan Vanasco
The error is most likely in your Pyramid code. If SqlAlchemy failed, there would be a SqlAlchemy error logged. Your example shows SqlAlchemy completing an INSERT, but then being instructed to ROLLBACK by the transaction manager. You should increase your Pyramid logging levels. Between your

Re: [pylons-discuss] Pyramid_tm reason for ROLLBACK

2017-10-06 Thread Srikanth Bemineni
Hi, I narrowed down the problem to transaction not getting committed. I am seeing this problem where the viewcallable renders json instead of a mako template. The views that are rendering mako template are working fine and the transaction is getting committed.

Re: [pylons-discuss] Pyramid_tm reason for ROLLBACK

2017-10-06 Thread Michael Merickel
If you have successfully set the sqlalchemy.* loggers to DEBUG you should be seeing tons of output. Ensure that you've configured the level on the correct loggers. For example, the pyramid cookiecutters ship with a separate config for sqlalchemy that overrides the default root logger level. -

Re: [pylons-discuss] Pyramid_tm reason for ROLLBACK

2017-10-06 Thread Srikanth Bemineni
Hi, My current log level is INFO, and I have changed it to DEBUG, but still no error messages. I do have an auto increment primary key, but the example I am executing is one single insert command. I also do have a DBSession.flush() after including the object into DBsession. INSERT INTO

Re: [pylons-discuss] Pyramid_tm reason for ROLLBACK

2017-10-06 Thread Mike Orr
Do you have the 'sqlalchemy.engine' logger set to 'WARN'? I do and I get messages like Mikko Ohtamaa gets. I'm not sure the transaction manager is the right place to log these things because it doesn't know what's wrong, only that an exception occurred. It wouldn't be able to print the SQL command

Re: [pylons-discuss] Pyramid_tm reason for ROLLBACK

2017-10-06 Thread Srikanth Bemineni
Hi, I am using Mysql. This is one single insert into a table and its failing for some reason. I am not able to predict the reason for the failure. sqlalchemy just prints ROLLBACK. INSERT INTO group_message_22f9b36c (group_id, group_topic_id, score, user_id, uname, msg, created_at, updated_at)

Re: [pylons-discuss] Pyramid_tm reason for ROLLBACK

2017-10-06 Thread Mikko Ohtamaa
Hi Srikanth, Are you using PostgreSQL? Does the transaction fail because of concurrent transactions reading or writing same data? Usually there should be something like this written in the logs: sqlalchemy.exc.OperationalError: (raised as a result of Query-invoked autoflush; consider using a