6 Replies Latest reply on Feb 19, 2002 8:24 PM by zx44093

    Entity bean reload ?

    Jerome Delattre Newbie

      Hello,

      I've tried to update a row directly in Oracle8, and it seems that JBoss does not update attributes of CMP entity beans.
      Anyway, when setting a new value for a bean's attribute JBoss stores this new value in database.
      How can I do to reload database values before any remote method call ?

      thanks,
      jerome.

        • 1. Re: Entity bean reload ?
          Reid Lai Newbie

          I also concern this problem when there is not only single application running to update to the same database. Under this scenerio, is there any people who can suggest me if I can by pass to implement ejbLoad() and ejbStore() in Entity Bean but refresh and update method using business method instead?

          • 2. Re: Entity bean reload ?
            marc fleury Master

            Just testing a reply see if the speed is any better

            • 3. Re: Entity bean reload ?
              David Jencks Master

              Please investigate commit options B and C, jboss default is A which assumes jboss is the only app accessing your db.

              • 4. Re: Entity bean reload ?
                Kai Fuhrmeister Newbie

                I am also looking for a mechanism to combine the access via EJBs and massive manipulation of data
                inside the database for comfort and speed...

                Is there any *working* solution to provide the container with some information that the data may
                have changed inside the database?

                There was also the idea to experiment with the commit options? Any results known?

                Thanx,
                Kai

                • 5. Re: Entity bean reload ?
                  Paul Austin Newbie

                  Commit option B reloads information from the database before each transaction. This will give you what you want but the performance will go down as there will be a lot more database calls.

                  To set up commit option B define a container configuration in your jboss.xml file with the following (After the enterprise-beans tag)

                  <container-configurations>
                  <container-configuration>
                  <container-name>Shared DB BMP</container-name>
                  <commit-option>B</commit-option>
                  </container-configuration>
                  </container-configurations>

                  Then for your bean in jboss.xml specify that you want to use that container configuration.

                  Paul

                  • 6. Re: Entity bean reload ?
                    zx44093 Newbie

                    I am using BMP with commit type A. My problem is for the SAME row from DB, JBoss may create a few copies of it. So when you find the same bean at different time, you may get a different copy of it. Problem happens when one of the copy is changed by user and it also updated the DB fine, then how can I refresh other copies? Or, how can I make sure the later calls to the bean will always get the updated version of the bean? This seems to be s serious problem in JBoss. Someone told me that Orion only allow one copy and don't have this problem.

                    Any suggestion?