{"action":"created","issue":{"url":"https://api.github.com/repos/jcabi/jcabi-jdbc/issues/23","labels_url":"https://api.github.com/repos/jcabi/jcabi-jdbc/issues/23/labels{/name}","comments_url":"https://api.github.com/repos/jcabi/jcabi-jdbc/issues/23/comments","events_url":"https://api.github.com/repos/jcabi/jcabi-jdbc/issues/23/events","html_url":"https://github.com/jcabi/jcabi-jdbc/issues/23","id":35635433,"number":23,"title":"Documentation examples on transaction management contains invalid code","user":{"login":"carlosmiranda","id":1917892,"avatar_url":"https://avatars.githubusercontent.com/u/1917892?v=3","gravatar_id":"","url":"https://api.github.com/users/carlosmiranda","html_url":"https://github.com/carlosmiranda","followers_url":"https://api.github.com/users/carlosmiranda/followers","following_url":"https://api.github.com/users/carlosmiranda/following{/other_user}","gists_url":"https://api.github.com/users/carlosmiranda/gists{/gist_id}","starred_url":"https://api.github.com/users/carlosmiranda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carlosmiranda/subscriptions","organizations_url":"https://api.github.com/users/carlosmiranda/orgs","repos_url":"https://api.github.com/users/carlosmiranda/repos","events_url":"https://api.github.com/users/carlosmiranda/events{/privacy}","received_events_url":"https://api.github.com/users/carlosmiranda/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jcabi/jcabi-jdbc/labels/30+mins","name":"30 mins","color":"eb6421"},{"url":"https://api.github.com/repos/jcabi/jcabi-jdbc/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/jcabi/jcabi-jdbc/labels/DEV","name":"DEV","color":"bfd4f3"},{"url":"https://api.github.com/repos/jcabi/jcabi-jdbc/labels/TS%2FFIX","name":"TS/FIX","color":"d4c5f9"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2014-06-13T00:23:04Z","updated_at":"2015-01-09T19:10:49Z","closed_at":null,"body":"In our documentation page http://jdbc.jcabi.com/example-transaction.html, we have the following example, which contains some invalid statements:\r\n\r\n```java\r\npublic class Main {\r\n  public static void main(String[] args) {\r\n    new JdbcSession(source)\r\n      .autocommit(false)\r\n      .sql(\"START TRANSACTION\")\r\n      .update() // Will not compile!\r\n      .sql(\"DELETE FROM employee WHERE name = ?\")\r\n      .set(\"Jeff Lebowski\")\r\n      .update() // Ditto.\r\n      .sql(\"INSERT INTO employee VALUES (?)\")\r\n      .set(\"Walter Sobchak\")\r\n      .insert(Outcome.VOID) // Neither will this.\r\n      .commit();\r\n  }\r\n}\r\n```\r\n\r\nThis is wrong because the method `update` and `insert` have signatures `T update(Outcome<T>)` and `T insert(Outcome<T>)`. We should be referring to the `execute()` method instead, like so:\r\n\r\n```java\r\npublic class Main {\r\n  public static void main(String[] args) {\r\n    new JdbcSession(source)\r\n      .autocommit(false)\r\n      .sql(\"START TRANSACTION\")\r\n      .execute() // Now this will compile!\r\n      .sql(\"DELETE FROM employee WHERE name = ?\")\r\n      .set(\"Jeff Lebowski\")\r\n      .execute() // Change it here, too\r\n      .sql(\"INSERT INTO employee VALUES (?)\")\r\n      .set(\"Walter Sobchak\")\r\n      .execute() // And here.\r\n      .commit();\r\n  }\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/jcabi/jcabi-jdbc/issues/comments/69382810","html_url":"https://github.com/jcabi/jcabi-jdbc/issues/23#issuecomment-69382810","issue_url":"https://api.github.com/repos/jcabi/jcabi-jdbc/issues/23","id":69382810,"user":{"login":"darkled","id":3275813,"avatar_url":"https://avatars.githubusercontent.com/u/3275813?v=3","gravatar_id":"","url":"https://api.github.com/users/darkled","html_url":"https://github.com/darkled","followers_url":"https://api.github.com/users/darkled/followers","following_url":"https://api.github.com/users/darkled/following{/other_user}","gists_url":"https://api.github.com/users/darkled/gists{/gist_id}","starred_url":"https://api.github.com/users/darkled/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/darkled/subscriptions","organizations_url":"https://api.github.com/users/darkled/orgs","repos_url":"https://api.github.com/users/darkled/repos","events_url":"https://api.github.com/users/darkled/events{/privacy}","received_events_url":"https://api.github.com/users/darkled/received_events","type":"User","site_admin":false},"created_at":"2015-01-09T19:10:49Z","updated_at":"2015-01-09T19:10:49Z","body":"@carlosmiranda @dmarkov please, pay your attention, that PR is sent, but it's acceptance is blocked by #33 "}}