table chicken : { Id : int, Egg : int }
                    PRIMARY KEY Id(* , CONSTRAINT Egg FOREIGN KEY Egg REFERENCES egg(Id) *)

table egg : { Id : int, Chicken : int }
                PRIMARY KEY Id, CONSTRAINT Chicken FOREIGN KEY Chicken REFERENCES chicken(Id)

(* This works *)
fun main () : transaction page
  = dml (INSERT INTO chicken(Id, Egg) VALUES (1, 2));
    dml (INSERT INTO egg(Id, Chicken) VALUES (2, 1));
    return <xml>Success!</xml>

(* This gives "Fatal error: Error running SQL COMMIT" as it should  *)
fun main1 () : transaction page
  = dml (INSERT INTO chicken(Id, Egg) VALUES (10, 20));
    dml (INSERT INTO egg(Id, Chicken) VALUES (200, 100));
    return <xml>Success!</xml>

