Hi Bill:

Setting transaction isolation levels in CMT is app server-specific. Some app
servers (e.g., WebSphere Application Server 4.0) allow you to specify the
isolation level on a method-by-method basis. In WebSphere Application Server
4.0, the isolation level for the transaction is the isolation level of the
first method called within that transaction (and an exception is thrown if a
subsequent method has a different isolation level from the first one).

I don't know about JBoss.

Laurel

-----Original Message-----
From: Bill Leonard [mailto:[EMAIL PROTECTED]]
Sent: Monday, August 27, 2001 5:02 PM
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