ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andre Peterka" <apete...@nsdcom.de>
Subject Socket write error
Date Fri, 19 Nov 2004 16:45:18 GMT
Hi all

One customer reported a problem to us, that they are getting the following
error message:

com.ibatis.dao.client.DaoException: Error executing
query for object.  Cause: java.sql.SQLException: Io exception: Connection
reset by peer: socket write error

The cause is a restart of the Database while the application is still

The transactionManager is configured via
 <transactionManager type="JDBC" >
	<dataSource type="JNDI">
		<property name="DataSource"

Oracle suggest something like the following, when using TopLink, to
reestablish a connection:

	if (clientSession != null)
			db = clientSession;

		if (db == null || !db.isConnected()) {

			logger.info("Login Info:  trying to connect to
ClientSession ...");

			ServerSession server = (ServerSession)
			db = server.acquireClientSession();
			clientSession = db;

		db.setExceptionHandler(new ExceptionHandler() {
			public Object handleException(RuntimeException
exception) {
				if (logger.isDebugEnabled()) {
logger.debug("handleException(RuntimeException) - start");

				if ((exception instanceof DatabaseException)
reset by peer") > 0)) {
					DatabaseException dbex =
(DatabaseException) exception;
					serverSession = null;
					clientSession = null;
					Object returnObject =
return returnObject;

				return null;

		clientSession = db;
		return db;

How can this be done with iBatis??

Any suggestions would be appreciated.

Thanx, Andre

View raw message