Transaction already started error

Hello everyone,

Time to time I see that database sockets are closed during running my Elixir application. Except pretty terse <<"socket closed">> error today I saw transaction is already started error, the full text is:

2022-12-12-10:09:08.355 [error] MyXQL.Connection (#PID<0.2291.0>) disconnected: 
**(DBConnection.TransactionError) transaction is already started

Besides the text of the error message is pretty clear on itself :slight_smile: I am still don’t understand under which conditions db_connection library may throw this exception and would appreciate if somebody can give me any hints how this error could be reproduced based on abstract (maybe failed) transactions and what reason for this error.

Unfortunately I can’t provide the query or whole transaction where the exception is thrown as there are many of them and I am still not sure by myself which one causes it.

Thank you.