ODBC connection fails

Ingela Anderton <>
Thu Sep 11 15:28:16 CEST 2003


Vlad Dumitrescu wrote:
> I've found the problem... After trying even with an Oracle database, I
> discovered that scrollable cursors are not supported by the drivers in either
> case.
> 
> Should there be a crash when this happens? An error message would be more
> appropriate here, I think, if not for other reason than to conform to the
> documentation :-)

But you did get an error message! E.i. {error,connection_closed} as
the connection was terminated in an abnormal way.

>()4> A=odbc:connect("DSN=vlad_test;UID=sysdba;PWD=masterkey",[{trace_driver,on}]).
>{error,connection_closed}

The process calling odbc:connect/2 did not crash! You also got a SALS
error report for the process started by odbc:connect/2 (the connection
process) as it was shut down due to abnormal termination of the port
program. However due to a subtle spelling misstake the suhtdown
crashed with a badarg instated of giving the shutdown reason to be
{#Port<0.61>,{port_exit,1}}. However I do agree that there could be
a benefit in providing more specific exit codes from the c-port
program to make it easier to understand why it terminated abnormally.

Humm ... do you mean that when you do:

odbc:connect("DSN=vlad_test;UID=sysdba;PWD=masterkey",[{scrollable_cursors,
off}]).

You get a connection ?

But when you do:

odbc:connect("DSN=vlad_test;UID=sysdba;PWD=masterkey",[]).

you get {error,connection_closed} ?

Because I do not quite understand where in the c-port program the
crash might have occurred. The oracle driver the we use at OTP does
not support scrollable cursors either but we do not need to explicitly
disable them. Scrollable cursors are used by the port program by
default if they are supported by the driver. If we try using any
function that uses the scrollable cursor when it is not supported by
the driver we will get an error message.

-- 
/Ingela

Ericsson AB - OTP team














More information about the erlang-questions mailing list