Hi Manishi!
If you lock rows in a non-optimistic way then user2 will receive an
exception when trying to lock the same row, i.e., your question is not a
valid question, the second EJB will throw and exception within its
findByPrimaryKey() method.
In General EJB relies on Transaction Manager that´s the point. Transaction
Manager cooperates with database engine in managing transactions. There is
nothing new in transactional power from EJB. What you really get is a
declarative way to manage begin/commmit cycle.
Regards.
----- Original Message -----
From: "manishi tuli" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, January 30, 2001 11:46 PM
> select for update means i am locking those rows while selecting so no body
> else can use that , after manipulating those i can release that .
> my doubt is this
> 1. user1 select some row from database in one method
> 2. user1 change something on that
> meantime user2 comes and repeat 1,2
> now both are trying to update into database
> does ejb help us in preventing this
>
>
> >From: Carlos Otero Barros <[EMAIL PROTECTED]>
> >Reply-To: A mailing list for Enterprise JavaBeans development
> ><[EMAIL PROTECTED]>
> >To: [EMAIL PROTECTED]
> >Date: Tue, 30 Jan 2001 22:19:12 +0100
> >
> >Hi.
> >Not sure what you mean by "SELECT FOR UPDATE".
> >Two instances of the same Entity Bean over the same row still have
> >different
> >transaction contexts.
> >You may expect isolation from transactions so you can rely on them.
> >If two users try to update the row almost at the same time from different
> >instances of the same class of Entity Bean then the standard transaction
> >approach applies.
> >
> >Regards.
> >
> >----- Original Message -----
> >From: "manishi tuli" <[EMAIL PROTECTED]>
> >To: <[EMAIL PROTECTED]>
> >Sent: Tuesday, January 30, 2001 7:53 PM
> >
> >
> > > if 2 instances of ejb are trying to update same row , can we handle
this
> > > thing with ejb transaction or we have to do with select for update
> > >
> > > thanks
> > >
> >_________________________________________________________________________
> > > Get Your Private, Free E-mail from MSN Hotmail at
> >http://www.hotmail.com.
> > >
> > >
>
>===========================================================================
> > > 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".
> >
>
> _________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
>
>
===========================================================================
> 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".