I have a webapp which uses connection pooling to get connections for 
data-retrieval.

For some odd reason, I get StaleConnectionExceptions when I load my 
application
 again after some time.  (all browserwindows closed wich means new session 
is build)

I got some tips about:
- ptf's
 ==> which are loaded
- idle timeout
 ==> should be ok (default values used)
 ==> application is 'loaded' again, so no timeout involved
- connection has been orphaned
 ==> application is 'loaded' again, getting data is one of first steps
- adjust firewall/router time out
 ==> application is 'loaded' again, so no timeout involved
- lower TCP keepalive on iSeries
 ==> is on 30min.  
 ==> application is 'loaded' again, so timeout involved
- DBMS is running
 ==> sure it is, WAS is running on our production system
- application previously closed connection
 ==> no!  

This is what happens (in short)
- load application
- load jsp
   - databean initialized
      - method excecuted to retrieve data
         - get connection from pool
         - ResultSet rs = null;
         - PreparedStatement myPS = connection.prepareStatement("SELECT * 
FROM CDEXPED.EPSIGSIG WHERE ESFIMA=? AND ESKODE=? AND ESSTOK=?");
         - rs = myPS.executeQuery();  (in a try-catch block)
         - close connection
   - put data into selectionbox
- display jsp
- close application

Finally I found a message in the 
'ibm.software.websphere.application-server' newsgroup
which says to close resultsets and prepared statements and connections or 
you risk the
StaleConnectionException to be thrown...
Well, I have to admit, I alway's close connections but never resultsets 
neither prepared statements
 
Is this true, do I really have to close RS + PS + CONNECTION?
Who can give me some explanation on this? 

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.