View Full Version : does log out close database connection?
I have been following up on an error during conversion of users to contacts during upgrade (already logged into Mantis).
In addition to that error, I encountered the following behaviour? Is it intended or a bug?
I copied a database to mysql/data, did the upgrade process which created 'empty' contacts (see mantis), logged into dp 2.1rc to look at the newly created contacts, logged out, tried to either delete the database directory (on Win XP) or drop the schema with Mysql Administrator. Both doesn't work. Is it possible that the database is still connected to dp after logout?
any help is appreciated
Klaus
Apache 2.0.48, Php 4.2.?, Win XP on this machine, IE6, all on localhost
chris_sara
21-03-07, 08:07 PM
Klaus,
I have been having an issue with 2.1rc1 as well regarding database connections. It appears to be intermittently creating a new connection with new pages but never closing any. As a result the database eventually complains of too many connections.
As I am using PHP5.2.0 and MYSQL5.0.26 I first though it may be a compatibility problem but after trying to fathom the connection code I am not so sure now. I am not familiar with the adodb library, more familiar with PEAR DB and DB2.
I went back and ran DP 4.0.2 and have noticed that while it does not accumulate connection like 2.1rc1, it does leave three connections after logging out.
I really cannot find anywhere in the code that releases the connections.
All that said, I have only been using DP for a few weeks but it looks like a usefully tool for my needs. I even wrote a module in quite a short time that interfaced to some other database access code I have running on a live database. This code accesses other databases using PEAR DB2. It really looks like a good basis for an integrated planing and management tool.
Regards
Chris
cyberhorse
22-03-07, 05:12 PM
there is system configuration whether to use persistent connections or not.
If you have persistent connections enabled, it is normal to have hanging connections left after logging out (although it should be only one).
chris_sara
23-03-07, 08:25 PM
Cyberhorse,
Thanks for the reply.
This thread discusses the same issue I have seen.
[URL="http://www.dotproject.net/vbulletin/showthread.php?t=6659"]
I have just spent some time trying to characterise what I am seeing and I'm now very confused. There appears to be a time related issue in that switching quickly between modules causes less connections to be generated that slowly switching.
Regards
Chris
caseydk
26-03-07, 12:49 AM
You should be able to delete a database via mysql regardless if there were users connected to it or not.... that's beyond dP.
cyberhorse
26-03-07, 10:35 AM
Can you please log this as a bug on mantis along with the notes from the original thread? It looks like there are some things that need to be followed up further, namely using pconnect when persistent connections are turned off
It is possible that this is an adodb bug - maybe there is an update from their site.
chris_sara
26-03-07, 01:47 PM
Ciberhorse,
The problem of persistent connections when dotProject is configured for non-persistent is in the permissions library, or more specifically, the way DP interfaces to it.
I added a bug report yesterday about the problem of the permissions library using persistent connections when dotProject is configured for non-persistent connections. The bug report also includes a relatively easy fix, but I am not sure about full backwards compatibility with old versions of PHP4.
The thread http://www.dotproject.net/vbulletin/showthread.php?t=6659
Also included some detail on why some people are having difficulty with persistent connections. In reality there is no one set up suits all or for that matter will work for all on a service providers web server.
There is also a thread
http://www.dotproject.net/vbulletin/showthread.php?t=6291
which raises the problem but has not got to the bottom of it.
I hope this all helps. I certainly learnt a lot about persistent connections and the traps for the uninitiated in the process.
Regards
Chris
cyberhorse
29-03-07, 12:36 AM
thanks for all your help and investigations
I saw the bug report and I'll apply the suggestion shortly.
chris_sara
29-03-07, 01:01 PM
Cyberhorse,
I had a look at a later version of the acl library.
It also has a Pconnect hard coded in when there is not an existing ADODB object passed to it at construct time.
Regards
Chris
cyberhorse
02-04-07, 04:06 PM
can you make a new bug request for that? I've closed your previous report as fixed already - it's in stable_2 and HEAD
chris_sara
02-04-07, 06:37 PM
can you make a new bug request for that? I've closed your previous report as fixed already - it's in stable_2 and HEAD
Cyberhorse,
Perhaps I should clarify my last post.
phpgacl always uses a pconnect if it is passed the database connection information (database, user name, password etc). It looks like it has always been this way and certinally is in 3.3.7.
However on dotProject, a connection is always created when "/includes/db_connect.php" is called near the beginning on index.php.
The change you have done makes sure this connection is passed to the gacl class so there should not be a problem. I wonder whether, as some assurance, the connections parameters should not be passed to gacl so it can't use the pconnect
Regards
Chris
cyberhorse
03-04-07, 05:21 PM
we try very hard not to change any code in the external libraries as that makes supporting them a nightmare ...
vBulletin® v3.6.4, Copyright ©2000-2013, Jelsoft Enterprises Ltd.