Uploaded image for project: 'OpenJPA'
  1. OpenJPA
  2. OPENJPA-2322

Duplicate Update upto 2000 times update DB for the same record

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • 1.2.2
    • None
    • None
    • Websphere 7.0.0.19 running Windows 2008 Standard Server; DB: Oracle 11i Running in AIX

    Description

      After implementing the getEm().flush(); and getEM().clear(); the problem of update duplicate times for 2000 of times is resolved but created a new problems with Oracle and increase the Shared Pool memory.

      Is that advise on this OPEN JPA Behaviour

      CODE WHICH GOT THE PROBLEM Duplicate Update (v0) with 2000 version increment:

      @Override
      public VisitDiagnosisTx saveVisitDiagnosisTx(VisitDiagnosisTx visitDiagTx)

      { VisitDiagnosisTx updatedVisitDiagTx = null; if(Long.valueOf(visitDiagTx.getId())==null || Long.valueOf(visitDiagTx.getId())==0L) updatedVisitDiagTx=(VisitDiagnosisTx)visitDiagnosisTxBean.create(visitDiagTx); else updatedVisitDiagTx=(VisitDiagnosisTx)visitDiagnosisTxBean.update(visitDiagTx); return updatedVisitDiagTx; }

      NEW CODE WHICH RESOLVED DUPLICATE UPDATES (v1) with only 1 version increment:

      @Override
      public VisitDiagnosisTx saveVisitDiagnosisTx(VisitDiagnosisTx visitDiagTx)

      { VisitDiagnosisTx updatedVisitDiagTx = null; if(Long.valueOf(visitDiagTx.getId())==null || Long.valueOf(visitDiagTx.getId())==0L) updatedVisitDiagTx=(VisitDiagnosisTx)visitDiagnosisTxBean.create(visitDiagTx); else updatedVisitDiagTx=(VisitDiagnosisTx)visitDiagnosisTxBean.update(visitDiagTx); visitDiagnosisTxBean.getEm().flush(); visitDiagnosisTxBean.getEm().clear(); return updatedVisitDiagTx; }

      Does this cause any Abnormal JPA Behaviour?

      Attachments

        Activity

          People

            curtisr7 Richard G. Curtis
            rajuraghu Raghu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: