diff -u b/includes/commerce.controller.inc b/includes/commerce.controller.inc --- b/includes/commerce.controller.inc +++ b/includes/commerce.controller.inc @@ -113,11 +113,16 @@ * commit it as soon as possible given the state of the transaction stack. */ protected function releaseLock() { - if ($this->requiresLocking() && empty($this->lockedEntities)) { + if (empty($this->lockedEntities)) { unset($this->controllerTransaction); } } + /** + * Removes all locking for the controller, mostly used for testing + * if you want to stop locking and run something else, or you want to cancel locking + * on all entities at once, although be cautious with this. + */ public function releaseLocking() { unset($this->controllerTransaction); $this->lockedEntities = array(); reverted: --- b/modules/order/includes/commerce_order.controller.inc +++ a/modules/order/includes/commerce_order.controller.inc @@ -54,14 +54,8 @@ * SAVED_NEW or SAVED_UPDATED depending on the operation performed. */ public function save($order, DatabaseTransaction $transaction = NULL) { + if (!isset($transaction)) { + $transaction = db_transaction(); - //we don't really ever want to have 2 transactions, should we really even accept passed in transactions? or at least flush our internal one immediately? - if (isset($transaction)) { - $this->controllerTransaction = $transaction; - } - - //check if we already have a transaction, else create one - if(!isset($this->controllerTransaction)){ - $this->controllerTransaction = db_transaction(); $started_transaction = TRUE; }