books
Free Books / Computers / Practical mod_perl /

previous page: 20.2.1. Preopening DBI Connections
  
page up: Practical mod_perl | by Stas Bekman and Eric Cholet
  
next page: 20.2.3. Efficient Record-Retrieval Techniques

20.2.2. Improving Speed by Skipping ping( )




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 use Apache::DBI and want to save a little bit of time, you can change how often the ping( ) method is called. The following setting in a startup file:

Apache::DBI->setPingTimeOut($data_source, $timeout)

will change this behavior. If the value of $timeout is 0, Apache:DBI will validate the database connection using the ping( ) method for every database access. This is the default. Setting $timeout to a negative value will deactivate the validation of the database handle. This can be used for drivers that do not implement the ping( ) method (but it's generally a bad idea, because you don't know if your database handle really works). Setting $timeout to a positive value will ping the database on access only if the previous access was more than $timeoutseconds earlier.

$data_source is the same as in the connect( ) method (e.g., DBI:mysql:...).

 

Continue to:

  • prev: 20.2.1. Preopening DBI Connections
  • Table of Contents
  • next: 20.2.3. Efficient Record-Retrieval Techniques

Books by Stas Bekman:















TOP
previous page: 20.2.1. Preopening DBI Connections
  
page up: Practical mod_perl | by Stas Bekman and Eric Cholet
  
next page: 20.2.3. Efficient Record-Retrieval Techniques

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