calpoly-csai / api

Official API for the NIMBUS Voice Assistant accessible via HTTP REST protocol.
https://nimbus.api.calpolycsai.com/
GNU General Public License v3.0
9 stars 4 forks source link

Create a new MySQL transaction after the transaction has been rolled back #195

Closed snekiam closed 4 years ago

snekiam commented 4 years ago

Describe the bug After a transaction has been rolled back, we do not clean up the transaction and create a new one

Here's the relevant stacktrace we want to handle:

sqlalchemy.exc.InvalidRequestError: This Session's transaction has been rolled back due to a previous exception during flush. To begin a new transaction with this Session, first issue Session.rollback().

Expected behavior We should create a new transaction when the transaction is rolled back, and potentially retry the original question.

snekiam commented 4 years ago

@ethanahlquist this is the thing I was talking about handling