Closing database connection when die() in script

2 views
Skip to first unread message

Nikita

unread,
Apr 29, 2011, 10:10:12 AM4/29/11
to In-Portal Development Team
One recent project has shown, that having die() executed frequently in
code might cause database connection to "freeze", in other words -
this "dead" connection does not disconnect and as a result, maximum
allowed db connections becomes a cause for other sites, running on
same server, to receive "cannot connect to database server - maximum
allowed connections exceeded".
I propose handling database closure process within __destruct() method
inside of kDbConnection class, as this method should be executed even
if die() is called.

Dmitry A.

unread,
Apr 29, 2011, 2:32:32 PM4/29/11
to in-por...@googlegroups.com
Hi Nikita,


Thanks for reporting. Let's start with looking at your specific project needs since have justed tested a simple test on my end and MySQL Connections were closed as soon as script ended (with die).

Please email me directly so we can take a closer look at this.


Thanks.

DA

Dmitry A.

unread,
May 10, 2011, 4:35:17 PM5/10/11
to in-por...@googlegroups.com
I believe this might be a server issue (PHP4) since we have unsuccessfully tried replicating this on another copy.


DA
Reply all
Reply to author
Forward
0 new messages