I have seen this post about how to wrap JDBCTemplate in Db-transcation
My question is - how can I check this works?
@Transactional(rollbackFor={Exception.class})
public int insertLogAndGetId(ConfigActivityLog dbConfigChange) throws Exception {
int idInDB = -1;
if(insertLog(dbConfigChange))
{
idInDB = getLatestActivityWithStatus(dbConfigChange.actionStatus).id;
}
return idInDB;
}
I don't use other annotations like:
@Service
public class SomeService implements ISomeService {
@Autowired
private NamedParameterJdbcTemplate jdbcTemplate;
@Autowired
private NamedParameterJdbcTemplate npjt;