Title: Exception Sorter Information

Hi All,

I have implemented an ExceptionSorter for my AS400 connection.

The reconnect works, eventually, but only after it fails one time to recreate the connection.

In other words, when the connection is lost, I get an error when reusing the connection. Then after another attempt it manages to reconnect again. Is this the normal behaviour?

Here is the configuration of my datasource
<datasources>
<local-tx-datasource>
<jndi-name>ODCDTA</jndi-name>
<connection-url>jdbc:as400:<<IP-ADDRESS>>/ODCDTA;Libraries=ODCDTA</connection-url>
<driver-class>com.ibm.as400.access.AS400JDBCDriver</driver-class>
<idle-timeout-minutes>5</idle-timeout-minutes>
<application-managed-security/>
<exception-sorter-class-name>com.odc.server.jboss.jdbc.AS400ExceptionSorter</exception-sorter-class-name>
</local-tx-datasource>
</datasources>


and here is the content of the isExceptionFatal method of my exception sorter
public boolean isExceptionFatal(SQLException e)
{
boolean ret = false;

if(e != null && e.getSQLState() != null)
ret = (e.getSQLState().equals("08003") || e.getSQLState().equals("08S01") || e.getSQLState().equals("40003"));

if(ret)
getLogger().debug("Connection closed by AS400. SQLState=(" + e.getSQLState() + "). Forcing reconnect. Error recieved:\n" + e.getMessage());

return ret;
}

Is the above implementation correct?

Ricardo


__________________________________________________________________________
· This email and any files transmitted with it are CONFIDENTIAL and intended
solely for the use of the individual or entity to which they are addressed.

· Any unauthorized copying, disclosure, or distribution of the material within
this email is strictly forbidden.

· Any views or opinions presented within this e-mail are solely those of the
author and do not necessarily represent those of Odyssey Asset Management
Systems SA unless otherwise specifically stated.

· An electronic message is not binding on its sender.  Any message referring to
a binding engagement must be confirmed in writing and duly signed.

· If you have received this email in error, please notify the sender immediately
and delete the original.

Reply via email to