Connection reset : socket write error

My applications are Java based Client Server Applications. The clients have been developed using Java Swings API.(JDK 1.5) The Database server is Oracle 9i. The clients are connecting to server through Oracle JDBC thin drivers(classes12.jar -- recently tried upgrading to ojdbc14.jar also). We are NOT using any Connection pooling.

In each of our class the constructor takes a connection: Thereafter in we use this connection for executing queries and on exit we close the connection.

Everything are working fine for last 2 years till recently when our users were provided with the wireless access in place of earlier static ethernet. Hence they now connect to a access point in their rooms through wireless and thereafter the connection is on LAN.

We am now getting this exception at random in my application

java.sql.SQLException: Io exception: Connection reset by peer: socket write error

at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:187)

at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:229)

at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:342)

at oracle.jdbc.driver.OracleStatement.open(OracleStatement.java:682)

at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:24 99)

at oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:742)

at com.tiis.common.database.DB_Connection.selQuery(DB_Connection.java:212)

at

............................................

[1539 byte] By [Goela] at [2007-11-27 9:37:11]
# 1

How can you have a client-server architecture where the clients connect to the database directly ?

Fundamentally, your problem is one of bad system design.

You should only have database connections on the server side.

Then the clients make stateless calls to the server.

Sounds to me like your clients are intermitantly losing their network connections, which causes the JDBC connections to close or timeout.

They'ld probably have the same problem with any socket based program which relies on a stateful connection,eg. telnet or ftp.

Ps. connection pooling might help, as one connection takes over when the other fails.Assuming you don't have transactions that span many calls.

regards,

Owen

omcgoverna at 2007-7-12 23:07:51 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 2

The number of clients we have is only 20-30. That's why it was implemented like this. The other web-based applications are using the Connection pooling which is implemented through the App server.

How to use/implement Connection pooling in this mode? Can you give some reference?

thanks and regards,

Goela at 2007-7-12 23:07:52 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 3
Also how would Connection pool help in resolving this problem. And what how else is a client supposed to connect to the database server?
Goela at 2007-7-12 23:07:52 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...