Path: csiph.com!eternal-september.org!feeder.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: Andreas Leitgeb Newsgroups: comp.lang.java.programmer Subject: Re: (jdbc) Universal Connection Pool with wallet... Date: Fri, 20 Apr 2018 07:12:49 -0000 (UTC) Organization: A noiseless patient Spider Lines: 68 Message-ID: References: Reply-To: avl@logic.at Injection-Date: Fri, 20 Apr 2018 07:12:49 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="5cb55ee3cbb4b49d3debdc3b18690b91"; logging-data="25888"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+Rk22+TuQBOBPc+SJ3DdnF" User-Agent: slrn/1.0.2 (Linux) Cancel-Lock: sha1:5yftpiWavrXaurGTmJmBPdhaeFc= Xref: csiph.com comp.lang.java.programmer:38251 Sebastian wrote: > Am 18.04.2018 um 16:49 schrieb Andreas Leitgeb: > > We're in progress of upgrading the Oracle Database version for our > > application from 11.2... to 12.1.0.2 > >[snip] > > Some debugging (using the _g variant of ojdbc6.jar) revealed a reason > >[snip] > I know nothing about wallets, but I have had other problems with those > old drivers from ojdbc6.jar. Are you still on Java 6? If not, you could > try using the newer drivers version 12.1.0.2 from ojdbc7.jar or version > 12.2.0.1 from ojdbc8.jar. With any luck that might perhaps already solve > your problem. Well, we're still stuck on Java7 (until customer *wants* Java8) That's why 12.2.* is still out of reach for us. But I did try ojdbc7 in the meantime (compiling and running), and it shows the same problem. I've got a testcase using oracle.jdbc.pool.OracleDataSource (which is used by the Universal Connection Pool) Within main(String args[]) and a try{...}catch(SQLException e){...} I do: OracleDataSource ods = null; ods = new OracleDataSource(); ods.setURL(args[0]); // this gets passed: jdbc:oracle:thin:/@mydbname ods.setConnectionCachingEnabled(true); Properties cacheProps = new Properties(); cacheProps.setProperty("InitialLimit", "1"); ods.setConnectionCacheProperties(cacheProps); Connection conn = ods.getConnection(); If I comment out the caching altogether, the db-connection succeeds (which I take as a proof that wallet and tnsnames.ora are correctly set up.) If I enable caching, but comment out setting of InitialLimit, then I get an SQLException: "User credentials doesn't match the existing ones" which I don't quite understand and also didn't find anything useful on google for. If I leave the code as shown, I get a NullPointerException: at oracle.jdbc.pool.OracleImplicitConnectionCache.defaultUserPrePopulateCache(OracleImplicitConnectionCache.java:252) at oracle.jdbc.pool.OracleImplicitConnectionCache.(OracleImplicitConnectionCache.java:206) at oracle.jdbc.pool.OracleConnectionCacheManager.createCache(OracleConnectionCacheManager.java:453) at oracle.jdbc.pool.OracleConnectionCacheManager.createCache(OracleConnectionCacheManager.java:272) at oracle.jdbc.pool.OracleDataSource.cacheInitialize(OracleDataSource.java:737) at oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:685) at oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:308) at oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:249) at DirectTest.main(DirectTest.java:53) Conclusion: a non-cached ods.getConnection() *does* use the wallet just fine, but if it creates a connection just for filling the cache, then it doesn't use the Wallet for it. My production code doesn't use OracleDataSource, but oracle.ucp.jdbc.PoolDataSourceFactory . This test tool was just an attempt to pinpoint the problem more closely, since PoolDataSource doesn't provide any information beyond telling me that the pool "just wasn't filled."