JBoss Community

Re: Singleton in clustered JBoss AS 6 Final

created by Ilya Sorokoumov in EJB3 - View the full discussion
Managing Concurrent Access in a Singleton Session Bean

#

Singleton session beans are designed for concurrent access, situations in which many clients need to access a single instance of a session bean at the same time. A singleton’s client needs only a reference to a singleton in order to invoke any business methods exposed by the singleton and doesn’t need to worry about any other clients that may be simultaneously invoking business methods on the same singleton.

##When creating a singleton session bean, concurrent access to the singleton’s business methods can be controlled in two ways: container-managed concurrency and bean-managed concurrency.

#The javax.ejb.ConcurrencyManagement annotation is used to specify container-managed or bean-managed concurrency for the singleton. With @ConcurrencyManagement, a type attribute must be set to eitherjavax.ejb.ConcurrencyManagementType.CONTAINER or javax.ejb.ConcurrencyManagementType.BEAN. If no @ConcurrencyManagement annotation is present on the singleton implementation class, the EJB container default of container-managed concurrency is used.

 

 

Take a look at this link for the details:

http://download.oracle.com/javaee/6/tutorial/doc/gipvi.html

Reply to this message by going to Community

Start a new discussion in EJB3 at Community