Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ORMOptimisticLockingException? occurs when trying to process subscriptions to Subscribe Pro. #92

Open
chrismshea opened this issue May 28, 2024 · 0 comments
Assignees

Comments

@chrismshea
Copy link
Contributor

Issue

Duplicate subscription created in Subscribe Pro

Details

At some point during the job where we create the subscriptions in Subscribe Pro we lock the order, and update the flags so that the order is not included in the list of subscriptions to be created.

If there is another job running which locks the order you can receive ORMOptimisticLockingException?

When this happens the subscription is already created, and the flag is not cleared. This causes the subscription to be created again in Subscribe Pro.

Expectation

Subscriptions are only created once per order.

Additional thoughts from SFCC Support regarding the job

Thank you for your patience. I trying to read through some of the code for both of the job and I see for PostProcessingExecution, I am seeing below json being taken from customer preference and I see something about Order. Is this job reading orders and adding data to custom object(like you mentioned before or is it doing something else) ?

{ "configs": [ { "type": "email", "processingIntervalInMinutes": 3, "maxTries": 2 }, { "type": "abl", "processingIntervalInMinutes": 3, "maxTries": 2 }, { "type": "abl.createcustomer", "processingIntervalInMinutes": 2, "maxTries": 3}, { "type": "customer", "processingIntervalInMinutes": 1, "maxTries": 3}, { "type": "order", "processingIntervalInMinutes": 2, "maxTries": 3} ] }

Also, for job: ProcessSubproSubscriptions-Process, I see that ExecuteScriptModule.Transactional flag is enabled and I believe in the script you have transaction.wrap statements as well. I would suggest to disable the ExecuteScriptModel.Transactional flag (especially when you are processing a lot of orders to process and having this enabled kill the system because it wraps the entire script within a transaction and since script has its own transactions, these will become nested transactions. This should be enabled only for small scripts that do not have transactions within them).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants