public function executeAtomically(callable $operation) { $this->connection->StartTrans(); try { $outcome = $operation(); $this->connection->CommitTrans(); return $outcome; } catch (Exception $e) { $this->connection->RollbackTrans(); throw $e; } }