Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Error establishing socket

0 views
Skip to first unread message

Neeraj Vora

unread,
Aug 27, 2003, 8:57:51 PM8/27/03
to
Hello,

I have a complex J2EE Web Application I'm hosting on
Tomcat and connecting to MS SQL Server on the backend
using the Microsoft's JDBC Driver. It all has been
working fine for a long time and now recently all of a
sudden I start getting the following exceptions randomly.
There is no co-relation I can find to anything known.
Previously this used be like a temporary glitch that will
go away, but now I suspect only restarting the Web App
clears this. I'm not using any connection pooling. Any
pointers? TIA.

java.sql.SQLException: [Microsoft][SQLServer 2000 Driver
for JDBC]Error establishing socket.
at
com.microsoft.jdbc.base.BaseExceptions.createException
(Unknown Source)
at
com.microsoft.jdbc.base.BaseExceptions.getException
(Unknown Source)
at
com.microsoft.jdbc.base.BaseExceptions.getException
(Unknown Source)
at
com.microsoft.jdbc.sqlserver.tds.TDSConnection.<init>
(Unknown Source)
at
com.microsoft.jdbc.sqlserver.SQLServerImplConnection.open
(Unknown Source)
at
com.microsoft.jdbc.base.BaseConnection.getNewImplConnectio
n(Unknown Source)
at
com.microsoft.jdbc.base.BaseConnection.getImplConnection
(Unknown Source)
at
com.microsoft.jdbc.base.BaseStatement.setupImplConnection
(Unknown Source)
at com.microsoft.jdbc.base.BaseStatement.<init>
(Unknown Source)
at
com.microsoft.jdbc.base.BaseConnection.createStatement
(Unknown Source)
at
com.microsoft.jdbc.base.BaseConnection.createStatement
(Unknown Source)

Joseph Weinstein

unread,
Aug 27, 2003, 10:13:35 PM8/27/03
to

Neeraj Vora wrote:

> Hello,
>
> I have a complex J2EE Web Application I'm hosting on
> Tomcat and connecting to MS SQL Server on the backend
> using the Microsoft's JDBC Driver. It all has been
> working fine for a long time and now recently all of a
> sudden I start getting the following exceptions randomly.
> There is no co-relation I can find to anything known.
> Previously this used be like a temporary glitch that will
> go away, but now I suspect only restarting the Web App
> clears this. I'm not using any connection pooling. Any
> pointers? TIA.
>
> java.sql.SQLException: [Microsoft][SQLServer 2000 Driver
> for JDBC]Error establishing socket.

What OS is this running on? COuld the OS process be running
out of file descriptors? It's a really good idea to pool connections,
it would solve this problem and give you better performance...
Joe Weinstein at BEA

Neeraj Vora

unread,
Aug 28, 2003, 12:13:11 AM8/28/03
to
Joe,

Thanks for responding. The Web App is running on Solaris
8. Tomcat on Solaris has been a rock solid formation so
far. Microsoft JDBC Driver does not implement connection
pooling and we didn't want to spend money buying a paid-
for JDBC driver. I did measure connection overhead and
found only about 20-30ms as compared to 200-200ms total db
operation time. I do see see a spike on the open TCP
connection graph at around the time this happened last,
but the concurrent usage at the time was quite low (2-3
users only). I'm thinking maybe some network issue
prevents TCP connection from being established in a timely
fashion and JDBC driver times out and throws an exception
and the user might repeatedly hit a button causing a flood
of requests and subsequent running out of descriptors. So
is it possible the latter is the effect rather than the
cause?

Thanks,

Neeraj

>.
>

Joseph Weinstein

unread,
Aug 28, 2003, 12:31:23 AM8/28/03
to Neeraj Vora
Are you making your connections with the selectMethod=cursor?
If not, this driver has the bad behavior of making extra connections
under the covers, for each concurrent statement made from a
given connection... This would add up... You could implement
your own collection of connections for a pool... I have seen
more than one customer run out of file descriptors on Solaris.
You could consider configuring solaris to allow your process
to have more file descriptors...
Good luck.
0 new messages