PreparedStatement hangs

PreparedStatement hangs
[860 byte] By [black_lotusa] at [2007-11-27 9:47:58]
# 1
Are you using the same connection for both statements? If so then don't .
sabre150a at 2007-7-13 0:01:12 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 2

First check where it is hanging: hit control-\ (Unix) or control-break (Windows) to get a stack trace.

Which databases are you using?

Can some other process be locking something in the database? If insert really is hanging you may need to use database tools to find out what's doing what.

Insert the same stuff from a command line SQL interpreter to see if that hangs. Try a simpler example with fewer columns, using a temp table so nobody else is touching it.

sjasjaa at 2007-7-13 0:01:12 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 3
> Are you using the same connection for both> statements? If so then don't .No, different connections. I just didn't add that line in my post but here it isStatement st = prod.createStatement();prod and devel being two different connections.
black_lotusa at 2007-7-13 0:01:12 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 4

> First check where it is hanging: hit control-\ (Unix)

> or control-break (Windows) to get a stack trace.

I will try that.

> Which databases are you using?

Oracle

> Can some other process be locking something in the

> database? If insert really is hanging you may need to

> use database tools to find out what's doing what.

>

> Insert the same stuff from a command line SQL

> interpreter to see if that hangs. Try a simpler

> example with fewer columns, using a temp table so

> nobody else is touching it.

I had done a similar thing a couple of months ago with no issues, but I will try again with a more simple example.

Thanks

black_lotusa at 2007-7-13 0:01:13 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 5

Ok, I found the problem. I had deleted all the data from the table that I wanted to rebuild (through an SQL editor), but I did not commit the deletion. So when I ran my program it hung up at the point of update, waiting for commit (or rollback I guess) to be executed. Interesting.

Thanks for the help

black_lotusa at 2007-7-13 0:01:13 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...