Skip to content

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

@chrismshea

Description

@chrismshea

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).

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions