6 Replies Latest reply on Mar 3, 2003 1:50 PM by Peter Doornbosch

    Entity Bean cache problem

    zyfno1 Newbie

      My application is transfered from IBM Websphere. There are some matters. The one is entity bean's cache problem. I do not want the cache and how can I do?

        • 1. Re: Entity Bean cache problem
          Peter Doornbosch Apprentice

          > There are some matters. The one is entity bean's
          > cache problem. I do not want the cache

          Why not??? It won't do any harm, if you set the commit option correctly, it will re-load the entity from the database for every transaction.

          Peter

          • 2. Re: Entity Bean cache problem
            zyfno1 Newbie

            I used to change the value of a record with the Third Party tools or other SQL. But once I accessed the record from Entity Bean, The value resumed original state.
            This matter due to the cache of Entity Bean. Actually I want to save the value changed by the Third Party tools. So I want to know the solvent.

            • 3. Re: Entity Bean cache problem
              Peter Doornbosch Apprentice

              You should use commit option B.
              Quote from the ejb spec (chap. 10.5.9):
              "In this option the Container does not ensure that the instance has exclusive access to the state of the object in the persistent storage. Therefore, the Container must synchronize the instance's state from the persistent storage at the beginning of the next transaction"

              With JBoss, you can set the commit option in the container configuration; see standardjboss.xml in the /server/default/conf directory.

              Cheers,
              Peter

              • 4. Re: Entity Bean cache problem
                zyfno1 Newbie

                Thanks a lot.
                I had find the xml file and locate container-configuration. My EntityBean is 1.1 BMP EntityBean and what will I do next step?

                • 5. Re: Entity Bean cache problem
                  zyfno1 Newbie

                  Oh I have got it.
                  Can you tell me the meaning of Option A. Where can I get the spec (Ejb spec (chap. 10.5.9))?

                  • 6. Re: Entity Bean cache problem
                    Peter Doornbosch Apprentice

                    > Can you tell me the meaning of Option A.
                    The container can assume it is the only one accessing the database, so it can cache entity data and use it in a transaction without reload it first.

                    > Where can I get the spec (Ejb spec (chap. 10.5.9))?
                    You can download the spec from http://java.sun.com
                    And of course, any good ejb book should explain it also...

                    Hth
                    Peter