When I say that the Entity bean updates the data in the database, it actually updates the values into the database only when the ejbStore gets called. No other method in the entity bean updates the datase directly.
I apologise about not being clear about that.
Are you calling the second SessionA method through the remote interface for SessionA or doing a direct java object call on the current instance? The latter will result in every call to an entity bean being in its own transaction, the session will never start one.
Thanks for the quick reply david. I am calling MethodB in session bean from within the methodA itself and not through the remote interface. I have also tried making MethodA as "Supports" and "required". And if you say calling MethodB from within MethodA will result in every method having its own transaction. How can I acheive what I want to do and that is have all methods called in entity bean from MethodB be part of the same transaction.
But as soon as I exit MethodB the transaction should Commit. And then when MethodA calls MethodC, which in turn tries to look up the same record through the entity bean it should see the changed data.
Thanks again for looking into the problem.
The only way the container can keep track of what you are doing is if the method calls go through the remote interface. If you call methodB from methodA directly, as far as the container is concerned, you are still in methodA, with no transaction. So each call to an entity bean (Requires) will get a new tx. Call methodB through the remote interface.