0 Replies Latest reply on Oct 2, 2004 12:41 PM by roger day

    Stateful Session Bean or Stateless Session Bean + JNDI

    roger day Newbie

      I'm building a scheduling system for a build system. It has a web interface which feeds jobs to Quartz, an opensource scheduler bean, which in turn uses JMS to feed messages to a JBoss app on each buildserver.

      The JBoss app on the buildserver consists of a Message Driven Bean which talks to a Session Bean, which uses exec to run the Perl script which does the build. The Perl script relies on a set of environment variables. My current approach is to try and use a stateful session bean which reads the environment variables from a MySQL database and retains the data thereafter on successive calls. However, I'm new to EJB, and was wondering about the penalties of such an approach. Another approach is to use Stateless Session beans with the environment data retained in the JBoss Naming Service (JNS).

      One worry is performance. Intuitively, using stateful beans seems to problematic, particularly with a large sucession of small jobs or a simultaneous use of a large number of stateful beans. But are JNS calls any faster/more reliable?

      Another worry is the ability to refresh the environment variables.

      1. How do I get a stateful bean which is in memory, to refresh on the database being changed?

      2. Can I access the JNS directly as I would any LDAP service? I know that I could access an external LDAP service and this is a possibility but this requires a whole wide world of installing/learning/configuring such a system and I was wondering if there was an easier approach using JBoss?

      I'm on the cusp of implementing the stateful bean system so this would be the time to change track if it I thought another route was possible.

      Any hints at Stateful bean performance in JBoss welcome. If someone coud point me at any relevant docs/books for JNS, that would be excellent. I had a look at the JBoss admin books but I couldn't see any indepth answers, which is why I'm posting here. Any replies gratefully recieved.

      TIA,

      Roger