Database Replication - Connection is not getting closed
Hi All, I am using Database Replication to connect to an external database. Type is custom. I am already closing the custom type. The problem is that the number of connections to the database is kept increasing and the connection is not getting closed. I am using java action - ImportByImportCall, to get data from external database. Please suggest me what could be the reason for Connection not getting closed.
I had a look at the Java code for this action. As you probably already knew, the database connection does not seem to be explicitly closed anywhere.
I do not know how big of an issue this is, and I suspect it may differ for different database drivers.
The solution for this would be to:
Use a database connection pool
Close connections after use (preferably by using a framework that does this for you)
Doing this will of course require changes to the database replication module and requires Java knowledge.
As a quick fix you may consider just closing the connection when it is no longer used. http://stackoverflow.com/questions/2225221/closing-database-connections-in-java includes a pattern to do this.