Hello SailPoint Community,
We are running regular aggregation in our prod environment and intermittently we are receiving “Unable to acquire JDBC connection” issue in our tasks and the subsequent tasks are failing. We have to restart the tomcat and manually trigger those failed tasks again to successfully run complete the tasks schedule.
We thought the issue might be pool size. We have 2 UI servers and 2 task servers. Task servers have good number of pool size i.e. 200 active, 350 total pool connections and idle=5 in iiq.props file.
We noticed that this issue is happening in particular server only. We did cross check the configuration details for both task servers and they both are equal.
To cut the topic short, Can I ask, Is there a way(script I can add in my rules which run by tasks) to track the pool connection objects during the task execution? We suspects that the connection objects are not returning to pool, might getting stuck.
We have about 25 sequential tasks in our delta and it happens somewhere while processing assignments/ events.
dataSource.maxWaitMillis=10000
dataSource.maxTotal=300
dataSource.minIdle=5
datasource.maxActive=200
I use a structure like this for my database queries. It ensures that all of the relevant items are closed. Pardon any coding errors, you get the idea.
Connection conn=null;
PreparedStatement pstmt=null;
ResultSet rs=null;
try {
conn=context.getJdbcConnection(); or get from another source
pstmt=conn.prepareStatement(sqlQuery);
for (String id: identityList) {
pstmt.setString(1,id);
rs=pstmt.execute();
if(rs!=null) {
do something with the data
}
}
}
catch (Exception ex) {
alog.error("Error:"+ex.getClass().getName()+":"+ex.getMessage());
}
finally {
if(rs!=null)rs.close();
if(pstmt!=null)pstmt.close();
if(conn!=null)conn.close();
}
I have put the atomic get connection logic into its own try/catch block and then that in a loop, with Thread.sleep and a max retries value, that has worked for me before. Do you understand how to do that?
If I use this in one of the rules which gets used in schedule tasks might give the idea. But we use DB queries in most of the rules that we’ve customized.
In this case, how can I approach further!