Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Problem with Locking Tables using JDBC

Problem with Locking Tables using JDBC

From: Tony Horse <tanaks_at_yahoo.com>
Date: 2000/05/29
Message-ID: <1EvY4.1331$6T1.247314@news.dircon.co.uk>#1/1

Hi,

We are writing an application in Java and are using JDBC for Oracle DB operations (8.0.4). All Inserts and Selects seem to work fine but I can't seem to get the locking to work. I want a process to be able to lock a table so that other processes can't acccess the table. This is what I have found:

  1. If I issue the "lock table.... in exclusive mode" command using JDBC then the code executes with no exceptions. However when I enter sqlplus from another session and issue the same command it also locks the table. The truth is that the JDBC does not seem to lock the table.
  2. If I issue the "lock table.... in exclusive mode" command initially using SQLPLUS, then when I try the same thing from my JDBC code, the process hangs as expected, waiting for the lock to release.

Why does this only seem to work one way round? Is it something that I'm doing wrong?

Regards
Tony Received on Mon May 29 2000 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US