Closing DBLINK connection
Java threads acquire a connection from a pool and execute transactions and give up the connection back to the pool when the transaction id finished. The pool maintains open connections to an oracle database DB1(say) which REMAIN OPEN after they are used. Some transactions cause a SELECT to use a DBLINK to another oracle database DB2(say) which causes a connection to be opened to DB2 from DB1 . Beacuse the pool connections are maintained in an open state to DB1 the connections from DB1 to DB2 are also left open and therefore accumulate.
The owners of DB2 are complaining about the number of open connections from DB1 to DB2 that are left open.
How would I alleviate this? Should I cause the DBLINK connection (from DB1 to DB2) to close every time the transaction completes? If so how would I achieve that?
Should I enforce a timeout on the DBLINK connection (DB1 to DB2) connection?
Please help.