Entities/Permissions/Model/PermissionsEntityMapper.php
private function doDeleteTransaction(int $permissionId)
    {
        pg_query("BEGIN");
        // $this->doDeletePermissionRoles($permissionId);

        try {
            $this->doDeletePermissionRoles($permissionId);
        } catch (\Exception $e) {
            pg_query("ROLLBACK");
            throw $e;
        }

        try {
            $this->permissionsTableMapper->delete($permissionId);
        } catch (\Exception $e) {
            pg_query("ROLLBACK");
            throw $e;
        }
        // $this->permissionsTableMapper->delete($permissionId);
        pg_query("COMMIT");
    }
private function doDeleteTransaction(int $permissionId)
    {
        pg_query("BEGIN");
        // $this->doDeletePermissionRoles($permissionId);

        try {
            $this->doDeletePermissionRoles($permissionId);
        } catch (\Exception $e) {
            pg_query("ROLLBACK");
            throw $e;
        }

        try {
            $this->permissionsTableMapper->delete($permissionId);
        } catch (\Exception $e) {
            pg_query("ROLLBACK");
            throw $e;
        }
        // $this->permissionsTableMapper->delete($permissionId);
        pg_query("COMMIT");
    }
any necessary validation should be performed prior to calling