well, I am not a MySQL user (Oracle instead) so I don't understand why 6
connections would be opened for 1 script. However, to make sure we are on
the same page...
1) debug in single server mode - I'm sure you realize that Apache::DBI
creates one connection per httpd child, not just one connection that is
shared by all httpd processes.
2) use $Apache::DBI::DEBUG = 2 in your startup.pl script and tail your
apache error_log to see if your script is really creating a new connect for
each script execution
3) I didn't see you loading DBI as either a PerlModule or in your startup.pl
- maybe you just trimmed the script for the list? Make sure that 'use
Apache::DBI;' appears before 'use DBI;'
I doubt that IE and Netscape are treating your DBI connection differently...
do some more research and let me know what you find...
--Geoff
> -----Original Message-----
> From: vinecent hong [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, January 27, 2000 10:30 AM
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Subject: Re: help me under those Apache::DBI log info.
>
>
> Thank you,Geoffrey.What you said about using "the same
> conenct string" I
> also read from the perl.apache.org/guide.the problem is ,I
> just click the
> REFRESH button of the browser to reload the SAME perl
> script.and everytime I
> reload it,it create a new mysql connection,why?
>
> I did set the DBI->trace stuff and read the log
> completely.but its too long
> to copy here.briefly,I find out weird problem in the log,look:
> ----------------------------------------------------------------------
> DBI 1.13-nothread dispatch trace level set to 2
> ->
> DBI->Apache::DBI::connect(DBI:mysql:database=uwang;host=localh
> ost, uwang)
> -> DBI->install_driver(mysql) for perl=5.00503 pid=9374
> ruid=99 euid=99
> install_driver: DBD::mysql loaded (version 2.0410)
> <- install_driver= DBI::dr=HASH(0x81fcf90)
> <- FETCH= 'mysql' ('Name' from cache) at DBI.pm line 64.
> -> connect for DBD::mysql::dr (DBI::dr=HASH(0x81fcf90)~0x82c3ae0
> 'database=uwang;host=localhost' 'uwang' '
> uwang' HASH(0x82d8f04))
> imp_dbh->connect: dsn = database=uwang;host=localhost, uid =
> uwang, pwd =
> uwang
> imp_dbh->MyLogin: dbname = uwang, uid = uwang, pwd =
> uwang,host = localhost,
> port = NULL
> imp_dbh->MyConnect: host = localhost, port = 0, uid = uwang,
> pwd = uwang
> imp_dbh->MyConnect: client_flags = 0
> <- connect= DBI::db=HASH(0x82c3b64) at DBI.pm line 120.
> -> STORE for DBD::mysql::db (DBI::db=HASH(0x82ace98)~INNER
> 'PrintError' 1)
> <- STORE= 1 at DBI.pm line 407.
> -> STORE for DBD::mysql::db (DBI::db=HASH(0x82ace98)~INNER
> 'AutoCommit' 1)
> <- STORE= 1 at DBI.pm line 407.
> <- connect= Apache::DBI::db=HASH(0x82c3b64)
>
> ........blah blah,some query info.
> ----------------------------------------------------------------------
> Above info is what put in the log when first time run the
> script.I think
> it's print out while generate a new mysql connection.
> BUT,when I reload the
> script,above info APPEAR AGAIN! so,I think it just create
> another mysql
> connection.Mind tell me why??????? Since I just execute same script
> twice,sure the mysql connect string is the same,and in my code,its :
> my
> $dbh=DBI->connect('DBI:mysql:database=uwang;host=localhost','u
> wang','uwang');
>
> I really didn't GET any clue about this! and Can't find ANY
> document to
> explain what does those info means.maybe Doug could write one?
>
>
> and another weird problem is,I open IE and netscape at same
> time to execute
> the script,same totally it generate 6 mysql connection,now
> strange info
> comes.when I check mysql connection status via mysqladmin
> processlist,I find
> out SOME DBH is reused!!!! and its look like that,when I
> refresh IE,it reuse
> id 122 connection and when I refresh netscapem,it just reuse
> the id 100
> connection.wow...how come??? does this problem associate with
> the KeepAlive
> of httpd.conf?? for example,IE request apache create a child
> and this child
> create a connection and when I execute other script in this
> ie window,it
> will reuse the connectioon THIS CHILD create just now??
>
> [hongli@internal slash]$ mysqladmin -u root processlist
> +-----+-------+-----------+-------+-----------+------+-------+------+
> | Id | User | Host | db | Command | Time | State | Info |
> +-----+-------+-----------+-------+-----------+------+-------+------+
> | 100 | uwang | localhost | uwang | Sleep | 279 | | |
> | 106 | uwang | localhost | uwang | Sleep | 345 | | |
> | 122 | uwang | localhost | uwang | Sleep | 9 | | |
> | 125 | uwang | localhost | uwang | Sleep | 52 | | |
> | 130 | uwang | localhost | uwang | Sleep | 368 | | |
> | 132 | uwang | localhost | uwang | Sleep | 690 | | |
> | 154 | uwang | localhost | uwang | Sleep | 43 | | |
> | 156 | root | localhost | | Processes | 0 | | |
> +-----+-------+-----------+-------+-----------+------+-------+------+
> [hongli@internal slash]$ mysqladmin -u root processlist
> +-----+-------+-----------+-------+-----------+------+-------+------+
> | Id | User | Host | db | Command | Time | State | Info |
> +-----+-------+-----------+-------+-----------+------+-------+------+
> | 100 | uwang | localhost | uwang | Sleep | 4 | | |
> | 106 | uwang | localhost | uwang | Sleep | 355 | | |
> | 122 | uwang | localhost | uwang | Sleep | 19 | | |
> | 125 | uwang | localhost | uwang | Sleep | 62 | | |
> | 130 | uwang | localhost | uwang | Sleep | 378 | | |
> | 132 | uwang | localhost | uwang | Sleep | 700 | | |
> | 154 | uwang | localhost | uwang | Sleep | 53 | | |
> | 157 | root | localhost | | Processes | 0 | | |
> +-----+-------+-----------+-------+-----------+------+-------+------+
>
>
> HELP,I am reallly BLUE now
>
> ______________________________________________
> FREE Personalized Email at Mail.com
> Sign up at http://www.mail.com?sr=mc.mk.mcm.tag001
>