Skip to main content

Posts

Showing posts from September, 2012

How the ATG Order flow manages a transaction

See more about ATG  Tx management @ http://tips4ufromsony.blogspot.com/2012/05/atg-how-to-use-transaction-manager.html Most of the ATG Commerce form handlers extend atg.commerce.order.purchase.PurchaseProcessFormHandler. The transaction management pattern in order flow is implemented through this form handler’s beforeSet, afterSet, and handler methods. The transaction will be started @ beforeSet method and is ended @ afterSet method. In general, the design pattern for updating an order is as follows: Acquire lock-manager write lock on profile id from the /atg/commerce/order/LocalLockManager Begin Transaction Synchronize on the Order object. Modify Order Call ((OrderImpl) pOrder).updateVersion(); --> atg.commerce.order.InvalidVersionException is thrown based on this Call OrderManager.updateOrder() Release Order synchronization End Transaction Release lock-manager write lock on profile id from the /atg/commerce/order/LocalLockManager        If you extend atg.commerce