[eluser]OverZealous[/eluser] FYI: Significant bug in DMZ 1.6+
I've been doing some research on DB connections here. I was shocked because I had installed PGPOOL-II to increase database connection speed, and I disabled pconnect. But I kept having connection problems. I figured it was something misconfigured and did some research.
Well, there's a simple, but significant, flaw in the multiple DB connections that DMZ uses, combined with the way CodeIgniter handles Database objects: they never get closed!
What this means is that the connections just get used up until they time out.
In the short term, you can avoid this serious bug in one of two ways:
1) Make sure you use pconnect. This may be as bad as the original problem, but it has worked so far.
2) Disable the new DB functionality by setting db_params to false in your config file. This will break subqueries and include_related_count, however.
The patch I referred to above should fix it as well, since every single copy of the DB object will reference the same DB connection resource. This means that when CodeIgniter closes the DB connection on the main connection ($CI->db), it will effectively close them all.
I have some ideas for safe bandaid-style fix that I might be able to roll into 1.7.0 this week. However, I need to continue to do some testing.
If you have any input on this issue, it would be greatly appreciated.