This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How can I create singleton session bean in EJB3.0

 
Prateek Kumar Singh
Ranch Hand
Posts: 30
Eclipse IDE Hibernate Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

I have a requirement to implement Singleton session bean with EJB3.0 and JBOSS6.0. (please post with an example) ?
 
Ranganathan Kaliyur Mannar
Bartender
Posts: 1101
10
Java Netbeans IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Prateek,
Singleton has been introduced in EJB 3.1 and not in 3.0. You can read about it in our EJB-FAQ

The above FAQ page provides a link to this page which explains the Singleton annotation.

You can also check out the JEE 6 tutorial page to find info about Singleton.
 
Prateek Kumar Singh
Ranch Hand
Posts: 30
Eclipse IDE Hibernate Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ranganathan,

Here idea behind singleton session bean in EJB is We will have a pool of bean instances and that pool will maintain only one bean instance.On each request that bean instance will return to user and get back to pool once job completed. all requests to the singleton will be routed to the single instance of the Singleton bean instance.
A singleton EJB ensures there is only one instance of an EJB in a application. There will be many instances of a stateful session bean (one per session) in a n application.

To maintain the concurrency in your application If you are using container managed concurrency the container may lock on read or write access (or both). So for synchronization programmer need to implement there own logic in application.

In Jboss 6.0 we can create a pool of instance by using @pool annotation. -



this annotation can be applied to a stateless or message driven bean class.

Pool in JBOSS 6.0
Hope this link will help you.

 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic