on ‎2019 Mar 08 6:44 AM
Hello experts, We are actually facing an issue where we have two models.
PaymentTransactionModel
AbstractOrderModel
paymentTransactionModel.setOrder(abstractOrderModel) ; modelService.save(paymentTransactionModel); modelService.refresh(paymentTransactionModel);
when we do debug these lines, we can see that the third step is not refreshing the abstractOrderModel(This doesn't hold paymentTransactionModel).
Note: Sometimes we put debug point after line three it works and refreshes the abstractOrderModel. In this case abstractOrderModel contains the paymentTransactionModel. But otherwise, it doesn't.
And in the next consecutive steps, when the cart is cloned into the order(OOTB). As there is no paymentTransactionModel set in the cart, OrderModel also doesn't contain paymentTransactionModel.
Can anybody help to understand this inconsistent behavior?
version: 6.7.0.1
Request clarification before answering.
It should be like this:
paymentTransactionModel.setOrder(abstractOrderModel) ;
modelService.save(paymentTransactionModel);
modelService.refresh(abstractOrderModel);
You have to refresh the order (not transaction) to force order to be reloaded from database and thereby fetch the added references.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ishwar,
Instead of modelService.save(paymentTransactionModel) , can you please use below statement and try.
modelService.saveAll(abstractOrderModel, paymentTransactionModel);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bidyadhar, Thanks for the reply! Below are the ways to explicitly save or refresh abstractOrderModel.
modelService.save(abstractOrderModel)
OR
modelService.refresh(abstractOrderModel)
OR
modelService.saveAll(...)
But I am afraid, I can't do any changes in the code (Third party code). So in order to resolve this, Need to figure out if this is OOTB bug or anything is wrong with the code. Then I can move ahead with the respective solution and follow with for the same.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.