Results 1 to 2 of 2

Thread: auto commit setting in JdbcTemplate

  1. #1

    Default 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. #2
    Join Date
    Aug 2006
    Location
    Arequipa-Peru / South America
    Posts
    2,796

    Default

    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
    - Manuel Jordan

    Kill Your Pride, Share Your Knowledge With All
    The Fear Of The LORD Is The Beginning Of Knowledge, But Fools Despise Wisdom And Discipline. Proverbs 1:7

    Blog


    Technical Reviewer of Apress

    • Pro SpringSource dm Server
    • Spring Enterprise Recipes: A Problem-Solution Approach
    • Spring Recipes: A Problem-Solution Approach, 2nd Edition
    • Pro Spring Integration
    • Pro Spring Batch
    • Pro Spring 3
    • Pro Spring MVC: With Web Flow
    • Pro Spring Security

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •