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
Post a Comment