{"action":"created","issue":{"url":"https://api.github.com/repos/brettwooldridge/HikariCP/issues/973","repository_url":"https://api.github.com/repos/brettwooldridge/HikariCP","labels_url":"https://api.github.com/repos/brettwooldridge/HikariCP/issues/973/labels{/name}","comments_url":"https://api.github.com/repos/brettwooldridge/HikariCP/issues/973/comments","events_url":"https://api.github.com/repos/brettwooldridge/HikariCP/issues/973/events","html_url":"https://github.com/brettwooldridge/HikariCP/issues/973","id":256739164,"number":973,"title":"Setting Connection Transaction Isolation","user":{"login":"KaoruDev","id":5273755,"avatar_url":"https://avatars3.githubusercontent.com/u/5273755?v=4","gravatar_id":"","url":"https://api.github.com/users/KaoruDev","html_url":"https://github.com/KaoruDev","followers_url":"https://api.github.com/users/KaoruDev/followers","following_url":"https://api.github.com/users/KaoruDev/following{/other_user}","gists_url":"https://api.github.com/users/KaoruDev/gists{/gist_id}","starred_url":"https://api.github.com/users/KaoruDev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KaoruDev/subscriptions","organizations_url":"https://api.github.com/users/KaoruDev/orgs","repos_url":"https://api.github.com/users/KaoruDev/repos","events_url":"https://api.github.com/users/KaoruDev/events{/privacy}","received_events_url":"https://api.github.com/users/KaoruDev/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-09-11T15:13:16Z","updated_at":"2017-09-11T15:39:20Z","closed_at":null,"author_association":"NONE","body":"Hi I'm trying to figure out if setting a transaction level on the connection will persist after the connection has been \"closed\" or maybe, I'm assuming, returned back to the pool.\r\n\r\n```java\r\ntry (Connection conn = pool.getConnection()) {\r\n    conn.setTransactionIsolation(Connection.TRANSACTION_SERIALIZABLE);\r\n    // Some sql queries\r\n}\r\n\r\n// is the connection's transaction isolation still `TRANSACTION_SERIALIZABLE`?\r\n```\r\n\r\nI have `autoCommit` set to the default (`true`). It's unclear if the isolation level persists throughout the whole session vs just in this `try` block.\r\n\r\nThanks!\r\n\r\n#### Environment\r\n```\r\nHikariCP version: 2.4.6\r\nJDK version     : 1.8.0_144\r\nDatabase        : PostgreSQL\r\nDriver version  : x.x.x\r\n```\r\n-----------------------------------------------------------------------------------------\r\n*Have you searched the CLOSED issues already? How about checking [stackoverflow](https://stackoverflow.com/search?q=HikariCP)?*\r\n Yes\r\n"},"comment":{"url":"https://api.github.com/repos/brettwooldridge/HikariCP/issues/comments/328569212","html_url":"https://github.com/brettwooldridge/HikariCP/issues/973#issuecomment-328569212","issue_url":"https://api.github.com/repos/brettwooldridge/HikariCP/issues/973","id":328569212,"user":{"login":"KaoruDev","id":5273755,"avatar_url":"https://avatars3.githubusercontent.com/u/5273755?v=4","gravatar_id":"","url":"https://api.github.com/users/KaoruDev","html_url":"https://github.com/KaoruDev","followers_url":"https://api.github.com/users/KaoruDev/followers","following_url":"https://api.github.com/users/KaoruDev/following{/other_user}","gists_url":"https://api.github.com/users/KaoruDev/gists{/gist_id}","starred_url":"https://api.github.com/users/KaoruDev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KaoruDev/subscriptions","organizations_url":"https://api.github.com/users/KaoruDev/orgs","repos_url":"https://api.github.com/users/KaoruDev/repos","events_url":"https://api.github.com/users/KaoruDev/events{/privacy}","received_events_url":"https://api.github.com/users/KaoruDev/received_events","type":"User","site_admin":false},"created_at":"2017-09-11T15:39:20Z","updated_at":"2017-09-11T15:39:20Z","author_association":"NONE","body":"Ah, is there a way to set the isolation level on the transaction itself?\r\n\r\ni.e.:\r\n```java\r\nDSL.using(c).transaction((t) -> {\r\n    t.setIsolation(Connection.TRANSACTION_SERIALIZABLE);\r\n    // etc...\r\n});\r\n```\r\n\r\nTo me, this makes it clear the isolation level is only for this particular transaction. "}}
{"actor":{"display_login":"KaoruDev"}}