1 Reply Latest reply on Nov 27, 2002 3:12 AM by Erik Sliman

    Best practice / pattern for CMR lookups?

    Tim Newbie

      Regarding performance and efficiency ...

      Whats the best way to efficiently handle enumerated codes etc that are lookups ( fkey references ) to other EJB?.

      For example if I have an EJB which is responsible for a set of some code / status values. These values can be referenced by other beans. These other beans don't want to change the original code just reference it read only.

      This can be described using CMR simple enuf. Since the referencing bean has no intention of changing the original lookup code is there some way to say "Reference this other bean read only"?



        • 1. Re: Best practice / pattern for CMR lookups?
          Erik Sliman Apprentice

          In jbosscmp-jdbc.xml, you can specify an entity tag

          <read-only/>

          which will make the EJB read-only. This should increase performance as it will not call ejbStore(), and should invoke an error if you attempt to call create().

          This is mentioned on page 80 of the JBoss.3.0QuickStart.Draft3.pdg. It also delves deaper in JBossCMP.pdf, describing how to make individual attributes read-only (page 18).