in reply to Re: ODBC without autocommit
in thread ODBC without autocommit
With trace on DBD::ODBC aborts the connect when the attempt to set autocommit on fails.
post_connect/SQLSetConnectAttr(SQL_AUTOCOMMIT)
This is from dbdimp.c in DBD::ODBC. If I comment this out, and a bit of DBI.pm that also attempts to set autocommit, then the connection completes and I can read data. The comment in dbdimp.c where autocommit is set says: DBI spec requires AutoCommit on, and comments in DBI concur. It is, unfortunately, not easy to change them because, unless they parse and understand the SQL they submit to the server, they can't distinguish what changes the database (needing a transaction and where autocommit is relevant) from what only reads the database, particularly in the case of stored procedures. I may try to find a way that a connect option prevents all attempts to set autocommit, but still I would have hacked versions of DBI and DBD::ODBC, so I'm hoping there is some other existing solution.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: ODBC without autocommit
by mje (Curate) on Oct 12, 2009 at 08:16 UTC | |
by ig (Vicar) on Oct 12, 2009 at 20:57 UTC | |
by mje (Curate) on Oct 12, 2009 at 22:37 UTC |