Announcement Announcement Module
No announcement yet.
defaultautocommit in dbcp datasource Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • defaultautocommit in dbcp datasource

    I am using a dbcp BasicDataSource and a TransactionInterceptor.
    For some reason it is autocommiting even though the log says

    Switching JDBC connection [[email protected]] to manual commit.

    My inserts into the db are automatically commited unless I explicitly include

    <property name="defaultAutoCommit"> <value>false</value>

    What can be wrong?

  • #2
    when the sql does not throw an exception the inserts do not appear in the database although the log claims to have commited:

    - Creating new transaction
    - Opening new connection for JDBC transaction
    - Opening JDBC connection
    - Bound value [org.springframework.jdbc.datasource.ConnectionHold [email protected]] for key [[email protected]] to thread [main]
    - Initializing transaction synchronization
    - Invoking commit for transaction on method 'insertQuery' in class [com.bla.bla.DB.TestDataSource]
    - Triggering beforeCommit synchronization
    - Triggering beforeCompletion synchronization
    - Initiating transaction commit
    - Committing JDBC transaction on connection [[email protected]]
    - Triggering afterCompletion synchronization
    - Clearing transaction synchronization
    - Removed value [org.springframework.jdbc.datasource.ConnectionHold [email protected]] for key [[email protected]] from thread [main]
    - Closing JDBC connection [[email protected]] after transaction
    - Closing JDBC connection


    • #3
      to make myself more clear- the first post problem occurs when defaultautocommit is not set at all in my datasource in mi applicationContext.xml and the second post problem occurs when it is set to false


      • #4
        Could you show the beans configuration for this Tes? also, what Spring version are you using?