Skip to content

Issue with LazyConnectionDataSourceProxy after upgrade from Spring 5.3.39 to Spring 6.1.14 #34546

@mattwms1998

Description

@mattwms1998

In my XML, I am creating the below beans with 'defaultAutoCommit' set to false.
However, I am getting errors "java.sql.SQLException: Can't call commit when autocommit=true". It is like the 'defaultAutoCommit' is being ignored. If set to "true", the error goes away.
I do have declarative transaction around my save method.

	<bean id="dataSource"
		class="org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy">
		<property name="targetDataSource">
			<ref bean="dataSourceTarget" />
		</property>
		<property name="defaultAutoCommit">
			<value>false</value>
		</property>
		<property name="defaultTransactionIsolationName">
			<value>TRANSACTION_READ_COMMITTED</value>
		</property>
	</bean>
	<bean id="dataSourceTarget"class="org.springframework.jdbc.datasource.DriverManagerDataSource">
		..etc
         </bean>

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: dataIssues in data modules (jdbc, orm, oxm, tx)status: invalidAn issue that we don't feel is valid

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions