This discussion is archived
1 Reply Latest reply: Jun 9, 2011 12:02 AM by 652803 RSS

J2E CA 1.0 Resource Adapter connection pool

666794 Newbie
Currently Being Moderated
I have deployed a J2E CA 1.0 Resource Adapter on Weblogic 11g and created a connection pool. Today I tested what would happen if I "created" some network problems. This is what I did:

1. Set the connection pool as follows (to make sure I used the same connection instance the entire time)
<pool-params>
<initial-capacity>1</initial-capacity>
<max-capacity>1</max-capacity>
<capacity-increment>1</capacity-increment>
<shrinking-enabled>false</shrinking-enabled>
<shrink-frequency-seconds>300</shrink-frequency-seconds>
<highest-num-waiters>100</highest-num-waiters>
<highest-num-unavailable>0</highest-num-unavailable>
<connection-creation-retry-frequency-seconds>1</connection-creation-retry-frequency-seconds>
<connection-reserve-timeout-seconds>20</connection-reserve-timeout-seconds>
<test-frequency-seconds>0</test-frequency-seconds>
<test-connections-on-create>false</test-connections-on-create>
<test-connections-on-release>false</test-connections-on-release>
<test-connections-on-reserve>false</test-connections-on-reserve>
<match-connections-supported>true</match-connections-supported>
</pool-params>

2. Make a request and verify that everything is ok
3. Remove network cable from computer and wait 5 sec
4. Insert network cable and wait 10 sec
5. Make a request
--> What happened here is that I got a error message: "Connection reset by peer: socket write error"
6. Make a new request
--> This request went ok

To conclude it does not look like Weblogic automatically throws away and recreates the connection in the pool when there are network issues. Is there a way to configure Weblogic to do this? I would like Weblogic to do this:
Client: +"Give me a connection from the pool please!"+
Weblogic: "+Ah! Wait a minute. There have been some network issues since the last time someone someone asked me about a connection. To be on the safe side, let me throw away the existing connections and recreate some new ones. Here you go, one fresh connection!"+
Client: +"Thankyou!"+

Or this:
Client: +"Give me a connection from the pool please!"+
Weblogic: +"Ok, but let me test it for you first. Ah! It seems to be bad. I will throw away all my connections now and create new ones. Here you go, one fresh connection!"+
Client: +"Thankyou!"+

The adapter (JCA 1.0) I am using does not support testing and hence none of the <test-*> options for connection pooling.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points