java - Inject Singleton Session Bean into a Stateless Session Bean -


is allowed (and practice) hold shared informations in our application using singleton session bean inside stateless session bean?

the ssb injected slsb.

@stateless public class myslsb {      @inject     myssb myssb; 

-

@singleton @lock(read) public class myssb implements serializable {      private static final long serialversionuid = 1l; 

it more allowed. using singleton injections in stateless or statefull ejbs allow call business methods on ssb in slsb. 1 of trivial advantages using ssb concurrent capabilities. in example of method calls toward ssb locked on read , means threads accessing ssb methods on read mode unless thread holding lock on write.


Comments

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -