6 Replies Latest reply on Mar 18, 2004 3:58 AM by Oleg

    Update on Find

    burg Newbie

      Why Jboss made a update when I execute a findBy ???
      How can I can disable this???

        • 1. Re: Update on Find
          Alexey Loubyansky Master

          Any more details on what you and JBoss [your version] did?

          • 2. Re: Update on Find
            Oleg Newbie

             

            "loubyansky" wrote:
            Any more details on what you and JBoss [your version] did?


            I do experience the issue accessing DB2 DATE field via CMP EB.

            Jboss 3.2.3.

            It seems Jboss CMP module makes the difference between the value retrived from the DB and the value stored in the CMP field.

            Why? Do you think something wrong with standardjbosscmp-jdbc.xml datatype mapping?

            Code:
            Fake f = FakeHome.findByPrimaryKey(new Long(XXX));
            f.getDate(); // note the Date should be not null to reproduce the issue

            Date field:
            public abstract java.sql.Date getDate();

            Log:

            2004-03-17 12:37:07,578 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCFindByPrimaryKeyQuery.FakeCMP#findByPrimaryKey] Executing SQL: SELECT FAKE_ID FROM FAKE WHERE FAKE_ID=?
            2004-03-17 12:37:07,578 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.FakeCMP] Executing SQL: SELECT DATE FROM FAKE WHERE (FAKE_ID=?)
            2004-03-17 12:37:07,593 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreEntityCommand.FakeCMP] Executing SQL: UPDATE FAKE SET DATE=? WHERE FAKE_ID=?
            2004-03-17 12:37:07,593 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreEntityCommand.FakeCMP] Rows affected = 1




            • 3. Re: Update on Find
              Oleg Newbie

              <check-dirty-after-get>false</check-dirty-after-get>

              • 4. Re: Update on Find
                Alexey Loubyansky Master

                Correct. It is fixed in 3.2.4.

                • 5. Re: Update on Find
                  mkyaj Newbie

                  By default, JBoss will do updates of any dirty entities whenever a finder is called. With sync-on-commit-only set to true, however, this synchronization will still happen when deletes/removes are done to ensure that cascade deletes work correctly.

                  So you have to set <sync-on-commit-only>true</sync-on-commit-only>
                  in conf\standardjboss.xml.

                  • 6. Re: Update on Find
                    Oleg Newbie

                     

                    "mkyaj" wrote:
                    By default, JBoss will do updates of any dirty entities whenever a finder is called. With sync-on-commit-only set to true, however, this synchronization will still happen when deletes/removes are done to ensure that cascade deletes work correctly.

                    So you have to set <sync-on-commit-only>true</sync-on-commit-only>
                    in conf\standardjboss.xml.


                    Thanks a lot... But it doesn't work. Waiting for 3.2.4.