I have found a lot of similar situations on the Internet. Many people have encountered the problem of inserting data and there is no data in the database. The solutions are almost all related to transactions. Some do not manually commit (commit), some do not set transaction management, but mine I have set up transaction management, but I still can't insert data. Please help me to look at this problem and see how to solve it.
transaction management
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"
lazy-init="false">
<property name="dataSource" ref="VacationDataSource"/>
</bean>
data source
<bean id="VacationDataSource" destroy-method="close" class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName" value="${batch.jdbc.driverClassName}"/>
<property name="url" value="${batch.jdbc.url}"/>
<property name="username" value="${batch.jdbc.username}"/>
<property name="password" value="${batch.jdbc.password}"/>
<property name="maxActive" value="${batch.jdbc.maxActive}"/>
<property name="maxIdle" value="${batch.jdbc.maxIdle}"/>
<property name="maxWait" value="${batch.jdbc.maxWait}"/>
<property name="defaultAutoCommit" value="true"/>
</bean>
Insert statement and printed log
<insert id="insertPackageline" parameterType="productline" useGeneratedKeys="true" keyProperty="id">
<selectKey resultType="long" keyProperty="id" order="BEFORE">
SELECT seq_pkgproductline.Nextval from DUAL
</selectKey>
insert into pkg_packagemarketgeneralize (id,status,createtime,addedbyid)
values (seq_pkgproductline.nextval, ?,?,?)
</insert>
Parameters: Y(String), 2017-10-12 10:31:35.585(Timestamp), system(String)
ps: According to the printed log, data can be inserted normally in plsql