Hi everyone,
I am having an issue with provisioning of any type—modify, create, or disable—and when any of the provisioning rules are executed, the logic may work correctly or it might get stuck during the update of one of the queries. If it gets stuck, the logs show the printf output just before one of the queries, but it stays there until a timeout occurs and then jumps to the catch and finally, for example…
try {
System.out.println("START INSERT");
String insertSQL = "INSERT INTO DTUSDS (NAME, NOMB, TFNO, USDSTFEX, DEPT) VALUES (?,?,?,?,?)";
PreparedStatement statement = connection.prepareStatement(insertSQL);
statement.setString(1, name);
statement.setString(2, firstName);
statement.setString(3, telephone);
statement.setString(4, tfnoExtra);
statement.setString(5, department);
statement.executeUpdate();
statement.close();
System.out.println("FINISH INSERT");
} catch (SQLException e) {
System.out.println("WE ARE IN THE CATCH");
e.printStackTrace();
result.setStatus(ProvisioningResult.STATUS_FAILED);
} finally {
if (connection != null) {
connection.close();
}
if (st != null) {
st.close();
}
}
For SELECT queries, I also use this format:
System.out.println("START SELECT");
String query = "SELECT CDDE FROM TABLE WHERE ZONE = (SELECT ZONE FROM TABLE WHERE DSDE = '"+delegations+"')";
ResultSet rs = st.executeQuery(query);
while (rs.next()) {
String value = rs.getString("CDDE");
List.add(value);
}
System.out.println("FINISH SELECT");
rs.close();
But the result is the same in both cases; sometimes everything works perfectly, and other times it gets stuck in one of the queries of the rules. I wanted to know if I might be missing something in the code, although I believe the code is fine since when everything runs, it works as expected. Or, on the other hand, it could be a problem with the database…
Thanks and regards,
Antonio.