books
Free Books / Computers / Practical mod_perl /

previous page: 20.1.3. Configuring Apache::DBI
  
page up: Practical mod_perl | by Stas Bekman and Eric Cholet
  
next page: 20.1.5. Caveats and Troubleshooting

20.1.4. Debugging Apache::DBI




Description

This section is from the "Practical mod_perl" book, by Stas Bekman and Eric Cholet. Also available from Amazon: Practical mod_perl

If you are not sure whether this module is working as advertised and that your connections are actually persistent, you should enable debug mode in the startup.pl script, like this:

$Apache::DBI::DEBUG = 1;

Starting with Apache::DBI Version 0.84, the above setting will produce only minimal output. For a full trace, you should set:

$Apache::DBI::DEBUG = 2;

After setting the DEBUG level, you will see entries in the error_log file. Here is a sample of the output with a DEBUG level of 1:

12851 Apache::DBI new connect to
'test::localhostPrintError=1RaiseError=0AutoCommit=1'

12853 Apache::DBI new connect to
'test::localhostPrintError=1RaiseError=0AutoCommit=1'

When a connection is reused, Apache::DBIstays silent, so you can see when a real connect( ) is called. If you set the DEBUG level to 2, you'll see a more verbose output. This output was generated after two identical requests with a single server running:

12885 Apache::DBI need ping: yes
12885 Apache::DBI new connect to
'test::localhostPrintError=1RaiseError=0AutoCommit=1'
12885 Apache::DBI need ping: yes
12885 Apache::DBI already connected to
'test::localhostPrintError=1RaiseError=0AutoCommit=1'

You can see that process 12885 created a new connection on the first request and on the next request reused it, since it was using the same connect( ) argument. Moreover, you can see that the connection was validated each time with the ping( ) method.

 

Continue to:

  • prev: 20.1.3. Configuring Apache::DBI
  • Table of Contents
  • next: 20.1.5. Caveats and Troubleshooting

Books by Stas Bekman:















TOP
previous page: 20.1.3. Configuring Apache::DBI
  
page up: Practical mod_perl | by Stas Bekman and Eric Cholet
  
next page: 20.1.5. Caveats and Troubleshooting

Topics

  • Animals
  • Architecture
  • Arts
  • Business
  • Computers
  • Crafts
  • Fairy Tales
  • Finance
  • Flora and Plants
  • Cooking
  • Gardening
  • Health and Healing
  • History
  • Home Improvements
  • Languages
  • New Age
  • Novels
  • Real Estate
  • Reference
  • Religion
  • Science
  • Society
  • Sports
  • Travel
  • Outdoors


Search

My Books

Headaches Begone! A Systemic Approach To Healing Your Headaches
Don't Let Your Bike Seat Ruin Your Sex Life Book

Discover

  • Answers FAQ

[ Privacy Policy | Terms of Use | About Us | Search ]

© 2007-2021 StasoSphere.com