Bill,

What you probably need is the ability to lock at the
database level. This is usually done in many popular
databases with the "SELECT ... FOR UPDATE [nowait]"

If I am not mistaken, JBoss does provide the above
syntax as does our AppServer.

In other database systems, setting the isolation level
should do the trick (e.g: Microsoft SQL Server)

-krish

> -----Original Message-----
> From: A mailing list for Enterprise JavaBeans development
> [mailto:[EMAIL PROTECTED]]On Behalf Of Bill Leonard
> Sent: Tuesday, August 28, 2001 12:02 AM
> To: [EMAIL PROTECTED]
> Subject: CMT and Isolation Levels
>
>
> I know how to do the following outside of EJB but how can I do it using
> Container-Managed Transactions with the setting of Transaction and Isolation
> levels?
>
> I have the following:
> MySessionBean
> {
>   MySessionBeanMethod()
>   {
>      ... do some stuff ...
>      myEntityBean.readData();
>      myEntityBean.updateData();
>   }
> }
>
> In EJB (and, in particular, JBoss), I want to do the following:
> 1. Start a transaction for the MySessionBean method
> 2. When MyEntityBean.readData() is called from within the
> MySessionBeanMethod, readData should read the data from the database and
> block anyone else from reading until the transaction is over
> 3. MyEntityBean.updateData() is called from within the MySessionBeanMethod
> and it updates the data in the database.
> 4. If another client invokes MySessionBeanMethod(), I would like them to
> block until the other client is done.  Actually, I'd like the other client
> to get into the method and block only while the data is read and updated.
>
> Thanks,
> Bill
>
> ===========================================================================
> 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