If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

JDBC insert hanging

Hi DBAs,

I posted this question in Developer forum, no answers, let me try this forum ---
I have an JDBC application which executes insert statement, this application has been running for 5 years well, but recently, insert hanging. I checked Oracle, it says: sql*net is waiting, table has many locks; but check JDBC, it says:"oracle busy".
I insert the same statement from sql*plus, fine.

stmt.close();
} catch (SQLException e) {
result.setError(e);
} finally {
try {
stmt.close();
} catch (Exception ignored) {};
}
}
The connection is initialized with setAutoCommit(true) before any statement is executed.
We know the code gets to executeUpdate because we can see the affect of the insert statement in Oracle. We also know that the java code below never gets to the line result.setUpdateCount because the applications never get data back.

"this application has been running for 5 years well, but recently, insert hanging"

What changed ?

"we can see the affect of the insert statement in Oracle"

Does that mean you see the updated/inserted rows (ie committed successfully) or that you can see that sql in the V$ tables with lots of rows_processed ?
If it is not committing, I'd look for a materialized view being refreshed, a deferred constraint resulting in a rollback or a table trigger being processed.

Nothing changed on code, if I insert the same row from sql*plus, no problem. It might be caused by some other reasons when calling the insert query from JDBC.
I am going to turn on the trace file to see what is going on.

It is not easy to catch the "hanging" query, because often after 2 or 3 days, developer goes to me to tell me "hanging".