IT Community - Software Programming, Web Development and Technical Support

Can any one explain about the Persistent Database Connections in php?

This is a discussion on Can any one explain about the Persistent Database Connections in php? within the PHP Programming forums, part of the Web Development category; Can any one help me to know about the Persistent Database Connections in php? Thanks Falcon...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > PHP Programming

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 11-03-2007, 02:38 AM
Falcon Falcon is offline
D-Web Analyst
 
Join Date: Nov 2007
Location: Chennai
Posts: 289
Falcon is on a distinguished road
Default Can any one explain about the Persistent Database Connections in php?

Can any one help me to know about the Persistent Database Connections in php?

Thanks
Falcon
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 11-04-2007, 10:04 PM
$enthil $enthil is offline
D-Web Sr.Programmer
 
Join Date: Apr 2007
Posts: 162
$enthil is on a distinguished road
Smile Re: Can any one explain about the Persistent Database Connections in php?

Persistent connections are SQL links that do not close when the execution of your script ends. When a persistent connection is requested, PHP checks if there's already an identical persistent connection (that remained open from earlier) - and if it exists, it uses it. If it does not exist, it creates the link. An 'identical' connection is a connection that was opened to the same host, with the same username and the same password (where applicable).
__________________
$enthil
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 11-08-2007, 09:32 PM
Jeyaseelansarc Jeyaseelansarc is offline
D-Web Genius
 
Join Date: Mar 2007
Location: Chennai
Posts: 1,162
Jeyaseelansarc is on a distinguished road
Send a message via AIM to Jeyaseelansarc
Default Re: Can any one explain about the Persistent Database Connections in php?

To know more on this
Kindly go to PHP: Persistent Database Connections - Manual
__________________
With,
J. Jeyaseelan

Everything Possible
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 11-12-2007, 09:43 PM
Falcon Falcon is offline
D-Web Analyst
 
Join Date: Nov 2007
Location: Chennai
Posts: 289
Falcon is on a distinguished road
Default Re: Can any one explain about the Persistent Database Connections in php?

Thanks For the information about Persistent Database Connection. A doubt arise for me. Then why dont we use that Persistent Database Connection. what is it drawback buddies

Thanks
Falcon
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 11-12-2007, 11:56 PM
varghese varghese is offline
D-Web Programmer
 
Join Date: Feb 2007
Posts: 93
varghese is on a distinguished road
Thumbs up Re: Can any one explain about the Persistent Database Connections in php?

Drawbacks of Persistent Connections
If you are using a database with connection limits that are exceeded by persistent child connections. If your database has a limit of 16 simultaneous connections, and in the course of a busy server session, 17 child threads attempt to connect, one will not be able to. If there are bugs in your scripts which do not allow the connections to shut down (such as infinite loops), the database with only 16 connections may be rapidly swamped. Check your database documentation for information on handling abandoned or idle connections.

There are a couple of additional caveats to keep in mind when using persistent connections. One is that when using table locking on a persistent connection, if the script for whatever reason cannot release the lock, then subsequent scripts using the same connection will block indefinitely and may require that you either restart the httpd server or the database server.
Another is that when using transactions, a transaction block will also carry over to the next script which uses that connection if script execution ends before the transaction block does. In either case, you can use register_shutdown_function() to register a simple cleanup function to unlock your tables or roll back your transactions. Better yet, avoid the problem entirely by not using persistent connections in scripts which use table locks or transactions (you can still use them elsewhere).
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Create connections between your ColdFusion Web sites and databases? vigneshgets ColdFusion Programming 3 11-26-2008 02:42 AM
Difference between Regular database connection and Persistent Database Connections? Falcon PHP Programming 1 11-03-2007 05:13 AM
What Is a Persistent Cookie? Sabari PHP Programming 19 09-21-2007 08:29 AM
# What is the role of the DataReader class in ADO.NET connections? anbuchezhians VB.NET Programming 1 07-27-2007 02:44 AM
I need to find out how many client connections were aborted by MySQL server Sabari Database Support 1 07-17-2007 04:34 AM


All times are GMT -7. The time now is 06:11 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0