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

Home -> Community -> Usenet -> c.d.o.misc -> Re: How to anticipate (Oracle) database locks.

Re: How to anticipate (Oracle) database locks.

From: Ana C. Dent <anacedent_at_hotmail.com>
Date: Sun, 18 May 2003 13:28:05 -0700
Message-ID: <r1Sxa.48519$MJ5.46650@fed1read03>


Jan Brunia wrote:
> Hi,
>
> We have the problem of encountering database locks in our
> Java program. De piece of code most probably causing
> the lock is shown below.
>
> Has anybody some advise concerning how to avoid the locks
> and when they happen how to handle them and remove them
> runtime?
>
> Many thanks,
>
> Jan
>
> ---------------------------------------------------------------------
> public void deleteByCustomerId(CustomerNr customerId)
> throws MvpnException {
> Database database = new Database(Bootstrap.getConfig(), "billing");
>
> try {
> database.setAutoCommit(false);
>
> PreparedStatement preparedStatement =
> database.prepareStatement(SQL_DELETE_VIRTUAL_MEMBERS);
> preparedStatement.setString(1, customerId.toBilling());
> preparedStatement.execute();
>
> preparedStatement =
> database.prepareStatement(SQL_DELETE_SUBSCRIBERS);
> preparedStatement.setString(1, customerId.toBilling());
> preparedStatement.execute();
>
> preparedStatement =
> database.prepareStatement(SQL_DELETE_CUSTOMER);
> preparedStatement.setString(1, customerId.toBilling());
> preparedStatement.execute();
>
> database.commit();
> } catch(SQLException e) {
> try {
> database.rollback();
> } catch(SQLException e1) {
> } finally {
> log.error("sql error while storing parse result: ", e);
> throw new MvpnException(e);
> }
> } finally {
> database.close();
> }
> }
>
> ----------------------------------------------------------------------------
>
>
>
>
>

I guess I'm going blind.
I do NOT see "the lock is shown below." (now above) I see some JAVA code,
but I see NOTHING to do with a lock within an Oracle DB.

EXACTLY why do you think you have a problem with "locks"? Received on Sun May 18 2003 - 15:28:05 CDT

Original text of this message

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