1 Reply Latest reply on Jul 2, 2004 12:04 AM by mikefinn

    Straight MBeans or MBeans and SessionBeans - Database access

    cbuckley

      Is it common practice to use SessionBean from an MBean to do database routines and return data? Is it perfectly exceptable to use the MBean to do these tasks? From a performance stand point which one is better and why?

        • 1. Re: Straight MBeans or MBeans and SessionBeans - Database ac
          mikefinn

          What are the clients calling the operations? Some may argue, but I think the JMX invocation semantics are a little too nut-and-bolt-level to be doing from business logic. If you're happy with JMX being the only way to get to those ops (like so you can get to them through jmx-console), then do it in the MBean. We do this all the time for independent services we run as MBeans (things that poll the database, for example). Adding a SLSB is just an unneeded layer, unless you need the transactional semantics/boundary it provides. In the Mbean, just get your datasource from JNDI, so you have pooling and the txn mgr.

          mike






          mike