Announcement Announcement Module
Collapse
No announcement yet.
defaultautocommit in dbcp datasource Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • 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 [org.apache.commons.dbcp.PoolableConnection@3a0ab1] to manual commit.

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

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

    What can be wrong?
    Thanks.

  • #2
    Additionally-
    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 er@940b84] for key [org.apache.commons.dbcp.BasicDataSource@1fb3211] 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 [org.apache.commons.dbcp.PoolableConnection@14627a]
    - Triggering afterCompletion synchronization
    - Clearing transaction synchronization
    - Removed value [org.springframework.jdbc.datasource.ConnectionHold er@940b84] for key [org.apache.commons.dbcp.BasicDataSource@1fb3211] from thread [main]
    - Closing JDBC connection [org.apache.commons.dbcp.PoolableConnection@14627a] after transaction
    - Closing JDBC connection

    Comment


    • #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

      Comment


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

        Comment

        Working...
        X