Database Connection Pooling problem with Entity Beans


EJB programming & troubleshooting: Database Connection Pooling problem with Entity Beans

  1. I am using Weblogic 6.1 and Container Managed Entity Beans. The problem is, that the container doesnot manage the pool properly or it doesnot queue up requests when no free connections are available.
    I am running 'n' threads each of which call my entity_bean.find method. Now, if I have given my max-pool-size as n , then it works fine but if my max-pool-size < n then the (n - max-pool-size) threads fail because they are not able to connect to the database.
    Now, from what I understand of a pool, the manager should queue up requests when there are no free connections available in the pool. And, the pool manager in this case is the Container.

    Is there any parameters in any of the descriptors that I should set to get the required behaviour?

  2. Hi,

    A couple of thoughts come to mind,

    (i) Have you tried this with anything other than find methods?

    (ii) Is you number of JDBC connections bigger than the number of EJBs in the pool? This should not matter as your rerquests should be queued but I am curious,

    (iii) Have you a stack trace?
  3. How exactly do your run the threads? They are not user-created threads, are they?
  4. If you want WebLogic to block your callers when no connections are available, add the following properties to the connection pool definition through the WebLogic Console:


    Of course, you might want to try increasing the size of the connection pool so that enough connections are available. Otherwise, the performance of your application will suffer.

    Hope this helps,