)]}'
{
  "commit": "4ce1c322da22472257fa6d9f42fc7b7667c2578c",
  "tree": "12abb1cb021fd993a50062fcd3440852c6297a3e",
  "parents": [
    "b46ab3e8559575f064834439ea7c2a40f9cf50c7"
  ],
  "author": {
    "name": "Dave Borowitz",
    "email": "dborowitz@google.com",
    "time": "Wed Dec 21 09:55:40 2016 -0500"
  },
  "committer": {
    "name": "Dave Borowitz",
    "email": "dborowitz@google.com",
    "time": "Wed Dec 21 12:33:57 2016 -0500"
  },
  "message": "JdbcAccess: Defer exceptions when in a transaction\n\nThe insert/update/delete methods may throw OrmExceptions immediately\nwhen a primary key constraint is violated or when attempting to modify\na row that does not exist. This violates the expectations of callers\nwho assume that no work is actually done until the transaction is\ncommitted. Work around this in the simplest way possible, by holding\non to the first exception encountered during a transaction and\nthrowing it immediately from commit().\n\nThis enables a pattern where callers can \"turn off\" database access\nentirely by always using transactions and simply never committing\nthem:\n\n  db.table().beginTransaction(key);\n  try {\n    db.table().insert(foo);\n    if (dbIsEnabled) {\n      db.commit();\n    }\n  } finally {\n    db.rollback();\n  }\n\n  db.table().beginTransaction(key);\n  try {\n    db.table().delete(foo.getKey());\n    if (dbIsEnabled) {\n      db.commit();\n    }\n  } finally {\n    db.rollback();\n  }\n\nThe problem with this pattern, prior to this change, is that if the\nfirst transaction never inserted foo, then the delete call will\nimmediately throw OrmConcurrencyException due to foo\u0027s key not\nexisting.\n\nChange-Id: Ic7ced328a4d3659cb8b7b00cb387142dbf8a0522\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "a97cfef602ccff072dc183012bfc41522e907d19",
      "old_mode": 33188,
      "old_path": "src/main/java/com/google/gwtorm/jdbc/JdbcAccess.java",
      "new_id": "7335427957cb2dbf2ce6b8035ca5ec52e7ee9307",
      "new_mode": 33188,
      "new_path": "src/main/java/com/google/gwtorm/jdbc/JdbcAccess.java"
    },
    {
      "type": "modify",
      "old_id": "80dec0b176609528166efca4afe1dd4912150b24",
      "old_mode": 33188,
      "old_path": "src/main/java/com/google/gwtorm/jdbc/JdbcSchema.java",
      "new_id": "117314073dc18dc3b35de98e841b51c4e96c6b1a",
      "new_mode": 33188,
      "new_path": "src/main/java/com/google/gwtorm/jdbc/JdbcSchema.java"
    },
    {
      "type": "modify",
      "old_id": "38644da8a8abd3c47b53473bc2e47de0090cb54a",
      "old_mode": 33188,
      "old_path": "src/test/java/com/google/gwtorm/data/Person.java",
      "new_id": "13ff46569d92df16be348e631855b95c15036b83",
      "new_mode": 33188,
      "new_path": "src/test/java/com/google/gwtorm/data/Person.java"
    },
    {
      "type": "modify",
      "old_id": "2c08ef2434a3c5eeaa0514f081063baf48a6a927",
      "old_mode": 33188,
      "old_path": "src/test/java/com/google/gwtorm/jdbc/AbstractTestJdbcAccess.java",
      "new_id": "267bfcc4499ff30a93f1e79007fba66fb7e50c81",
      "new_mode": 33188,
      "new_path": "src/test/java/com/google/gwtorm/jdbc/AbstractTestJdbcAccess.java"
    },
    {
      "type": "modify",
      "old_id": "b1917690515d86320ca5fad7a7deb31695e423d9",
      "old_mode": 33188,
      "old_path": "src/test/java/com/google/gwtorm/schema/sql/SqlDialectTest.java",
      "new_id": "422ba0add201cddd43f09d03dba309c76d8fc104",
      "new_mode": 33188,
      "new_path": "src/test/java/com/google/gwtorm/schema/sql/SqlDialectTest.java"
    }
  ]
}
