This will only work if the
*select for update*
and the actual
*update*
are in the same transaction, which I would recommend be done in the same
'trip'
SELECT FOR UPDATE * FROM MYTABLE WHERE MYID=something;
UPDATE .... WHERE MYID=something;

I wouldn't go for a Stateful Session Bean Initiating the transaction with
the first select
and then updating in other trip, because it could lead to deadlocks, racing
conditions, and specially poor
perfomance, as a select for update produces some locking (actually, it's
versioning in Oracle
,so maybe it's not such a bad idea after all)

I'll get back to y'all with this...

HTH

Rifle

-----Original Message-----
From: Bhattacharyya, Ana [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 13, 2000 4:05 PM
To: [EMAIL PROTECTED]
Subject: Re: Serialized Access


can u give me an example query which uses that?
TIA
Anamitra

-----Original Message-----
From: Juan Pablo Lorandi [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 13, 2000 3:03 PM
To: [EMAIL PROTECTED]
Subject: Re: Serialized Access


This will only work in Oracle 7 and above AFAIK

Rifle

-----Original Message-----
From: Bhattacharyya, Ana [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 12, 2000 6:33 PM
To: [EMAIL PROTECTED]
Subject: Re: Serialized Access


this one is new to me! what is this "for update" clause? and how do u use it
in a select clause? is it databse specific.
TIA
Anamitra

-----Original Message-----
From: Victor Langelo [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 12, 2000 5:14 PM
To: [EMAIL PROTECTED]
Subject: Re: Serialized Access


"Bhattacharyya, Ana" wrote:

> also I cannot
> do this check in two queries (first check the timestamp and then update)
as
> they cannot be made atomic.
> correct me if I am wrong.
>

You use the for update clause when selecting the timestamp value. This will
lock
the record.

--Victor

===========================================================================
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".


STATEMENT OF CONFIDENTIALITY.   The information contained in this electronic
message and any attachments to this message are intended for the exclusive
use of the addressee(s) and may contain confidential or privileged
information. If you are not the intended recipient, please notify
USPowerSolutions Corporation immediately at (617) 547-3800, or at
[EMAIL PROTECTED], and destroy all copies of this message and any
attachments.

===========================================================================
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".


STATEMENT OF CONFIDENTIALITY.   The information contained in this electronic
message and any attachments to this message are intended for the exclusive
use of the addressee(s) and may contain confidential or privileged
information. If you are not the intended recipient, please notify
USPowerSolutions Corporation immediately at (617) 547-3800, or at
[EMAIL PROTECTED], and destroy all copies of this message and any
attachments.

===========================================================================
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".

Reply via email to