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

JConnect... address in use

6 views
Skip to first unread message

Preston

unread,
Jan 28, 2004, 4:02:05 PM1/28/04
to
I have an app that runs in a loop. During that process it establishes a
connecction to the database, does some things, then closes the connection.
Typically the loop would loop less than 10 times.

However if I fore it to run indefinately. I start getting an exception (see
below). However the failure point is not consistent. It can happen anywhere
after 400 to 800 itterations. Any suggestions?

My thought is that maybe the connection is closing fast enough before a call
to open a new one is made.

java.sql.SQLException: JZ006: Caught IOException: java.net.BindException:
Addres
s already in use: connect
at com.sybase.jdbc.ErrorMessage.raiseError(ErrorMessage.java)
at com.sybase.tds.Tds.login(Tds.java)
at com.sybase.jdbc.SybConnection.<init>(SybConnection.java)
at com.sybase.jdbc.SybDriver.connect(SybDriver.java)
at java.sql.DriverManager.getConnection(DriverManager.java:512)
at java.sql.DriverManager.getConnection(DriverManager.java:140)
at support.ASAConnection.ASAConnect(ASAConnection.java:69)

Thanks,
Preston


Graham Hurst

unread,
Jan 29, 2004, 11:35:50 AM1/29/04
to
Not sure if it's related, but the OS typically doesn't free a socket for
reuse for around 2 minutes after it is closed.

Cheers,

Graham

0 new messages