web stats
Mirth Community - View Single Post - Best practices for managing DB connections and objects
View Single Post
  #2  
Old 04-18-2016, 10:39 AM
hugosoares2 hugosoares2 is offline
OBX.2 Kenobi
 
Join Date: May 2011
Posts: 64
hugosoares2 is on a distinguished road
Default

For managing DB connections my approch is to use a connection pool implmentation. In my case we UCP but you can use c3po or hikary (like mirth does). Opennign a db connection every time you need one is not advisable since it is a costly operation.

The approch is to mantain a global map with a reference to the Connection pool manager . This global map is initiated by some global deploy script that simply loads the connection pool if it is not already initiated.

Then I have a simple function (code template) that allows me to get a database connection whenever I need one. sysGetDbConnection(POOL_NAME). This function uses the global map to get a db connection from the pool.

We use ORACLE UNIVERSAL CONNECTION POOL has the connection pool implmentation. It is free and works well with ojdbc drivers.
Reply With Quote