{"action":"opened","issue":{"url":"https://api.github.com/repos/arthurblake/log4jdbc/issues/82","repository_url":"https://api.github.com/repos/arthurblake/log4jdbc","labels_url":"https://api.github.com/repos/arthurblake/log4jdbc/issues/82/labels{/name}","comments_url":"https://api.github.com/repos/arthurblake/log4jdbc/issues/82/comments","events_url":"https://api.github.com/repos/arthurblake/log4jdbc/issues/82/events","html_url":"https://github.com/arthurblake/log4jdbc/issues/82","id":154696130,"number":82,"title":"log4jdbc force return ConnectionSpy driver","user":{"login":"Hooli22","id":19345796,"avatar_url":"https://avatars.githubusercontent.com/u/19345796?v=3","gravatar_id":"","url":"https://api.github.com/users/Hooli22","html_url":"https://github.com/Hooli22","followers_url":"https://api.github.com/users/Hooli22/followers","following_url":"https://api.github.com/users/Hooli22/following{/other_user}","gists_url":"https://api.github.com/users/Hooli22/gists{/gist_id}","starred_url":"https://api.github.com/users/Hooli22/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Hooli22/subscriptions","organizations_url":"https://api.github.com/users/Hooli22/orgs","repos_url":"https://api.github.com/users/Hooli22/repos","events_url":"https://api.github.com/users/Hooli22/events{/privacy}","received_events_url":"https://api.github.com/users/Hooli22/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-05-13T12:01:05Z","updated_at":"2016-05-13T12:01:05Z","closed_at":null,"body":"As per my question here: http://stackoverflow.com/questions/37208375/log4jdbc-force-return-connectionspy-driver\r\n\r\nFor some reason when I use:\r\n\r\n    connection = DriverManager.getConnection(\"jdbc:log4jdbc:derby:/home/user/mydb\");\r\n\r\nI tend to get differing connections back. In this case, it's a mixture between:\r\n\r\n 1. `connection = (org.apache.derby.impl.jdbc.EmbedConnection) org.apache.derby.impl.jdbc.EmbedConnection@2001280736 (XID = 598), (SESSIONID = 1), (DATABASE = /home/user/mydb), (DRDAID = null)`  - Which I don't want\r\n\r\nand:\r\n\r\n2. `connection = (net.sf.log4jdbc.ConnectionSpy)\r\n    net.sf.log4jdbc.ConnectionSpy@32b260fa` - Which I do want\r\n\r\nTo be more specific, when I run using a `public static void main` method then it works and I get back `#2` but when I run the same code after running the web application's startup cycle then I get `#1`.\r\n\r\nIs there a way to force `log4jdbc` to always return `net.sf.log4jdbc.ConnectionSpy`?\r\n"}}