8 Replies Latest reply on Jan 28, 2005 5:51 AM by Alexey Loubyansky

    delete and insert vs update

    sys user Master

      I am trying to find a leak in my application. I am using CMP 2.x Entity Beans. with an MDB that actually performs the inserts/updates/deletes. The transaction for MDB is Bean Managed. I am using JBoss 3.2.3 and JDK 1.4.2. The memory to set to max 256MB. I have a read-ahead of 1000 and max cache size of 2000. I am using commit option B.

      In order to find the leak I have narrowed down the number beans I touch to 10.
      The test:

      update one Entity Bean A in a transaction.
      start another transaction to delete 16 Entity Bean Bs
      inserts 16 (different) Entity Bean Bs.
      Remaining 8 beans are fetched but not modified.
      commit the transaction.

      This test is performed at 120 times per minute.

      This test ran out of memory in about an hours time. I profiled the application using java profiling tools and found that bean B's count kept increasing on each iteration. Remaining 9 beans count didn't increase after the first time.

      I commented out all Bean B's operations and retested. So in this new test Bean A is still being updated. There is no leak this time. This observation made me think why should an update in CMP behave differently that delete-insert.

      I would appreciate if anybody can help me out here. I am being battling this problem for days now.

      Thanks in advance