Hi eddie,
In fact we are using Oracle. The application need not be DBMS neutral.
My problem is whether this locking can be done from the EJB side?
Moreover the V$open_cursor table will give only the name of the
database user, right?
I want the name of the user who has logged on to our application.
Thanks
Best Wishes
Shyam
---------------------- Forwarded by Shyam Sankar S/IBS on 08/21/2001
09:15 AM ---------------------------
Rajasekharuni Syam - srajas <[EMAIL PROTECTED]> on
08/21/2001 08:51:36 AM
To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
cc:
Subject: FW: RE: Transaction locking
FYI
-----Original Message-----
From: Eddie Fung [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, 21 August 2001 1:21 PM
To: Rajasekharuni Syam - srajas
Subject: RE: RE: Transaction locking
Syam,
thanks for the info but the discussion was not so much DBMS specific.
We
generally look for vendor independent solutions in the EJB forum and
I was
answering the query on that basis. Do you know whether the original
sender
([EMAIL PROTECTED]) in fact uses Oracle ? And does his application need
to
be DBMS neutral ?
regards,
Eddie
=====================================================
At 01:12 PM 2001-08-21, you wrote:
>Hi,
>
>Locking Rows in Oracle
>
>Row locks are acquired automatically by the transactions when a row
is
>modified by INSERT, DELETE, UPDATE, and SELECT FOR UPDATE clause.
>
>The following example places a row lock on the employee table
>
>SELECT emp_id, pay_rate
>FROM employee
>WHERE pay_type = 'S'
>FOR UPDATE;
>
>Also you can explicitly loack a table:
>
>LOCK TABLE employee, department
>IN EXCLUSIVE MODE;
>
>This creates a exclusive table lock on these 2 tables.
>
>Hope this clarifies
>
>Syam
>
>-----Original Message-----
>From: Eddie Fung [mailto:[EMAIL PROTECTED]]
>Sent: Tuesday, 21 August 2001 1:03 PM
>To: [EMAIL PROTECTED]
>Subject: Fwd: RE: Transaction locking
>
>
> > > Hi,
> > >
> > > Is there any method to lock some of the rows in a table. I want
to
> > > lock some rows of a table which are being updated so that
nobody else
> > > can modify the data. The information about the user who locked
a
> > > particular row is needed, when tried to find the bean
corresponding
to
> > > that particular row .
> >
> > >BMP or CMP? Which database?
> > >
> > >If you are using BMP with Sybase ASE/ASA or MS SQL Server, you
can use
> > >"select ... from ... holdlock where ..." in your ejbLoad.
> >
> >How long do you need to hold the lock on the rows ? Is it during a
'normal'
> >transaction or across what might be considered normal transaction
> >boundaries ? The holdlock will prevent someone upgrading their lock
to an
> >update lock but I think you want to identify the user who is
currently
> >holding the lock which is a bit messy. This is very hard to do
using
> >standard SQL calls and might vary across DBMS's (some DBMS's may
give the
> >user locking the resource in the SQL error message). You would have
to do
> >this using application code and I think this is nontrivial unless
someone
> >out there has a better solution.
>
>
>From: Rajasekharuni Syam - srajas
>
> >Answer to Part of your question:
> >
> >The locked table name can be obtained by querying V$locked_object
table
in
> >Oracle.
> >
> >Another thing, V$open_cursor table can give name of the user who
use the
> >table that is locked.
> >Try finding out which query is locking the table and thereby the
rows
that
> >are being locked.
>
>Assuming we are using Oracle of course :-)..There are other DBMS's
out
>there which is why I said that how one might trap the error across
>different DBMS's might be messy. Of course you can always do a check
on the
>DBMS being used and then have an interface which will make different
DBMS
>calls depending on the DBMS. However this also means that the user
has to
>wait until the timeout or lock has occurred which is a delay...
>
>cheers,
>
>eddie
>
>
===========================================================================
>To unsubscribe, send email to [EMAIL PROTECTED] and include in
the body
>of the message "signoff EJB-INTEREST". For general help, send email
to
>[EMAIL PROTECTED] and include in the body of the message "help".
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".