in reply to Re^2: ODBC without autocommit
in thread ODBC without autocommit

Here's a level 15 trace:

DBI 1.607-ithread default trace level set to 0x0/15 (pid 4524) at +test.pl line 9 -> DBI->connect(dbi:ODBC:Greentree, super, ****, HASH(0x30c024)) -> DBI->install_driver(ODBC) for MSWin32 perl=5.010000 pid=4524 ru +id=0 euid=0 install_driver: DBD::ODBC version 1.23 loaded from C:/strawberr +y/perl/site/lib/DBD/ODBC.pm New 'DBI::dr' (for DBD::ODBC::dr, parent='', id=undef) dbih_setup_handle(DBI::dr=HASH(0x1e2dbb4)=>DBI::dr=HASH(0x1e2dc14) +, DBD::ODBC::dr, 0, Null!) dbih_make_com(Null!, 0, DBD::ODBC::dr, 92, 0) thr#1a207d4 dbih_setup_attrib(DBI::dr=HASH(0x1e2dc14), Err, Null!) SCALAR(0x1a +822dc) (already defined) dbih_setup_attrib(DBI::dr=HASH(0x1e2dc14), State, Null!) SCALAR(0x +1a8227c) (already defined) dbih_setup_attrib(DBI::dr=HASH(0x1e2dc14), Errstr, Null!) SCALAR(0 +x1a822bc) (already defined) dbih_setup_attrib(DBI::dr=HASH(0x1e2dc14), TraceLevel, Null!) 0 (a +lready defined) dbih_setup_attrib(DBI::dr=HASH(0x1e2dc14), FetchHashKeyName, Null! +) 'NAME' (already defined) <- install_driver= DBI::dr=HASH(0x1e2dbb4) >> connect DISPATCH (DBI::dr=HASH(0x1e2dbb4) rc2/3 @5 g0 ima80 +01 pid#4524) at C:/strawberry/perl/site/lib/DBI.pm line 638 !! warn: 0 CLEARED by call to connect method -> connect for DBD::ODBC::dr (DBI::dr=HASH(0x1e2dbb4)~0x1e2dc14 'G +reentree' 'super' **** HASH(0x1a8462c)) thr#1a207d4 New 'DBI::db' (for DBD::ODBC::db, parent=DBI::dr=HASH(0x1e2dc14), +id=undef) dbih_setup_handle(DBI::db=HASH(0x1e2e124)=>DBI::db=HASH(0x1e2e074) +, DBD::ODBC::db, 1a8b4a4, Null!) dbih_make_com(DBI::dr=HASH(0x1e2dc14), 1e0d49c, DBD::ODBC::db, 508 +, 0) thr#1a207d4 dbih_setup_attrib(DBI::db=HASH(0x1e2e074), Err, DBI::dr=HASH(0x1e2 +dc14)) SCALAR(0x1a8b6b4) (already defined) dbih_setup_attrib(DBI::db=HASH(0x1e2e074), State, DBI::dr=HASH(0x1 +e2dc14)) SCALAR(0x1a8b734) (already defined) dbih_setup_attrib(DBI::db=HASH(0x1e2e074), Errstr, DBI::dr=HASH(0x +1e2dc14)) SCALAR(0x1a8b6f4) (already defined) dbih_setup_attrib(DBI::db=HASH(0x1e2e074), TraceLevel, DBI::dr=HAS +H(0x1e2dc14)) 0 (already defined) dbih_setup_attrib(DBI::db=HASH(0x1e2e074), FetchHashKeyName, DBI:: +dr=HASH(0x1e2dc14)) 'NAME' (already defined) dbih_setup_attrib(DBI::db=HASH(0x1e2e074), HandleSetErr, DBI::dr=H +ASH(0x1e2dc14)) undef (not defined) dbih_setup_attrib(DBI::db=HASH(0x1e2e074), HandleError, DBI::dr=HA +SH(0x1e2dc14)) undef (not defined) dbih_setup_attrib(DBI::db=HASH(0x1e2e074), ReadOnly, DBI::dr=HASH( +0x1e2dc14)) undef (not defined) dbih_setup_attrib(DBI::db=HASH(0x1e2e074), Profile, DBI::dr=HASH(0 +x1e2dc14)) undef (not defined) SQLDriverConnect failed: !!dbd_error2(err_rc=-1, what=post_connect/SQLSetConnectAttr(SQL_AU +TOCOMMIT), handles=(1e0d508,1e4cfc8,0) !SQLError(1e0d508,1e4cfc8,0) = (HYC00, 8322, [Jade Software Corpor +ation][JADE ODBC Driver] Optional feature not implemented) >> DESTROY DISPATCH (DBI::db=HASH(0x1e2e124) rc1/1 @1 g0 ima10 +004 pid#4524) at C:/strawberry/perl/site/lib/DBI.pm line 638 via at +test.pl line 11 <> DESTROY(DBI::db=HASH(0x1e2e124)) ignored for outer handle (inne +r DBI::db=HASH(0x1e2e074) has ref cnt 1) >> DESTROY DISPATCH (DBI::db=HASH(0x1e2e074) rc1/1 @1 g0 ima10 +004 pid#4524) at C:/strawberry/perl/site/lib/DBI.pm line 638 via at +test.pl line 11 -> DESTROY for DBD::ODBC::db (DBI::db=HASH(0x1e2e074)~INNER) thr#1 +a207d4 DESTROY for DBI::db=HASH(0x1e2e074) ignored - handle not init +ialised ERROR: 1 '[Jade Software Corporation][JADE ODBC Driver] Optiona +l feature not implemented (SQL-HYC00)' (err#1) <- DESTROY= undef at C:/strawberry/perl/site/lib/DBI.pm line 638 v +ia at test.pl line 11 DESTROY (dbih_clearcom) (dbh 0x1e2e074, com 0x1a3cc34, imp DBD::OD +BC::db): FLAGS 0x100011: COMSET Warn PrintWarn ERR 1 ERRSTR '[Jade Software Corporation][JADE ODBC Driver] Optional +feature not implemented (SQL-HYC00)' PARENT DBI::dr=HASH(0x1e2dc14) KIDS 0 (0 Active) dbih_clearcom 0x1e2e074 (com 0x1a3cc34, type 2) done. !! ERROR: 1 '[Jade Software Corporation][JADE ODBC Driver] Optiona +l feature not implemented (SQL-HYC00)' (err#0) <- connect= undef at C:/strawberry/perl/site/lib/DBI.pm line 638 -> $DBI::errstr (&) FETCH from lasth=HASH >> DBD::ODBC::dr::errstr <- $DBI::errstr= '[Jade Software Corporation][JADE ODBC Driver] Op +tional feature not implemented (SQL-HYC00)' DBI connect('Greentree','super',...) failed: [Jade Software Cor +poration][JADE ODBC Driver] Optional feature not implemented (SQL-HYC +00) -- DBI::END ($@: , $!: ) >> disconnect_all DISPATCH (DBI::dr=HASH(0x1e2dbb4) rc1/3 @1 g0 im +a801 pid#4524) at C:/strawberry/perl/site/lib/DBI.pm line 716 via at + test.pl line 11 !! ERROR: 1 CLEARED by call to disconnect_all method -> disconnect_all for DBD::ODBC::dr (DBI::dr=HASH(0x1e2dbb4)~0x1e2 +dc14) thr#1a207d4 <- disconnect_all= '' at C:/strawberry/perl/site/lib/DBI.pm line 7 +16 via at test.pl line 11 ! >> DESTROY DISPATCH (DBI::dr=HASH(0x1e2dc14) rc1/1 @1 g0 ima10 +004 pid#4524) during global destruction ! -> DESTROY in DBD::_::common for DBD::ODBC::dr (DBI::dr=HASH(0x1e2 +dc14)~INNER) thr#1a207d4 ! <- DESTROY= undef during global destruction DESTROY (dbih_clearcom) (drh 0x1e2dbb4, com 0x1e0d49c, imp global +destruction): FLAGS 0x100215: COMSET Active Warn PrintWarn AutoCommit PARENT undef KIDS 0 (0 Active) dbih_clearcom 0x1e2dbb4 (com 0x1e0d49c, type 1) done. ! >> DESTROY DISPATCH (DBI::dr=HASH(0x1e2dbb4) rc1/1 @1 g0 ima10 +004 pid#4524) during global destruction ! <> DESTROY for DBI::dr=HASH(0x1e2dbb4) ignored (inner handle gone)

The output to STDERR:

DBI connect('Greentree','super',...) failed: [Jade Software Corporatio +n][JADE OD BC Driver] Optional feature not implemented (SQL-HYC00) at test.pl lin +e 11 connect at test.pl line 11.

And the test script

use strict; use warnings; use DBI; DBI->trace(15, 'trace.log'); my $dbh = DBI->connect("dbi:ODBC:Greentree", "super", "super", { autoc +ommit => 0 }) or die "connect";

DBD::ODBC attempts to set autocommit unconditionally (i.e. it does so even if the autocommit option is set to false) and even if it doesn't, DBI itself does so. Preventing the specific instances is easy (I have done it and the connect works) but more work would be required to make the effect optional. I am reasonably certain (but would be happy to be surprised) that the current code does not provide any option to avoid setting this option or to ignore failures setting it.

Replies are listed 'Best First'.
Re^4: ODBC without autocommit
by mje (Curate) on Oct 12, 2009 at 08:17 UTC

    See my reply above.