powered by Jive Software

Use the Database Connection Pool?

Hi,

I have a plugin that I’ve developed that does a lot of database accesses. The problem is that my code uses the openfire DbConnectionManager to get a connection from the openfire connection pool, and when the pool is full, openfire starts turning away users with the not-authorized message.

Should I be using the pool for my special database code, or should I reserve that for openfire to support basic jabber use? Maybe I should create my own database connections and not use the pool?

Thanks,

Max

Hi Max,

There’s nothing wrong with taking advantage of Openfire’s DbConnectionManager but as you’ve discovered you need to be careful when you do so don’t exhaust the number of connections that Openfire needs. A couple of things that you can try is to increase the number of database connections that Openfire has and/or optimize your use of the connections through the use of batching. You also want to make sure you’re closing all ResultSets, (Prepared)Statements and Connections.

Good luck,

Ryan