Jump to content
xisto Community
Sign in to follow this  
Leo_578

Question On Enterprise Java Beans Answer me

Recommended Posts

Hi All, there's a question on ejb that i need to ask, the question is as follows:Is it necessary for an entity bean to protect itself against concurrent access from multiple transactions? Regards,Leo

Edited by microscopic^earthling (see edit history)

Share this post


Link to post
Share on other sites

Hope this answers your question:

In Entity bean deployment descriptor, we can define whether the bean is-reentrant or non-reentrant. If we define the entity bean as being reentrant, multiple clients can connect to the Entity bean & execute methods within the entity bean concurrently. Container takes care of synchronization. If we define the entity bean as non-reentrant and many clients connect to it concurrently to execute a method, exception is thrown.

Read complete discussion: http://www.jguru.com/faq/view.jsp?EID=35269

Share this post


Link to post
Share on other sites

For transaction control in entity bean, it depends on whether you use CMT or BMT. If you use CMT (container-managed transaction), you need to write deployment descriptor on the concurrency access model for the container to use. This setting haven't specified in EJB spec, so it is now container specific (Websphere, Weblogic, JBoss... all use different descriptor syntax to deal with this). If you use BMT, you need to control it using JTA UserTransaction object, which is obtained from JNDI.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.