Re: Apache::DBI connect

2013-11-11 Thread Perrin Harkins
On Fri, Nov 8, 2013 at 2:58 PM, Xinhuan Zheng xzh...@christianbook.comwrote: The query is from the application code not the 'select 1' test query. OK, then it seems like Apache::DBI may not have a problem. While most of time I saw Apache::DBI-connect is called but sometime from a process

Re: Apache::DBI connect

2013-11-11 Thread Xinhuan Zheng
connect On Fri, Nov 8, 2013 at 2:58 PM, Xinhuan Zheng xzh...@christianbook.commailto:xzh...@christianbook.com wrote: The query is from the application code not the 'select 1' test query. OK, then it seems like Apache::DBI may not have a problem. While most of time I saw Apache::DBI-connect

Re: Apache::DBI connect

2013-11-08 Thread Perrin Harkins
in Apache::DBI? Or something else in your own code? We use Apache::DBI and DBI and use Apache::DBI is before DBI. We actually call DBI-connect_cached and based on DBI document, I guess this would be handled by Apache::DBI connect. Yes, it should be. However, I guess we also defined a base class

Re: Apache::DBI connect

2013-11-08 Thread Xinhuan Zheng
Hi Perrin, The query is from the application code not the 'select 1' test query. While most of time I saw Apache::DBI-connect is called but sometime from a process, it will print out it finds a cached connection and ping is ok but sometimes from the same process it didn't find a cached

Re: Apache::DBI connect

2013-11-07 Thread Perrin Harkins
From: Perrin Harkins phark...@gmail.com Date: Wednesday, November 6, 2013 5:54 PM To: Xinhuan Zheng xzh...@christianbook.com Cc: mod_perl list modperl@perl.apache.org Subject: Re: Apache::DBI connect On Wed, Nov 6, 2013 at 4:07 PM, Xinhuan Zheng xzh

Re: Apache::DBI connect

2013-11-07 Thread Xinhuan Zheng
: Apache::DBI connect Have you used the DRCP settings in DBD::Oracle? http://search.cpan.org/~pythian/DBD-Oracle-1.66/lib/DBD/Oracle.pm#Oracle_DRCP From the description of DRCP, it sounds like you should never lose the connection. You may want to check the configuration. From your debugging

Re: Apache::DBI connect

2013-11-07 Thread Perrin Harkins
On Thu, Nov 7, 2013 at 9:46 AM, Xinhuan Zheng xzh...@christianbook.com wrote: The $ok is undef. In the case if the test does succeed (like the first select), $ok returns 0E0. That all sounds good. 0E0 is a true value in Perl. It means zero but true. And undef is a false value. You don't need

Re: Apache::DBI connect

2013-11-07 Thread Xinhuan Zheng
: Perrin Harkins phark...@gmail.commailto:phark...@gmail.com Date: Thursday, November 7, 2013 11:00 AM To: Xinhuan Zheng xzh...@christianbook.commailto:xzh...@christianbook.com Cc: mod_perl list modperl@perl.apache.orgmailto:modperl@perl.apache.org Subject: Re: Apache::DBI connect On Thu, Nov 7

Re: Apache::DBI connect

2013-11-07 Thread Xinhuan Zheng
: mod_perl list modperl@perl.apache.orgmailto:modperl@perl.apache.org Subject: Re: Apache::DBI connect I don't actually understand why you did that. What was wrong with the normal ping? With Oracle DRCP, even though ping succeeds, the connection to the server process is actually terminated

Re: Apache::DBI connect

2013-11-07 Thread Adam Prime
Subject: Re: Apache::DBI connect I don't actually understand why you did that. What was wrong with the normal ping? With Oracle DRCP, even though ping succeeds, the connection to the server process is actually terminated. Or ora_ping() may return 0E0 zero but true and undef. I don't know

Re: Apache::DBI connect

