On Tue, Aug 28, 2018 at 7:56 AM, Mohit Agarwal <[email protected]> wrote:
> I will also like to know is there anytime out setting to sql alchemy query > because of which it is raising an exception after 30 seconds and going into > the except block. We have not explicitly passed statement_timeout in our > implementation. > I would need to see the complete error message you are getting so I can google it. SQLAlchemy itself has no concept of timeouts, this is something that happens either at the driver level or in the server side configuration of your database. > > On Tuesday, August 28, 2018 at 5:20:39 PM UTC+5:30, Mohit Agarwal wrote: >> >> Hi, >> We are seeing exceptions:AssertionError being raised when of our APIs has >> a long running query. In code we are rolling back transaction if any error >> is received while committing. Basically we have this general wrapper >> >> try: >> session.commit() >> except Exception as e: >> session.rollback() >> > raise e > >> >> >> >> Our sql alchemy version - 1.0.6 >> Our database - Azure SQL (sql server) >> >> >> Stack trace - >> File "/code/api/named_location/resources.py", line 258, in >> create_named_locations_dataclass >> File "/code/api/named_location/operations.py", line 94, in do_create >> File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/scoping.py", >> line 150, in do >> File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", >> line 754, in rollback >> File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", >> line 437, in rollback >> File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", >> line 273, in _restore_snapshot >> >> From the code it looks like it fails here - >> def _restore_snapshot(self, dirty_only=False): >> *assert self._is_transaction_boundary* >> What does it mean, why rollback is failing ? >> >> >> >> Thanks >> Mohit >> > -- > SQLAlchemy - > The Python SQL Toolkit and Object Relational Mapper > > http://www.sqlalchemy.org/ > > To post example code, please provide an MCVE: Minimal, Complete, and > Verifiable Example. See http://stackoverflow.com/help/mcve for a full > description. > --- > You received this message because you are subscribed to the Google Groups > "sqlalchemy" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/sqlalchemy. > For more options, visit https://groups.google.com/d/optout. > -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlalchemy.org/ To post example code, please provide an MCVE: Minimal, Complete, and Verifiable Example. See http://stackoverflow.com/help/mcve for a full description. --- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/sqlalchemy. For more options, visit https://groups.google.com/d/optout.
