1 Reply Latest reply on Jan 4, 2004 4:11 AM by gmatthews

    BMP Entity Bean cache out of sync with DB ?

    gmatthews

      Hi all,

      I seem to be having a problem where the JBoss cache is out of sync with the DB.

      --> viewing the DB shows one set of values
      --> calling findByPrimaryKey retrieves a bean with a different set of values.

      I am using Commit option A where JBoss "owns" the DB, and *definitely* only using entity beans to change the DB, i.e. no direct SQL execute against the DB.

      The problem can be reproduced this way:

      1. BMPBean.create()
      -- e.g. values: (key=1, col1=null, col2=null)

      2. MDBBean.onMessage() --> calls stateless session bean --> retrieves bean from step 1. + changes some values + causes ejbStore to be called.
      -- e.g. values: (key=1, col1=X, col2=Y)


      3. BMPBean.remove()

      4. BMPBean.create() <-- using same key as 1.
      -- e.g. values: (key=1, col1=null, col2=null)


      5. BMPBean.findByPrimaryKey <-- PROBLEM
      -- e.g. values: (key=1, col1=X, col2=Y

        • 1. Re: BMP Entity Bean cache out of sync with DB ?
          gmatthews

          ...further information.

          I'm using JBoss 3.2.2 on Windows XP with JDK1.4.2

          Also, the BMPBean access uses Bean managed transactions, and the JMS -> SLSB -> EJB access uses Container managed transactions.

          On doing further tests, it seems like maybe the JMS initiated access isn't doing a commit.

          Does anyone have any examples on how to best handle transactions with JMS -> SLSB -> Entity EJB ???

          Thanks,
          Greg.