jfinal1.9升级到2.1后数据库事务出现问题

wudz 发布于 2016/01/06 14:12
阅读 1K+
收藏 0

数据库为oracle11,原来事务都是正常的,升级后,提示以下错误,不知道该怎么处理。

[ERROR]-[Thread: http-bio-8080-exec-4]-[com.jfinal.core.ActionHandler.handle()]: /dict/deleteItems
com.jfinal.plugin.activerecord.ActiveRecordException: java.sql.SQLException: 仅 READ_COMMITTED 和 SERIALIZABLE 是有效的事务处理级
at com.jfinal.plugin.activerecord.DbPro.tx(DbPro.java:704)
at com.jfinal.plugin.activerecord.DbPro.tx(DbPro.java:729)
at com.jfinal.plugin.activerecord.Db.tx(Db.java:455)
at com.yoncent.core.web.DictController.deleteItems(DictController.java:214)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.jfinal.aop.Invocation.invoke(Invocation.java:73)
at com.jfinal.core.ActionHandler.handle(ActionHandler.java:74)
at com.yoncent.app.SessionHandler.handle(SessionHandler.java:34)
at com.jfinal.ext.handler.ContextPathHandler.handle(ContextPathHandler.java:47)
at com.jfinal.plugin.druid.DruidStatViewHandler.handle(DruidStatViewHandler.java:75)
at com.jfinal.core.JFinalFilter.doFilter(JFinalFilter.java:72)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:315)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.sql.SQLException: 仅 READ_COMMITTED 和 SERIALIZABLE 是有效的事务处理级
at oracle.jdbc.driver.PhysicalConnection.setTransactionIsolation(PhysicalConnection.java:4611)
at com.alibaba.druid.filter.FilterChainImpl.connection_setTransactionIsolation(FilterChainImpl.java:633)
at com.alibaba.druid.filter.FilterAdapter.connection_setTransactionIsolation(FilterAdapter.java:1032)
at com.alibaba.druid.filter.FilterChainImpl.connection_setTransactionIsolation(FilterChainImpl.java:629)
at com.alibaba.druid.filter.FilterAdapter.connection_setTransactionIsolation(FilterAdapter.java:1032)
at com.alibaba.druid.filter.FilterChainImpl.connection_setTransactionIsolation(FilterChainImpl.java:629)
at com.alibaba.druid.proxy.jdbc.ConnectionProxyImpl.setTransactionIsolation(ConnectionProxyImpl.java:488)
at com.alibaba.druid.pool.DruidPooledConnection.setTransactionIsolation(DruidPooledConnection.java:887)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.jfinal.plugin.activerecord.SqlReporter.invoke(SqlReporter.java:58)
at com.sun.proxy.$Proxy16.setTransactionIsolation(Unknown Source)
at com.jfinal.plugin.activerecord.DbPro.tx(DbPro.java:690)
... 29 more


加载中
0
JFinal
JFinal
把事务级别调整一下,使用 activeRecordPlugin.setTransactionLevel(int level) 方法,jfinal 2.0 级别是 2,jfinal 2.1 调高成了 4,你手动调整一下。
JFinal
JFinal
回复 @wudz : 下载最新版本解决,这几天针对这里进行过改进:http://www.jfinal.com 下载 jfinal-2.1-all.zip
wudz
wudz
回复 @JFinal : 用Generator类生成baseModel时连接库要是oracle时出现问题, ResultSet rs = dbMeta.getTables(conn.getCatalog(), null, null, new String[]{"TABLE", "VIEW"}); 获得的表很多不再当前用户,不知道咋解决。
JFinal
JFinal
回复 @wudz : 下载最新版本,这几天都在微调,主要是生成器的调整以及paginate 方法正则的调整,调整完后才会推送到maven中心库,先去 jfinal.com 下载份最新的,针对 oracle 的生成器已进行过微调
wudz
wudz
用Generator类生成baseModel时连接库要是oracle时出现问题, ResultSet rs = dbMeta.getTables(conn.getCatalog(), null, null, new String[]{"TABLE", "VIEW"}); 获得的表很多不再当前用户,不知道咋解决。
JFinal
JFinal
回复 @wudz : 关键是现在无法确定是不是所有oracle版本都不支持level 4
下一页
0
JFinal
JFinal
    另外,或许 oracle 就不支持 level 4,我需要更多反馈,如果确实不支持,源码需要自动化调整设置。
0
overtake
overtake

仅 READ_COMMITTED 和 SERIALIZABLE 是有效的事务处理级

@JFinal我也遇到了同样的问题,2.1版本即使手动设置为4也无法解决,替换成2.0版本一切正常

Z
Zempty
设置为8是Serializable。4是Repeatable Read
wudz
wudz
设成2
返回顶部
顶部