[Haskell-cafe] How to debug SQL disconnect error

Olaf Klinke olf at aatal-apotheke.de
Wed Jul 7 19:59:15 UTC 2021


Dear Café, 

How can I go about examining an SQL error [1] when using persistent-
odbc to access an MS SQL database? 

Set up a pristine MS SQL server 2012.
Installed the driver on Debian using
apt-get install msodbcsql17.

Upon running either of persitent's printMigration or runMigration, the
disconnect produces an error:

    *** Exception: SqlError {seState = "["25000"]", seNativeError = -1,
seErrorMsg = "freeDbcIfNotAlready/SQLDisconnect: ["0: [Microsoft][ODBC
Driver 17 for SQL Server]Invalid transaction state"]"}

Running the printed SQL statements with isql executes allright, so it
is not the particular migration at fault here. Presently I don't even
know whether persistent or persistent-odbc or any false assumptions
about the connection configuration is the cause. 

Thanks in advance
Olaf

[1] https://github.com/gbwey/persistent-odbc/issues/26



More information about the Haskell-Cafe mailing list