2013-11-07 Thread Xinhuan Zheng
To: Perrin Harkins phark...@gmail.com mailto:phark...@gmail.com Cc: mod_perl list modperl@perl.apache.org mailto:modperl@perl.apache.org Subject: Re: Apache::DBI connect I don't actually understand why you did that. What was wrong with the normal ping? With Oracle DRCP, even though ping

Re: Apache::DBI connect

2013-11-07 Thread Perrin Harkins
@perl.apache.org Subject: Re: Apache::DBI connect I don't actually understand why you did that. What was wrong with the normal ping? With Oracle DRCP, even though ping succeeds, the connection to the server process is actually terminated. Or ora_ping() may return 0E0 zero but true and undef. I

Re: Apache::DBI connect

2013-11-07 Thread Xinhuan Zheng
@perl.apache.orgmailto:modperl@perl.apache.org Subject: Re: Apache::DBI connect It is in the DBI documentation. Search for 0E0. - Perrin On Thu, Nov 7, 2013 at 12:41 PM, Xinhuan Zheng xzh...@christianbook.commailto:xzh...@christianbook.com wrote: So it returns string '0E0'? The document didn't say that. - xinhuan

Re: Apache::DBI connect

2013-11-07 Thread Perrin Harkins
Prime adam.pr...@utoronto.ca, modperl@perl.apache.org modperl@perl.apache.org Subject: Re: Apache::DBI connect It is in the DBI documentation. Search for 0E0. - Perrin On Thu, Nov 7, 2013 at 12:41 PM, Xinhuan Zheng xzh...@christianbook.comwrote: So it returns string '0E0

Re: Apache::DBI connect

2013-11-07 Thread Xinhuan Zheng
...@utoronto.camailto:adam.pr...@utoronto.ca, modperl@perl.apache.orgmailto:modperl@perl.apache.org modperl@perl.apache.orgmailto:modperl@perl.apache.org Subject: Re: Apache::DBI connect Sorry, I can't determine the problem from your log. You'll need to either run it in the debugger or add some debugging print statements

Re: Apache::DBI connect

2013-11-07 Thread Perrin Harkins
of or instead of and? - xinhuan From: Perrin Harkins phark...@gmail.com Date: Thursday, November 7, 2013 3:05 PM To: Xinhuan Zheng xzh...@christianbook.com Cc: Adam Prime adam.pr...@utoronto.ca, modperl@perl.apache.org modperl@perl.apache.org Subject: Re: Apache::DBI connect Sorry

Re: Apache::DBI connect

2013-11-07 Thread Xinhuan Zheng
but sometimes the query would fail. We use Apache::DBI and DBI and use Apache::DBI is before DBI. We actually call DBI-connect_cached and based on DBI document, I guess this would be handled by Apache::DBI connect. However, I guess we also defined a base class that can store a database handle

Apache::DBI connect

2013-11-06 Thread Xinhuan Zheng
Hi, I am using Apache+mod_perl and Apache::DBI with Oracle connection pooling feature. I noticed a problem with subroutine connect. Below code checks database connection: 200:if ($Connected{$Idx} and (!$needping or eval{$Connected{$Idx}-ping})) { debug(2, $prefix already connected

Re: Apache::DBI connect

2013-11-06 Thread Perrin Harkins
On Wed, Nov 6, 2013 at 4:07 PM, Xinhuan Zheng xzh...@christianbook.comwrote: I wonder this line of code should be changed to 'DBI-connect(@args) if ($@)'. If ping failed, that means the connection is already closed, $drh may be no longer valid, will $drh-connect always return a valid new

Re: Apache::DBI connect

2013-11-06 Thread Xinhuan Zheng
...@christianbook.commailto:xzh...@christianbook.com Cc: mod_perl list modperl@perl.apache.orgmailto:modperl@perl.apache.org Subject: Re: Apache::DBI connect On Wed, Nov 6, 2013 at 4:07 PM, Xinhuan Zheng xzh...@christianbook.commailto:xzh...@christianbook.com wrote: I wonder this line of code should