aspose file tools
The moose likes JDBC and the fly likes Update statement hangs Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "Update statement hangs" Watch "Update statement hangs" New topic
Author

Update statement hangs

Stefanie Rueller
Greenhorn

Joined: Aug 25, 2005
Posts: 3
Hi,

I am trying to do an update to an Oracle 9i table.
Code looks like:

Statement stmtUpdate = conn_data.createStatement();

try
{
int UpdateResult = stmtUpdate.executeUpdate(sqlUpdateProduct);
if ( UpdateResult == 1)
{

When I execute the update it hangs. I can at a DB level that it is done processing but seems to hang upon finishing.
I made sure AutoCommit is on.

When I try the exact same query from an SQL prompt, there is no problem.

Please help.

Stefanie
Dave Salter
Ranch Hand

Joined: Jul 20, 2005
Posts: 292

What is the SQL it is issuing?
Stefanie Rueller
Greenhorn

Joined: Aug 25, 2005
Posts: 3
just a regular update to one tabel. I ran the update seperately and it works fine. Does not take much time at all.
Jayesh Lalwani
Ranch Hand

Joined: Nov 05, 2004
Posts: 502
Do you have other connections open? Possibly, there is a deadlock in the database
Stefanie Rueller
Greenhorn

Joined: Aug 25, 2005
Posts: 3
No,
that's the only query accessing the instance.
Roger Chung-Wee
Ranch Hand

Joined: Sep 29, 2002
Posts: 1683
Is conn_data a local variable? If not, make it so and rerun.


SCJP 1.4, SCWCD 1.3, SCBCD 1.3
Padma Lalwani
Ranch Hand

Joined: Nov 02, 2004
Posts: 49
You might want to try with setAutoCommit(false) and then issuing an explicit commit yourself

I once had a problem with setAutoCommit set to true (which it is by default), and then found that causes errors in Windows 2000 OS. Cannot remember or locate exact reason, but the change to auto commit fixed it

Padma
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Update statement hangs
 
Similar Threads
Python Version Mismatch When Creating Repository in WinCVS
Java App Stopping (Memory??)
HTML Form/Servlet Problem
updating a Long column in Oracle thru JDBC deployed on a Weblogic 6.1 Server
Regular expression