[ https://issues.apache.org/jira/browse/OPENJPA-2322?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Raghu updated OPENJPA-2322:
---------------------------
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;
}
was:
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
> Duplicate Update upto 2000 times update DB for the same record
> ---------------------------------------------------------------
>
> Key: OPENJPA-2322
> URL: https://issues.apache.org/jira/browse/OPENJPA-2322
> Project: OpenJPA
> Issue Type: Bug
> Components: build / infrastructure, writebehind
> Affects Versions: 1.2.2
> Environment: Websphere 7.0.0.19 running Windows 2008 Standard Server; DB: Oracle
11i Running in AIX
> Reporter: Raghu
>
> 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;
> }
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
|