java代码中,连续几个insert,其中一个是会抛异常的。但是发现前面的insert已经在数据库中生效了,并不回滚.数据库是mysql和oracle
放在javaeye的问题频道好几天了,都没得到正确答案:http://www.iteye.com/problems/6314
只好跑到论坛来了:(
问题补充
我试过了,也不行哦:(
从日志中看得出来,事务根本就没启动
Fetching JDBC Connection from DataSource
Creating new JDBC DriverManager Connection to [jdbc:oracle:thin:jdf30/1@192.168.103.236:1521:jstrd236]
Obtained JDBC Connection [oracle.jdbc.driver.T4CConnection@109ea96] for iBATIS operation
Returning JDBC Connection to DataSource
Opened SqlMapSession [com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl@1e12f6d] for iBATIS operation
Fetching JDBC Connection from DataSource
Creating new JDBC DriverManager Connection to [jdbc:oracle:thin:jdf30/1@192.168.103.236:1521:jstrd236]
Obtained JDBC Connection [oracle.jdbc.driver.T4CConnection@46d228] for iBATIS operation
Returning JDBC Connection to DataSource
这段日志显示出根本没有事务控制,每次都是取一个connection然后放回去,再操作再取.郁闷... ...
问题补充
已经解决,谢谢各位的参于:)