asynchronous - Most efficient way to provide EJB @Aynchronous methods for stateless logic -



asynchronous - Most efficient way to provide EJB @Aynchronous methods for stateless logic -

i need create ejbs provide @aynchronous methods.

some of ejbs have no state whatsoever.

some might have cdi-injected (using @inject) threadsafe instance variables @applicationscoped.

is next efficient way this?:

@singleton @concurrencymanagement(bean) public class ejbclass { @asynchronous public void asyncmethod() { //some code } }

my sec guess use: @stateless instead of pair of @singleton & @concurrencymanagement(bean).

but there shouldn't need more 1 instance of of these ejbs, so, unless i'm missing gotcha @singleton, imagine @singleton efficient.

i using ejb 3.2 in glassfish 4.1.

i agree assessment @singleton + @concurrencymanagement(bean) fit problem description. highlight, @stateless has disadvantage might build multiple instances if there concurrent calls. overhead probably, might avoid since it's easy so.

asynchronous glassfish singleton ejb stateless-session-bean

Comments

Popular posts from this blog

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

mediawiki - How do I insert tables inside infoboxes on Wikia pages? -

Local Service User Logged into Windows -