Results 1 to 2 of 2

Thread: Singleton Controller and EJB injection

  1. #1

    Default Singleton Controller and EJB injection

    Hi guys

    I have a Spring controller which is singleton by default, I am using EJB annotation to inject a Stateless Session Bean. I don't know if this is correct because it seems like everytime I check the hashcode of the bean the result is the same. Does this means that the singleton controller is holding onto the bean forever and the bean is never released back to the container after method call? What is the proper scope I am supposed to use here?

    Thanks!

  2. #2

    Default

    NVM, I just remembered it is supposed to return the same hash value when I am accessing with single browser. I just tested with multiple concurrent access, and it returned different hash value when one bean is busy. stupid me.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •