{"action":"created","issue":{"url":"https://api.github.com/repos/lmdbjava/lmdbjava/issues/103","repository_url":"https://api.github.com/repos/lmdbjava/lmdbjava","labels_url":"https://api.github.com/repos/lmdbjava/lmdbjava/issues/103/labels{/name}","comments_url":"https://api.github.com/repos/lmdbjava/lmdbjava/issues/103/comments","events_url":"https://api.github.com/repos/lmdbjava/lmdbjava/issues/103/events","html_url":"https://github.com/lmdbjava/lmdbjava/issues/103","id":352600365,"node_id":"MDU6SXNzdWUzNTI2MDAzNjU=","number":103,"title":"Bug in state handling in Txn.","user":{"login":"dzajkowski","id":1588718,"node_id":"MDQ6VXNlcjE1ODg3MTg=","avatar_url":"https://avatars0.githubusercontent.com/u/1588718?v=4","gravatar_id":"","url":"https://api.github.com/users/dzajkowski","html_url":"https://github.com/dzajkowski","followers_url":"https://api.github.com/users/dzajkowski/followers","following_url":"https://api.github.com/users/dzajkowski/following{/other_user}","gists_url":"https://api.github.com/users/dzajkowski/gists{/gist_id}","starred_url":"https://api.github.com/users/dzajkowski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dzajkowski/subscriptions","organizations_url":"https://api.github.com/users/dzajkowski/orgs","repos_url":"https://api.github.com/users/dzajkowski/repos","events_url":"https://api.github.com/users/dzajkowski/events{/privacy}","received_events_url":"https://api.github.com/users/dzajkowski/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-08-21T15:40:01Z","updated_at":"2018-09-26T09:09:42Z","closed_at":null,"author_association":"NONE","body":"Encountered a potential bug with how a failed `txn.commit` is handled.\r\n\r\nTest case:\r\nhttps://github.com/dzajkowski/lmdbjava/blob/e0d6b6c545970847f6288d84421a919150278397/src/test/java/org/lmdbjava/TxnTest.java#L265\r\n\r\nResults in:\r\n```\r\nUnexpected exception, expected<org.lmdbjava.Env$MapFullException> but was<org.lmdbjava.Txn$NotReadyException>\r\n```\r\n\r\nit boils down to (`TXN:107`):\r\n```java\r\n    state = DONE;\r\n    checkRc(LIB.mdb_txn_commit(ptr));\r\n```\r\nfirst setting the state to `DONE` and then committing a `txn` which can throw e.g. `MapFullException`.\r\n\r\nShouldn't the lines be switched?\r\nOr is the `try ... catch` pattern misused here?"},"comment":{"url":"https://api.github.com/repos/lmdbjava/lmdbjava/issues/comments/424643135","html_url":"https://github.com/lmdbjava/lmdbjava/issues/103#issuecomment-424643135","issue_url":"https://api.github.com/repos/lmdbjava/lmdbjava/issues/103","id":424643135,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNDY0MzEzNQ==","user":{"login":"lukasz-golebiewski","id":6169602,"node_id":"MDQ6VXNlcjYxNjk2MDI=","avatar_url":"https://avatars1.githubusercontent.com/u/6169602?v=4","gravatar_id":"","url":"https://api.github.com/users/lukasz-golebiewski","html_url":"https://github.com/lukasz-golebiewski","followers_url":"https://api.github.com/users/lukasz-golebiewski/followers","following_url":"https://api.github.com/users/lukasz-golebiewski/following{/other_user}","gists_url":"https://api.github.com/users/lukasz-golebiewski/gists{/gist_id}","starred_url":"https://api.github.com/users/lukasz-golebiewski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukasz-golebiewski/subscriptions","organizations_url":"https://api.github.com/users/lukasz-golebiewski/orgs","repos_url":"https://api.github.com/users/lukasz-golebiewski/repos","events_url":"https://api.github.com/users/lukasz-golebiewski/events{/privacy}","received_events_url":"https://api.github.com/users/lukasz-golebiewski/received_events","type":"User","site_admin":false},"created_at":"2018-09-26T09:09:42Z","updated_at":"2018-09-26T09:09:42Z","author_association":"NONE","body":"The test passes if you replace `txn.abort()` with `txn.close()`"}}
{"actor":{"display_login":"lukasz-golebiewski"}}