ISibboI / vocabulary-learning-application

0 stars 0 forks source link

Transaction repetition fails due to open transaction #61

Closed ISibboI closed 10 months ago

ISibboI commented 1 year ago

Error happened in update_session. The transaction failed due to temporary conflict. Then when retrying, it failed again, but this time stating that the transaction would still be open.

It looks like the transaction would be rolled back on error, but only until the last save point. We don't set any save points manually, but maybe diesel sets some automatically? Otherwise, maybe the rollback somehow has concurrency issues?

A possible hack would be to get a new database connection on transaction failure, but that seems wrong: it may leave the database connection in the connection pool in the transaction open state, which will produce an error somewhere else.

We should figure out how to probe the transaction state of a connection, and then add some more detailed debug checks.

ISibboI commented 12 months ago

Possibly related to this: https://github.com/weiznich/diesel_async/issues/96

ISibboI commented 10 months ago

Somehow fixed now, tested by #93