Hi All, Just two questions. 1)How to set ISOLATION LEVELS in an Entity Bean which is using CMP? 2)Why Stateless Bean cannot use BMT? thanks, Manjunath
Joined: Jul 24, 2002
1)How to set ISOLATION LEVELS in an Entity Bean which is using CMP?
Setting isolation levels is not specified by the EJB specification. It is left to your app server, so check your vendor's documentation to see if they allow it and how. There can be some really bad problems if you are not careful how you do this. I'd suggest at least reading Section 17.3.2 of the EJB 2.0 Spec about isolation levels.
2)Why Stateless Bean cannot use BMT?
They can. The restriction is that Stateless Session Beans with Bean Managed Transactions must start and commit or rollback the transaction within the same method call. So a transcation can not span multiple methods - the reason is that there is no way to keep a reference to the in-work transaction since the bean is stateless. Entity beans can not use BMT because the container has to be able to control the transaction since it must make calls to things like ejbLoad, ejbStore, etc. using the same transaction context set for a business method. If the business mehtod started the transaction, it is too late for the container to call ejbLoad using that transaction.