blue-yonder / turbodbc

Turbodbc is a Python module to access relational databases via the Open Database Connectivity (ODBC) interface. The module complies with the Python Database API Specification 2.0.
http://turbodbc.readthedocs.io/en/latest
MIT License
623 stars 85 forks source link

Unhandled exception crashes Python process #21

Closed MathMagique closed 7 years ago

MathMagique commented 7 years ago

When connections are lost, the Python process terminates with the following error message:

terminate called after throwing an instance of 'cpp_odbc::error'
  what():  ODBC error
state: 40004
native error code: -1
message: [EXASOL][EXASolution driver]Connection lost.
Aborted

It seems that the cpp_odbc::error is not translated to a turbodbc::error that would be known to the Python interpreter.

MathMagique commented 7 years ago

This should no longer be an issue since pybind11 has better exception handling than boost::python, compare http://pybind11.readthedocs.io/en/master/advanced/exceptions.html

MathMagique commented 7 years ago

This is caused by unhandled exceptions in C++ destructors.