Commit on jdbcTemplate or DataSource

后端 未结 5 792
天命终不由人
天命终不由人 2021-02-02 14:31

I wanted to do commit and rollback using jdbcTemplate.

My question is based on this thread

How do I commit or rollback, should I do it on jdbcTemplate like

5条回答
  •  野性不改
    2021-02-02 15:10

    if you have configured the spring transaction manager / jdbcTemplate correctly , then you could always use the @Transactional annotations provided by spring in order to define when you want a transaction to be rolled back or not. But even if you have defined a rollback and your jdbc driver or your database do not allow transactions (check TRANSACTION_ISOLATION over JdbcConnection), then spring will log that is using transactions but the database will simply ignore those points.

提交回复
热议问题