Hi,
I want to use setautocommit(false), is it mandate to establish a connection using url, username, password to use this method?
Hi,
I want to use setautocommit(false), is it mandate to establish a connection using url, username, password to use this method?
Hi @chandramohan27,
I think it is not mandated to establish connection in the rule, you already configured in source and tested test connection. So, we may use connection object coming in provisioning request. ProvisioningResult object containing the status (success, failure, retry, etc.) of the provisioning request.
You may check attached link to get more details [IdentityNow Rule Guide - JDBC Provision Rule - Compass] (https://community.sailpoint.com/t5/IdentityNow-Wiki/IdentityNow-Rule-Guide-JDBC-Provision-Rule/ta-p/77339)
Thank You.
Yes, but in my requirement I want to disable autoCommit as I have multiple procedures to be executed and then I will be doing a connection.Commit().
What i see in internet is we need to establish connection to use this setAutoCommit() method in JDBC provision rule.
but i’m not sure how to use this method in JDBC rule
Yes you can set it to false and run all your SQL queries in JDBC rule sequentially and use try catch block to ensure you rollback transaction in case of error and commit it if all SQL queries were executed successfully.
In case you are looking for any sample here is something to guide you
Add try catch block in your rule if not already done.
Before running your first SQL query set auto commit to false
connection.setAutoCommit(false);
Set commit at the end after running all SQL queries to ensure your updates are committed
connection.commit();
in catch exception block add rollback to ensure all updates are rolled back in case of any errors
connection.rollback();