I have a Java application which is connecting to an Oracle database, but my application is losing its connection after 20 minutes. It will works after closing and logging:
My poolingDatasourceExample.java
is given below:
Properties props = new Properties();
props.put("user", uname);
props.put("password", pass);
props.put("password", pass);
props.put("testWhileIdle", "true");
props.put("testOnBorrow", "true");
props.put("testOnReturn", "false");
props.put("validationQuery", "SELECT 1");
props.put("validationInterval", "30000");
props.put("timeBetweenEvictionRunsMillis", "5000");
props.put("maxActive", "100");
props.put("minIdle", "10");
props.put("maxWait", "10000");
props.put("initialSize", "10");
props.put("removeAbandonedTimeout", "60");
props.put("removeAbandoned", "true");
props.put("logAbandoned", "true");
props.put("minEvictableIdleTimeMillis", "30000");
ConnectionFactory connectionFactory = new DriverManagerConnectionFactory(connectURI, props);