Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Will the singleton use on EJBObject cause problem?

 
Allan Stone
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For stateless session beans, beans are not tied to EJBObject until the client calls a business method. And the container manages the bean creation if needed.

Then, how about EJBObject, should an application create an EJBObject instance every time it needs to call a business method?

If two or more clients invoke business method on the same instance of EJBObject simultaneously, what will happen?
 
Vinay Raj
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is definitely not recommended way of using session beans. Two or more clients invoke business method on the same instance of EJBObject simultaneously can be done via user developed multi-threaded program, which is a strict no-no in EJBs. The obvious problem areas would be transaction, security management.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic