May 22nd, 2013, 11:58 AM
Singleton Controller and EJB injection
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?
May 22nd, 2013, 01:14 PM
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.