It seems there must be another thread somewhere acting on the repository
item between the time this thread loads the order and the updateOrder()
call. I don't know what process that might be. Maybe there's another
fulfillment thread running? Is someone modifying the order through a
web interface at the same time?
But I don't think the modifications you suggest to
ProcUpdateOrderRepository will help, due to the following:
ProcUpdateOrderRepository is a pipeline processor. The PipelineManager
that invokes the chain manages the transaction. As long as the pipeline
processor has an appropriate "transaction" attribute, as it does OOTB,
there will be a transaction in place when the processor is run.
updateVersion() is called as part of OrderManager.updateOrder(), which
is the method that ProcUpdateOrderRepository calls.
True, there's no synchronization on the order object here. However,
each message to the fulfillment system triggers a process that creates a
new Order object. So synchronizing on a given order object won't help,
since the current thread is the only one that has the given order
object. In the store code, we synchronize because it's possible that
there could be two threads running in the same session that could both
attempt to access the same order object stored in the OrderHolder
component.
185)
**** Error Wed Oct 22 17:12:23 EDT 2008 1224709943691
/atg/commerce/
fulfillment/OrderFulfiller at
atg.service.pipeline.PipelineManager.runProcess(PipelineManager.java:
453)
**** Error Wed Oct 22 17:12:23 EDT 2008 1224709943691
/atg/commerce/
fulfillment/OrderFulfiller at
atg.commerce.order.OrderManager.updateOrder(OrderManager.java:2586)
**** Error Wed Oct 22 17:12:23 EDT 2008 1224709943691
/atg/commerce/
fulfillment/OrderFulfiller at
atg.commerce.fulfillment.processor.ProcUpdateOrderRepository.runProcess(
ProcUpdateOrderRepository.java: