-
1. Re: Releasing connection of entity beans
larry054 Oct 9, 2001 2:00 PM (in response to larry054)I forgot to mention: jboss 2.4.0, Oracle 8.1.7, Type 4 JDBC driver, Win NT4 SP6.
-
2. Re: Releasing connection of entity beans
p_d_austin Oct 10, 2001 5:03 AM (in response to larry054)This is the purpose of connection pools, the underlying connections stay areound and a reused between method calls. This give much greater performance as opening connections takes a lot of time.
What you can do tho to reduce the length of time the connections are held for is to enable the idle timeout on the datasource and set the timout to a value suitable for your application.
The documentation can be found at http://www.jboss.org/documentation/HTML/ch04s07.html .
The properties you need to set are 'IdleTimeoutEnabled' and 'IdleTimeout'.
Paul -
3. Re: Releasing connection of entity beans
larry054 Oct 10, 2001 8:30 AM (in response to larry054)p_d_austin,
Thank you for the reply, but I guess I didn't make myself clear. I understand the point about connection pools and I didn't expect the connection object to go away. The problem is that the Oracle server is showing the connections open even after the stateless session bean is history. After a few runs, I am out of connections in the pool and the bean fails.
I have reduced the time between garbage collections to get around this problem, but it seems there should be a way to force the connections to close immediately. Thanks for the help. -
4. Re: Releasing connection of entity beans
larry054 Oct 10, 2001 8:34 AM (in response to larry054)p_d_autstin,
I just read your answer again and maybe I am still misunderstanding the purpose of the pool. If the connections are supposed to stay open, then maybe the problem is that jboss isn't reusing them properly. The session bean should not fail for lack of available connections if there are 100 of them. -
5. Re: Releasing connection of entity beans
p_d_austin Oct 10, 2001 9:38 AM (in response to larry054)Are you closing the connections before you exit each method call. For any type of bean you should get a new connection from the pool and then close the connection (and any result sets and statements) before you exit from the method.
Paul -
6. Re: Releasing connection of entity beans
larry054 Oct 10, 2001 4:18 PM (in response to larry054)Duh, I looked at my entity beans again and they close connection only in unsetEntityContext(). Your explanation makes sense to me suddenly.
Thanks. -
7. Re: Releasing connection of entity beans
menggb Nov 11, 2001 12:02 PM (in response to larry054)Hi,
Did you get your problem fixed?
I saw the similar problem with my stateless session bean.
Jack