To solve this problem, add the line DontDLClose = 1
to the odbcinst.ini
file.
Oracle adds a callback to the exit
function and unixODBC unloads the Oracle ODBC driver on disconnect causing the callback to fail.
Setting DontDLClose
stops unixODBC unloading the Oracle ODBC driver on disconnect. The callback then succeeds on exit.