You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Torsten Michelmann <to...@gmx.de> on 2006/10/10 16:52:41 UTC

StaleConnection handling

Hi,

we are running an app on WAS 6 using iBatis 2.1.7 that accesses a database on iSeries.
We use the toolbox driver (com.ibm.as400.access.AS400JDBCConnectionPoolDataSource) to perform the access to the database.
In general there is no problem, but in the morning (there is a DB backup during the night which causes DB2 to drop all connections) we get a com.ibm.websphere.ce.cm.StaleConnectionException on the first operation. The following operations will work.

Question: Am I forced to catch the StaleConnectionException and repeat the action in my DAO or is there a way to handle this problem by configuration?
-- 
TorstenGMX DSL-Flatrate 0,- Euro* - Überall, wo DSL verfügbar ist!
NEU: Jetzt bis zu 16.000 kBit/s! http://www.gmx.net/de/go/dsl

Re: StaleConnection handling

Posted by Jeff Butler <je...@gmail.com>.
With WebSphere 6 you no longer need to deal with StaleConnectionException -
WebSphere has support for pretesting the connections.  You need to make sure
that you are not using a V4 datasource, then you can configure WebSphere to
deal with it.  iBATIS, or your code, never needs to know about stale
connections.  Basically, you set up a "ping query" in the WebSphere
configuration.

Here's the page in the WebSphere info center that describes the
configuration:

http://publib.boulder.ibm.com/infocenter/wasinfo/v6r0/index.jsp?topic=/com.ibm.websphere.base.doc/info/aes/ae/tdat_pretestconn.html

Use the search string "pretest sql string" in the info center if the link
doesn't work.

Jeff Butler


On 10/10/06, Torsten Michelmann <to...@gmx.de> wrote:
>
> Hi,
>
> we are running an app on WAS 6 using iBatis 2.1.7 that accesses a database
> on iSeries.
> We use the toolbox driver (
> com.ibm.as400.access.AS400JDBCConnectionPoolDataSource) to perform the
> access to the database.
> In general there is no problem, but in the morning (there is a DB backup
> during the night which causes DB2 to drop all connections) we get a
> com.ibm.websphere.ce.cm.StaleConnectionException on the first operation.
> The following operations will work.
>
> Question: Am I forced to catch the StaleConnectionException and repeat the
> action in my DAO or is there a way to handle this problem by configuration?
> --
> TorstenGMX DSL-Flatrate 0,- Euro* - Überall, wo DSL verfügbar ist!
> NEU: Jetzt bis zu 16.000 kBit/s! http://www.gmx.net/de/go/dsl
>