Cascade Issue [message #1852197] |
Wed, 04 May 2022 14:32  |
Deepesh Mundra Messages: 1 Registered: May 2022 |
Junior Member |
|
|
Below is the parent table dto which has requestStatus as IN_PROGRESS which gets updated to DONE on updating child table as below:
@OneToOne(cascade = CascadeType.ALL, fetch=FetchType.EAGER, mappedBy="vendorServiceability", targetEntity=ServiceabilityStatusDTO.class)
private IServiceabilityStatus serviceabilityStatus;
@Column(name="REQUEST_STATUS", length=15)
private String requestStatus;
Below is the child table dto which insert record and update requestStatus to DONE in parent table dto
@OneToOne(cascade={CascadeType.PERSIST,CascadeType.MERGE},fetch=FetchType.EAGER,targetEntity=VendorServiceabilityDTO.class)
@JoinColumn(name="SERVICEABILITY_KEY", unique=true)
private IVendorServiceability vendorServiceability;
We checked when running for 100 products, for each product while saving child table, it updates parent table requestStatus to Done and again it updates to IN_PROGRESS from another thread. So, final status is like out of 100, around 50 are marked as Done and remaining as InProgress.
We tried using flush and clear entitymanager but issue still persist.
please suggest.
|
|
|
|
Powered by
FUDForum. Page generated in 0.01745 seconds