1. How is concurrency controlled in EJB, i.e. what happens when two client call the same bean at the same time. 2.When is an MDB instantiated? 3.What is dirty read, repeatable read and phantom read, how do you use transaction isolation in EJB. 4.Can you use threading and reflection inside EJB. 5.Why are separate home and remote interfaces required in the EJB architecture, why not only one? 6.Why is there a remove() method in both the EJBHome and the EJBObject? 7.What does the create() method do in the home interface. 8.What protocol is used in EJB.
Joined: Aug 13, 2001
Could somebody pls tell me the answers to these question?
1. How is concurrency controlled in EJB, i.e. what happens when two client call the same bean at the same time.
The EJB container blocks the second call until the first thread has finished.
2.When is an MDB instantiated?
I'm not quite sure if I remember correctly, but I think this is not explicitly dictated by the EJB specification. Could be at application startup or just-in-time when the JMS provider receives a message into the queue the MDB is configured to listen to. Dunno.
3.What is dirty read, repeatable read and phantom read, how do you use transaction isolation in EJB.
The transaction isolation problems are clearly described in the EJB specification. You specify the isolation level with the deployment descriptor.
4.Can you use threading and reflection inside EJB.
Yes, you can. The specification strongly disapproves doing that but vendors haven't enforced these restrictions so technically you can (and many do).
5.Why are separate home and remote interfaces required in the EJB architecture, why not only one?
Separation of concerns. The home interface is for creating/finding/deleting instances while the remote interface (a.k.a. business interface) is for using a bean instance.
So that you don't have to obtain a reference to a home/remote interface to just to be able to remove a bean if you only have a reference to the other interface. Hi If the Client specify the remove method.Will the bean instance got removed from the client or It is the method to indicate the container to remove the bean instance... Regards, Sangeetha
Regards,Vasantha<p>Great minds discuss ideas. Average minds discuss events. Small minds discuss people.