Announcement Announcement Module
Collapse
No announcement yet.
auto commit setting in JdbcTemplate Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • auto commit setting in JdbcTemplate

    hello all:

    in the datasouce attribute of the jdbcTemplate, I preset its autocommit field to be false; however, in the code I might need to set it to be true once awhile for different stored proc processing.

    I tried code such as :

    Code:
    Connection conn = DataSourceUtils.getConnection(jdbcTemplate.getDataSource());
    			conn.setAutoCommit(true);
    it didn't work - the autocommit field remains the same.

    Anyone can help me on this?

    Thanks,
    Johnny

  • #2
    Hello

    Have you read the Spring Documentation about JDBC?

    Let Spring handle the transaction control and this case about of autocommit.

    I think is not wise access the Connection to do something special

    Comment

    Working...
    X