Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Timeout problems with DBI

by guha (Priest)
on Sep 11, 2003 at 12:45 UTC ( [id://290663]=note: print w/replies, xml ) Need Help??


in reply to Timeout problems with DBI

Followup

I've been doing some homework, as a result of the replies, thank you all.

However first I would like to make a couple of clarifications.

  1. Point 10 of the scenario should actually read "Works again"
  2. I think I need to emphasize that the major problem is not the broken link, but the fact that program invocation # > 1 hangs in the connect method ( see below for (too much) detail.
liz
As I see it in this case, there is no contact with the DB-server. Of course the requester/client or possibly DSN-manager could have a bug which results in this behaviour. I have no idea how to approach that.

What I have done is to enable tracing in DBI, settings for greatest detail.

*** Link down **** *** First program start *** DBI 1.37-ithread dispatch trace level set to 8 -> DBI->connect(DBI:ODBC:TEST3, , ****) -> DBI->install_driver(ODBC) for MSWin32 perl=5.006001 pid=1260 ru +id=0 euid=0 install_driver: DBD::ODBC version 1.05 loaded from c:/DEV/Perl/ +site/lib/DBD/ODBC.pm New DBI::dr (for DBD::ODBC::dr, parent=, id=) dbih_setup_handle(DBI::dr=HASH(0x1b64c54)=>DBI::dr=HASH(0x1abf5ac) +, DBD::ODBC::dr, 0, Null!) dbih_make_com(Null!, 00000000, DBD::ODBC::dr, 92, 00000000) thr#01 +83F348 dbih_setup_attrib(DBI::dr=HASH(0x1abf5ac), Err, Null!) SCALAR(0x1a +dea14) (already defined) dbih_setup_attrib(DBI::dr=HASH(0x1abf5ac), State, Null!) SCALAR(0x +1adea68) (already defined) dbih_setup_attrib(DBI::dr=HASH(0x1abf5ac), Errstr, Null!) SCALAR(0 +x1adea38) (already defined) dbih_setup_attrib(DBI::dr=HASH(0x1abf5ac), TraceLevel, Null!) 0 (a +lready defined) dbih_setup_attrib(DBI::dr=HASH(0x1abf5ac), FetchHashKeyName, Null! +) 'NAME' (already defined) <- install_driver= DBI::dr=HASH(0x1b64c54) -> default_user in DBD::_::dr for DBD::ODBC::dr (DBI::dr=HASH(0x1b +64c54)~0x1abf5ac undef undef HASH(0x1b8f620)) thr#0183F348 <- default_user= ( undef undef ) [2 items] at c:/DEV/Perl/site/lib +/DBI.pm line 564 via test.pl line 58 -> connect for DBD::ODBC::dr (DBI::dr=HASH(0x1b64c54)~0x1abf5ac 'T +EST3' undef **** HASH(0x1abdf84)) thr#0183F348 New DBI::db (for DBD::ODBC::db, parent=DBI::dr=HASH(0x1abf5ac), id +=) dbih_setup_handle(DBI::db=HASH(0x1abf570)=>DBI::db=HASH(0x1abdf78) +, DBD::ODBC::db, 1b6808c, Null!) dbih_make_com(DBI::dr=HASH(0x1abf5ac), 01ADAE54, DBD::ODBC::db, 22 +0, 00000000) thr#0183F348 dbih_setup_attrib(DBI::db=HASH(0x1abdf78), Err, DBI::dr=HASH(0x1ab +f5ac)) SCALAR(0x1b61c10) (already defined) dbih_setup_attrib(DBI::db=HASH(0x1abdf78), State, DBI::dr=HASH(0x1 +abf5ac)) SCALAR(0x1b61c70) (already defined) dbih_setup_attrib(DBI::db=HASH(0x1abdf78), Errstr, DBI::dr=HASH(0x +1abf5ac)) SCALAR(0x1b61c40) (already defined) dbih_setup_attrib(DBI::db=HASH(0x1abdf78), TraceLevel, DBI::dr=HAS +H(0x1abf5ac)) 0 (already defined) dbih_setup_attrib(DBI::db=HASH(0x1abdf78), FetchHashKeyName, DBI:: +dr=HASH(0x1abf5ac)) 'NAME' (already defined) dbih_setup_attrib(DBI::db=HASH(0x1abdf78), HandleError, DBI::dr=HA +SH(0x1abf5ac)) undef (not defined) <- connect= undef at c:/DEV/Perl/site/lib/DBI.pm line 582 -> errstr in DBD::_::common for DBD::ODBC::dr (DBI::dr=HASH(0x1b64 +c54)~0x1abf5ac) thr#0183F348 <- errstr= undef at c:/DEV/Perl/site/lib/DBI.pm line 584 DBI connect('TEST3','',...) failed: <> DESTROY ignored for outer handle DBI::db=HASH(0x1abf570) (inner + DBI::db=HASH(0x1abdf78)) -> DESTROY for DBD::ODBC::db (DBI::db=HASH(0x1abdf78)~INNER) thr#0 +183F348 DESTROY for DBI::db=HASH(0x1abdf78) ignored - handle not init +ialised error: -1 '[Pervasive][ODBC Client Interface][Client LNA]The OD +BC Client Interface cannot access the data source because the server +could not be located on the network. Contact your system administrato +r for assistance. (SQL-08S01) [Microsoft][ODBC Driver Manager] Drivrutinen kan inte hantera den vers +ion av ODBC-funktionalitet som programmet begär (se SQLSetEnvAttr). ( +SQL-01000)(DBD: db_login/SQLConnect ...' <- DESTROY= undef at c:/DEV/Perl/site/lib/DBI.pm line 639 via test +.pl line 58 DESTROY (dbih_clearcom) (dbh 0x1abf570 0x1adad88, com 0x1abd424, i +mp DBD::ODBC::db): FLAGS 0x11: COMSET Warn PARENT DBI::dr=HASH(0x1abf5ac) KIDS 0 (0 Active) IMP_DATA undef dbih_clearcom 0x1abf570 (com 0x1abd424, type 2) done. -> $DBI::errstr (&) FETCH from lasth=HASH >> DBD::ODBC::dr::errstr <- $DBI::errstr= '[Pervasive][ODBC Client Interface][Client LNA]Th +e ODBC Client Interface cannot access the data source because the ser +ver could not be located on the network. Contact your system administ +rator for assistance. (SQL-08S01) [Microsoft][ODBC Driver Manager] Drivrutinen kan inte hantera den vers +ion av ODBC-funktionalitet som programmet begär (se SQLSetEnvAttr). ( +SQL-01000)(DBD: db_login/SQLConnect ...' -- DBI::END -> disconnect_all for DBD::ODBC::dr (DBI::dr=HASH(0x1b64c54)~0x1ab +f5ac) thr#0183F348 <- disconnect_all= '' at c:/DEV/Perl/site/lib/DBI.pm line 649 via +test.pl line 0 ! -> DESTROY for DBD::ODBC::dr (DBI::dr=HASH(0x1abf5ac)~INNER) thr#0 +183F348 ! <- DESTROY= (not implemented) during global destruction DESTROY (dbih_clearcom) (drh 0x1b64c54 0x1adad4c, com 0x1adae54, i +mp DBD::ODBC::dr): FLAGS 0x215: COMSET Active Warn AutoCommit PARENT undef KIDS 0 (0 Active) IMP_DATA undef dbih_clearcom 0x1b64c54 (com 0x1adae54, type 1) done. ! <> DESTROY for DBI::dr=HASH(0x1b64c54) ignored (inner handle gone) *** Program output to STDERR **** Use of uninitialized value in concatenation (.) or string at c:/DEV/Pe +rl/site/li b/DBI.pm line 584. DBI connect('TEST3','',...) failed: at test.pl line 58 Could not connect to TEST3 >> [Pervasive][ODBC Client Interface][Clien +t LNA]The ODBC Client Interface cannot access the data source because the server + could not be located on the network. Contact your system administrator for assi +stance. (S QL-08S01) [Microsoft][ODBC Driver Manager] Drivrutinen kan inte hantera den vers +ion av ODB C-funktionalitet som programmet begõr (se SQLSetEnvAttr). (SQL-01000)( +DBD: db_lo gin/SQLConnect err=-1) *** Program start 2 ***** DBI 1.37-ithread dispatch trace level set to 8 -> DBI->connect(DBI:ODBC:TEST3, , ****) -> DBI->install_driver(ODBC) for MSWin32 perl=5.006001 pid=2684 ru +id=0 euid=0 install_driver: DBD::ODBC version 1.05 loaded from c:/DEV/Perl/ +site/lib/DBD/ODBC.pm New DBI::dr (for DBD::ODBC::dr, parent=, id=) dbih_setup_handle(DBI::dr=HASH(0x1b64c54)=>DBI::dr=HASH(0x1abf5ac) +, DBD::ODBC::dr, 0, Null!) dbih_make_com(Null!, 00000000, DBD::ODBC::dr, 92, 00000000) thr#01 +83F348 dbih_setup_attrib(DBI::dr=HASH(0x1abf5ac), Err, Null!) SCALAR(0x1a +dea14) (already defined) dbih_setup_attrib(DBI::dr=HASH(0x1abf5ac), State, Null!) SCALAR(0x +1adea68) (already defined) dbih_setup_attrib(DBI::dr=HASH(0x1abf5ac), Errstr, Null!) SCALAR(0 +x1adea38) (already defined) dbih_setup_attrib(DBI::dr=HASH(0x1abf5ac), TraceLevel, Null!) 0 (a +lready defined) dbih_setup_attrib(DBI::dr=HASH(0x1abf5ac), FetchHashKeyName, Null! +) 'NAME' (already defined) <- install_driver= DBI::dr=HASH(0x1b64c54) -> default_user in DBD::_::dr for DBD::ODBC::dr (DBI::dr=HASH(0x1b +64c54)~0x1abf5ac undef undef HASH(0x1b8f620)) thr#0183F348 <- default_user= ( undef undef ) [2 items] at c:/DEV/Perl/site/lib +/DBI.pm line 564 via test.pl line 58 -> connect for DBD::ODBC::dr (DBI::dr=HASH(0x1b64c54)~0x1abf5ac 'T +EST3' undef **** HASH(0x1abdf84)) thr#0183F348 *** Output to STDERR *** *** Link is now up *** *** Program start 3 *** DBI 1.37-ithread dispatch trace level set to 8 -> DBI->connect(DBI:ODBC:TEST3, , ****) -> DBI->install_driver(ODBC) for MSWin32 perl=5.006001 pid=2212 ru +id=0 euid=0 install_driver: DBD::ODBC version 1.05 loaded from c:/DEV/Perl/ +site/lib/DBD/ODBC.pm New DBI::dr (for DBD::ODBC::dr, parent=, id=) dbih_setup_handle(DBI::dr=HASH(0x1b64c54)=>DBI::dr=HASH(0x1abf5ac) +, DBD::ODBC::dr, 0, Null!) dbih_make_com(Null!, 00000000, DBD::ODBC::dr, 92, 00000000) thr#01 +83F348 dbih_setup_attrib(DBI::dr=HASH(0x1abf5ac), Err, Null!) SCALAR(0x1a +dea14) (already defined) dbih_setup_attrib(DBI::dr=HASH(0x1abf5ac), State, Null!) SCALAR(0x +1adea68) (already defined) dbih_setup_attrib(DBI::dr=HASH(0x1abf5ac), Errstr, Null!) SCALAR(0 +x1adea38) (already defined) dbih_setup_attrib(DBI::dr=HASH(0x1abf5ac), TraceLevel, Null!) 0 (a +lready defined) dbih_setup_attrib(DBI::dr=HASH(0x1abf5ac), FetchHashKeyName, Null! +) 'NAME' (already defined) <- install_driver= DBI::dr=HASH(0x1b64c54) -> default_user in DBD::_::dr for DBD::ODBC::dr (DBI::dr=HASH(0x1b +64c54)~0x1abf5ac undef undef HASH(0x1b8f620)) thr#0183F348 <- default_user= ( undef undef ) [2 items] at c:/DEV/Perl/site/lib +/DBI.pm line 564 via test.pl line 58 -> connect for DBD::ODBC::dr (DBI::dr=HASH(0x1b64c54)~0x1abf5ac 'T +EST3' undef **** HASH(0x1abdf84)) thr#0183F348 New DBI::db (for DBD::ODBC::db, parent=DBI::dr=HASH(0x1abf5ac), id +=) dbih_setup_handle(DBI::db=HASH(0x1abf570)=>DBI::db=HASH(0x1abdf78) +, DBD::ODBC::db, 1b6808c, Null!) dbih_make_com(DBI::dr=HASH(0x1abf5ac), 01ADAE54, DBD::ODBC::db, 22 +0, 00000000) thr#0183F348 dbih_setup_attrib(DBI::db=HASH(0x1abdf78), Err, DBI::dr=HASH(0x1ab +f5ac)) SCALAR(0x1b61c10) (already defined) dbih_setup_attrib(DBI::db=HASH(0x1abdf78), State, DBI::dr=HASH(0x1 +abf5ac)) SCALAR(0x1b61c70) (already defined) dbih_setup_attrib(DBI::db=HASH(0x1abdf78), Errstr, DBI::dr=HASH(0x +1abf5ac)) SCALAR(0x1b61c40) (already defined) dbih_setup_attrib(DBI::db=HASH(0x1abdf78), TraceLevel, DBI::dr=HAS +H(0x1abf5ac)) 0 (already defined) dbih_setup_attrib(DBI::db=HASH(0x1abdf78), FetchHashKeyName, DBI:: +dr=HASH(0x1abf5ac)) 'NAME' (already defined) dbih_setup_attrib(DBI::db=HASH(0x1abdf78), HandleError, DBI::dr=HA +SH(0x1abf5ac)) undef (not defined) <- connect= DBI::db=HASH(0x1abf570) at c:/DEV/Perl/site/lib/DBI.pm + line 582 -> STORE for DBD::ODBC::db (DBI::db=HASH(0x1abdf78)~INNER 'PrintEr +ror' 1) thr#0183F348 STORE DBI::db=HASH(0x1abdf78) 'PrintError' => 1 <- STORE= 1 at c:/DEV/Perl/site/lib/DBI.pm line 622 -> STORE for DBD::ODBC::db (DBI::db=HASH(0x1abdf78)~INNER 'AutoCom +mit' 1) thr#0183F348 <- STORE= 1 at c:/DEV/Perl/site/lib/DBI.pm line 622 -> STORE for DBD::ODBC::db (DBI::db=HASH(0x1abdf78)~INNER 'Usernam +e' undef) thr#0183F348 STORE DBI::db=HASH(0x1abdf78) 'Username' => undef <- STORE= 1 at c:/DEV/Perl/site/lib/DBI.pm line 625 <- connect= DBI::db=HASH(0x1abf570) -> STORE for DBD::ODBC::db (DBI::db=HASH(0x1abdf78)~INNER 'dbi_con +nect_closure' CODE(0x1abf4d4)) thr#0183F348 STORE DBI::db=HASH(0x1abdf78) 'dbi_connect_closure' => CODE(0x1abf +4d4) <- STORE= 1 at c:/DEV/Perl/site/lib/DBI.pm line 639 via test.pl li +ne 58 -> disconnect for DBD::ODBC::db (DBI::db=HASH(0x1abf570)~0x1abdf78 +) thr#0183F348 <- disconnect= 1 at test.pl line 61 <> DESTROY ignored for outer handle DBI::db=HASH(0x1abf570) (inner + DBI::db=HASH(0x1abdf78)) -> DESTROY for DBD::ODBC::db (DBI::db=HASH(0x1abdf78)~INNER) thr#0 +183F348 <- DESTROY= undef DESTROY (dbih_clearcom) (dbh 0x1abf570 0x1adad88, com 0x1abd424, i +mp DBD::ODBC::db): FLAGS 0x311: COMSET Warn PrintError AutoCommit PARENT DBI::dr=HASH(0x1abf5ac) KIDS 0 (0 Active) IMP_DATA undef dbih_clearcom 0x1abf570 (com 0x1abd424, type 2) done. -- DBI::END -> disconnect_all for DBD::ODBC::dr (DBI::dr=HASH(0x1b64c54)~0x1ab +f5ac) thr#0183F348 <- disconnect_all= '' at c:/DEV/Perl/site/lib/DBI.pm line 649 via +test.pl line 0 ! -> DESTROY for DBD::ODBC::dr (DBI::dr=HASH(0x1abf5ac)~INNER) thr#0 +183F348 ! <- DESTROY= (not implemented) during global destruction DESTROY (dbih_clearcom) (drh 0x1b64c54 0x1adad4c, com 0x1adae54, i +mp DBD::ODBC::dr): FLAGS 0x215: COMSET Active Warn AutoCommit PARENT undef KIDS 0 (0 Active) IMP_DATA undef dbih_clearcom 0x1b64c54 (com 0x1adae54, type 1) done. ! <> DESTROY for DBI::dr=HASH(0x1b64c54) ignored (inner handle gone)

zakzebrowski
Yes I've checked for timeouts and it's set for 15 secs. Which seem to be what I see for the first program invocation.

jdtoronto
Interesting idea, I would like it alot if you could elaborate on the pros of the SOAP solution compared to ODBC in this regard.

Replies are listed 'Best First'.
Re: Re: Timeout problems with DBI
by iburrell (Chaplain) on Sep 11, 2003 at 20:00 UTC
    The advantage of SOAP is that the SOAP server is on the database server. The ODBC connection is direct and does not have to worry about network issues. The disadvantage is that you would need to rewrite your application to use SOAP and move the database calls to the application server.

    Another option is DBI::Proxy. It is a pure Perl DBI proxy to remote server with its own DBI connection to the database. The big advantage is over SOAP is that the interface is DBI so you wouldn't have to rewrit your application.

Re: Re: Timeout problems with DBI
by zakzebrowski (Curate) on Sep 11, 2003 at 13:11 UTC
    Well, if you know it *should* exit, but doesn't... grab the pid, use win32::Process and win32::process::info , when you launch the process, grab a pid and start a 'watcher' process. If timeout > run time, do a Win32::Process::KillProcess on that process... As you suggest, it may be an odbc bug...
    Cheers & Good luck.

    ----
    Zak

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://290663]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2024-03-29 09:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found