Skip to Main Content

Java Database Connectivity (JDBC)

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!

Lock on a table with nested select

mc1976Jul 15 2003 — edited Jul 15 2003
Hi to all,

I've encountered a strange problem with a nested select query. The code
is like the following:

String sql = "SELECT A.field1,A.field2 AS CODE FROM MYTABLE A WHERE A.field2 = ? AND field1 in (SELECT B.x FROM SECONDTABLE B WHERE B.y= ?) ORDER BY A.field2";

PreparedStatement ps = connection.prepareStatement(sql);

ps.setXXX(1,value1);
ps.setXXX(2,value2);

ResultSet rs = ps.executeQuery();

The query works fine, but even after I've close the connection with the db (IBM DB2 in WebSphere enviroment) I just cannot execute insert or delete , 'cause table A results locked.

Any suggestions ?

Thanx in advance...
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 12 2003
Added on Jul 15 2003
9 comments
264 views