Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

SocketTimeoutException: Read time out

mohitanchliaJan 20 2010 — edited Jan 20 2010
We are using tomcat 6 on linux and I am seeing lots of Read time out exception. It looks like clients open connection and then disappear and the server times out. However I am not sure if client disappears then why doesn't TCP keep alive kill the connection? There is not much info out there about Read timeout.

I want to reproduce this behaviour and this is what I want to do by writing a small java app:

Scenario 1:
1. open a Socket connection
2. Write to it and not close the connection and wait for infinite time and see what happens on the server

Scenario 2:
1. As a client app open a socket connection to the server
2. Slowly write on the socket which takes upto 1 hr.

Can you please suggest how I can write Scenario 2? Any other suggestions.

Comments

thatJeffSmith-Oracle

are these oracle data dictionary views? Sorry, I don't recognize the objects in your query. If not, we need a reproducible test case.

user12251389

No its a normal table

thatJeffSmith-Oracle

ok, so give us your table ddl and insert statements so we can try to help you

spool on an /*insert*/ works for HR.EMPLOYEES for example

user12251389

Can you please paste the format which is working as you mentioned ? I have updated my query and as i said the insert statement not getting generated after the file has been generated using Spool so i cannot show you

thatJeffSmith-Oracle
Answer

Sure, i put that here

Marked as Answer by user12251389 · Sep 27 2020
Gary Graham-Oracle

It may help others with a similar problem in the future if you explain what went wrong with the use case in your environment.

For example, just looking at

spool ...

set sqlformat insert

select ...

spool off

a quick test shows this works fine starting with SQL Developer 4.1.1 through 17.2.   Going back to SQL Developer 4.0.3, you would need to remove the "set sqlformat insert" and just use the /*insert*/ hint (as in select /*insert*/ ...).

So, in your case,  was the problem related to...

1. SQL Developer version

2. The leading set commands (set long / set lines)

3. A specific column data type present in your table

4. Something else

It would be nice to know.

Regards,

Gary Graham

SQL Developer Team

Edit:

Rechecking the updated parallel discussion on Stack Overflow, I see the reason was the use of an even earlier version of SQL Developer (3.0 or some 3.x).

The suggested /*insert*/ hint works for SQL Developer 3.2.2 and probably even earlier versions.

user12251389

The problem was because of  sql developer version which was 3.0 and when i run it in 4.1 then it works

1 - 7
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Feb 17 2010
Added on Jan 20 2010
4 comments
5,787 views