{
    "id": "pdo181-reservation-contention",
    "title": "Сохранить два резерва после явного конфликта записи",
    "columns": [
        "Наблюдение",
        "Результат"
    ],
    "rows": [
        [
            "Товар",
            "Кабель"
        ],
        [
            "Начальный остаток",
            5
        ],
        [
            "Первый резерв",
            2
        ],
        [
            "Первая попытка второго покупателя",
            "HY000 \/ 5: запись занята"
        ],
        [
            "Новый резерв после commit",
            1
        ],
        [
            "Остаток после двух резервов",
            2
        ],
        [
            "Дочерний процесс завершён",
            true
        ],
        [
            "Квитанция",
            "reservation.csv"
        ]
    ],
    "checks": {
        "parent_reserved_two": true,
        "busy_is_explicit": true,
        "new_attempt_reserved_one": true,
        "stock_readback": true,
        "child_stopped": true,
        "receipt_exact": true,
        "owned_objects_removed": true,
        "owned_files_removed": true
    },
    "observations": {
        "parent_stock": [
            {
                "sku": "CABLE",
                "qty": 3
            }
        ],
        "blocked": {
            "phase": "blocked",
            "error": {
                "sqlstate": "HY000",
                "driver_code": 5,
                "message_present": true
            },
            "transaction_active": false,
            "elapsed_ms": 1165.2997
        },
        "second_attempt": {
            "phase": "reserve",
            "affected": 1,
            "stock": [
                {
                    "sku": "CABLE",
                    "qty": 2
                }
            ]
        },
        "final": [
            {
                "sku": "CABLE",
                "title": "Кабель",
                "qty": 2
            }
        ],
        "child_process": {
            "started": true,
            "stopped": true,
            "exit_code": 0,
            "termination_by_parent": false,
            "deadline_seconds": 20,
            "transport": "atomic_json_files",
            "ipc_removed": true
        },
        "business_attempts": {
            "first": "begin failed; no UPDATE",
            "second": "one conditional UPDATE after confirmed parent commit"
        }
    },
    "runtime": {
        "php": "8.5.11",
        "extension": "8.5.11",
        "pdo": "8.5.11",
        "driver": "sqlite",
        "server_version": "3.53.4",
        "client": "3.53.4",
        "storage": "own_file"
    },
    "owned_objects": [
        {
            "type": "TABLE",
            "name": "pdo181_stock_816dce020cc6"
        }
    ],
    "removed_objects": [
        {
            "type": "TABLE",
            "name": "pdo181_stock_816dce020cc6"
        }
    ],
    "owned_files": [
        {
            "type": "DATABASE",
            "name": ".pdo181_project_7141732ed976\/data.sqlite"
        }
    ],
    "removed_files": [
        {
            "type": "DATABASE",
            "name": ".pdo181_project_7141732ed976\/data.sqlite"
        }
    ]
}
