1 Reply Latest reply on Dec 4, 2005 10:14 PM by Gavin King

    EJB3 design pattern: job queueing

    Patrick Angeles Novice

      What's the best way to implement the EJB3 equivalent of a non-blocking function to execute long-running jobs requested by multiple clients? (Normally for J2SE one could use a singleton object that implements Runnable.)

      I know JBoss has extensions that allow a client to make asynchronous calls to session beans, and also service beans that guarantee singleton behavior. I can work out a solution with these two features. However, I'd like to know if there is a way to do this without using vendor extensions...

      I've also looked at MDBs, but they seem like an odd fit for what I need. First, I have no need to serialize the request parameters--all parameters can be passed by reference, and they do not have to persist between JVM restarts. Second, I haven't figured out how to guarantee that an MDB is singleton via annotations.