File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes BEA/Weblogic and the fly likes DB Connection Pool refresh Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "DB Connection Pool refresh" Watch "DB Connection Pool refresh" New topic
Author

DB Connection Pool refresh

Aswani Kommireddy
Greenhorn

Joined: Jul 16, 2008
Posts: 4

I have few questions regarding DB connection pool refresh (stop and start the connection pool). ***Below questions are applicable only when there is no server restart happenning.
In what cases do we have to refresh the Database Connection pool -
1. Do we have to refresh if there are some changes to the tables and views that we query change, like new columns are added/exposed?
2. What if a new package was introduced and we refer to that package in the application?
3. What if an existing package was modified and the parameters that were passed to the procedure from our application were also changed?
4. What if an existing package was modified and recompiled but parameters that were passed to the procedure from our application were not changed?
5. We connect to a database say XYZ from the application server. A procedure in XYZ that was called from our application internally connects to some other databse ABC and accesses a procedure in it. What if that procedure in ABC changes, do we still have to refresh the connection pool?

Finally,
Ours is clustered environment. If we stop all servers first and then start one after another, then in that case I believe we need not refresh the connection pool because server restart will take care of it(correct me if I am wrong). If we do rolling restart (once server after another, not normal restart), do we still have to refresh the DB Connection pool in the above mentioned scenarios?

Thanks in Advance
Shashank Ag
Ranch Hand

Joined: Dec 22, 2009
Posts: 88

Hi Aswani,

The connection refresh mainly determines stale connections and remove them. Then creates as many connections which are sufficient to meet minimum connection specified in data source. I can't get equivalent weblogic link but you can see this for stale connections.

Besides, I didn't got you any of package questions, what do you mean by package?

Finally, in a clustered environment each server serving i.e. node will have its own set of connections. So, restartig a node in whichever way you do will refresh connection itself.


SCJP 91%, SCWCD 97%
Aswani Kommireddy
Greenhorn

Joined: Jul 16, 2008
Posts: 4
Thank you for your reply. I will go through that article.

For your question "what do you mean by package?"
I meant PL/SQL package (Procedures and functions). Sorry that I was not clear.
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6662
    
    5

1. Do we have to refresh if there are some changes to the tables and views that we query change, like new columns are added/exposed?


No

2. What if a new package was introduced and we refer to that package in the application?


No refresh required

3. What if an existing package was modified and the parameters that were passed to the procedure from our application were also changed?


No refresh required

4. What if an existing package was modified and recompiled but parameters that were passed to the procedure from our application were not changed?


No refresh required

5. We connect to a database say XYZ from the application server. A procedure in XYZ that was called from our application internally connects to some other databse ABC and accesses a procedure in it. What if that procedure in ABC changes, do we still have to refresh the connection pool?


No refresh required

A connection pool simply offers a pool of connections to the underlying persistence store. It is not bound to the data / schema in the store in any way. Of course you can get a connection that belongs to a schema, but the point I am trying to make is, a DB refresh is not needed unless the DB went down and all the connections in the pool are lost and cannot be reclaimed.


SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
Tarun Boyella
Greenhorn

Joined: Jun 15, 2009
Posts: 6
To your question datasource contains a pool of database connections that are created (min and max connections) when the data source instantiated at server startup.

Applications use connection pool in datasource and then request a database connection. When finished with the connection, the application calls connection.close(), which returns the connection opened to database back to the connection pool in the data source.

When you do rolling restart connections opened to DB from datasource are closed and instantiated again.

Hope this helps.

- Tarun
Aswani Kommireddy
Greenhorn

Joined: Jul 16, 2008
Posts: 4
When the pl/sql packages that our application executes are recompiled, we have to restart our connection pools. Otherwise we are seeing exceptions. Once we restart our connection pools then everything is working as expected.

Is there a setting in Weblogic to get new connections when the existing connections are stale without us restarting the connection pools?
Praveen RajKumar
Greenhorn

Joined: Aug 23, 2012
Posts: 6
Hi,

We are using WL8 to deploy our applications.Soon we are going to migrating to 10.x.
Here my problem is we have a connection pool in wl8 server whose allowed connections limit is 40.
Whenever it reaches the count of 40 it is bringing the managed server down.
So to eradicate this issue we are daily monitoring the connections count and restarting managed server as and when it reaches 30.

So,to minimize our efforts we thought to write a script which will calculate the connection count on hourly basis,and restart the managed server when the connection count reached to 30.

What will be the best option for this problem.

thanks
Praveen
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: DB Connection Pool refresh