Question

PXLockViolationException 2021 R1


Hi,


I always got PXData.PXLockViolationException a.k.a “another process has added…..”

We are having a upgrade procedure right now.
in my 2019 R1 Project same code, it works, but when on 2021R1, it returns me this error.
Is there a new way to add lines programmatically in 2021 R1?

I always do.

var item = Details.insert();
item.description = someDescription.

Details.Update(item);

but when I do Actions.PressSave() it triggers the error.

been going here for weeks. I tried all solutions I can think about.

 

Thanks,

 

Ed


6 replies

Userlevel 6
Badge +4

Hi @Edong ,

Can you try like below by having a new object and verify?

 

DACName obj = new DACName();

obj.ID = PrimaryKeyValues;  

Details.Insert(obj);
obj.description = someDescription.

Details.Update(obj);

this.Actions.PressSave();

 

 

Hi @Edong ,

Can you try like below by having a new object and verify?

 

DACName obj = new DACName();

obj.ID = PrimaryKeyValues;  

Details.Insert(obj);
obj.description = someDescription.

Details.Update(obj);

this.Actions.PressSave();

 

 

I use PXDBDefault as well as PXParent attributes to auto-populate the lines. or the child table

Userlevel 6
Badge +4

This will work with above code also right?

 

This will work with above code also right?

 

yeah, it is still the same error.

Userlevel 6
Badge +4

To identify the root cause, please comment on all the Cache.Update(DACobjects) source code on the particular Graph file and verify.

Even I also faced the same prob but I identified and fixed the root cause like this. Hope this helps!!

Userlevel 1
Badge

Hi Ed, 

Could you please try to replace Actions.PressSave() with Save.Press()? Or even with just Persist()

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2020  Acumatica, Inc. All rights reserved