• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Update statement hangs

 
Stefanie Rueller
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 293
Java Mac OS X Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the SQL it is issuing?
 
Stefanie Rueller
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 502
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you have other connections open? Possibly, there is a deadlock in the database
 
Stefanie Rueller
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No,
that's the only query accessing the instance.
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is conn_data a local variable? If not, make it so and rerun.
 
Padma Lalwani
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic