comparison src/cjr_print.sml @ 688:829887ca47a6

Detect serialization failures
author Adam Chlipala <adamc@hcoop.net>
date Thu, 02 Apr 2009 13:31:13 -0400
parents a3ddf05fb3e3
children 655bcc9b77e0
comparison
equal deleted inserted replaced
687:a3ddf05fb3e3 688:829887ca47a6
1643 newline, 1643 newline,
1644 newline, 1644 newline,
1645 1645
1646 string "if (PQresultStatus(res) != PGRES_COMMAND_OK) {", 1646 string "if (PQresultStatus(res) != PGRES_COMMAND_OK) {",
1647 newline, 1647 newline,
1648 box [string "PQclear(res);", 1648 box [string "if (!strcmp(PQresultErrorField(res, PG_DIAG_SQLSTATE), \"40001\")) {",
1649 box [newline,
1650 string "PQclear(res);",
1651 newline,
1652 string "uw_error(ctx, UNLIMITED_RETRY, \"Serialization failure\");",
1653 newline],
1654 string "}",
1655 newline,
1656 string "PQclear(res);",
1649 newline, 1657 newline,
1650 string "uw_error(ctx, FATAL, \"", 1658 string "uw_error(ctx, FATAL, \"",
1651 string (ErrorMsg.spanToString loc), 1659 string (ErrorMsg.spanToString loc),
1652 string ": DML failed:\\n%s\\n%s\", ", 1660 string ": DML failed:\\n%s\\n%s\", ",
1653 case prepared of 1661 case prepared of