08-02-2023, 02:06 PM
Currently I'm setting autocommit to false in spring through adding a property to a datasource bean id like below :
<property name="defaultAutoCommit" value="false" />
But i need to add it specifically in a single java method before executing my procedure.
I used the below code snippet.
getJdbcTemplate().getDataSource().getConnection().setAutoCommit(false);
But the above line was not setting autocommit to false? <br/>
Am i missing anything ? <br/>
or any alternative to set autocommit in a specific java method by spring
Thanks
<property name="defaultAutoCommit" value="false" />
But i need to add it specifically in a single java method before executing my procedure.
I used the below code snippet.
getJdbcTemplate().getDataSource().getConnection().setAutoCommit(false);
But the above line was not setting autocommit to false? <br/>
Am i missing anything ? <br/>
or any alternative to set autocommit in a specific java method by spring
Thanks