Wednesday, February 21, 2007

ASP.Net Development server and Oracle db-link connection problem

In one of my app designs, I have an oracle package’s procedure in my web database (oracle) that accesses few other oracle databases using db-link and fetches me some product data. My code always opens the connection to my web database only. However, as I was running my code from my development server (built in to VS 2005) the remote databases got locked up because of too many db-link user connections being opened to them from my web database. This doesn’t happen if I use IIS but only through ASP.Net development server.

My code was clean enough to properly handle the connections, including closing and disposing. Upon few minutes of digging I realized that though I close my connections it’s the pooling that’s keeping my primary connection alive from the local server. That in turn keeps the db-link connection open and every time my code accesses the db-link 2 more new connections are opened and there you go… connections pile up to point to lock up the database.

Well, there might be better solutions to this problem but a quick one is to set pooling to false on my local machine. That forces the local server (local development server) to close my primary connection and thus clearing the db-link connections as well.

Will update with a better solutions or reason if I ever worry about this again and research further.

Love coding!

1 comment:

Sireesha Sakamuri said...
This comment has been removed by the author.