java - Does @Transactional annotation work if autocommit is true? -
would roll work if auto commit turned on? if not implications of turning auto commit off?
@transactional(rollbackfor = {managerexception.class}) public mymethod()....{ system.out.println(my_spring_stored_procedure.getdatasource() .getconnection().getautocommit()) //true .... try { result = this.my_spring_stored_procedure.execute(params); }catch(dataaccessexception e){ throw new managerexception(e); } }
yes. if check code, find when spring uses kind of way transaction. if config auto commit true, change false , after transaction change true.
Comments
Post a Comment