2018-10-30 09:11

是改数据库设置?改代码没用吗?波总,我看了下mysql数据库引擎没有问题.就是InnoDb.具体参数如下.
Variable_name Value
default_storage_engine InnoDB
default_tmp_storage_engine InnoDB
disabled_storage_engines
internal_tmp_disk_storage_engine InnoDB

2018-10-29 17:09

我用压力测试工具,发送了1200条并发请求.本来应该更新一个字段为1200的,结果只有16.这个问题需要我怎么改代码呢.真的特别急.希望波总和各位大神帮我看下.

2018-10-29 16:36

还有我执行find方法的时候,还会出现和数据库数据不一致的情况.感觉这个没解决特别烦啊,波总

2018-10-23 16:19

@JFinal 波总,现在恢复默认设置了.但是仍然没法解决问题.现在配置除了最大活跃数,其他都是默认设置.不知道怎么处理了.
现在的配置就只有这些了.
DruidPlugin druidPlugin = createDruidPlugin();
druidPlugin.addFilter(new StatFilter());
WallFilter wall = new WallFilter();//防sql注入
wall.setDbType("mysql");
druidPlugin.addFilter(wall);
druidPlugin.setMaxActive(1200);
me.add(druidPlugin);

2018-10-19 17:07

com.jfinal.plugin.activerecord.ActiveRecordException: java.sql.SQLException: connection holder is null
at com.jfinal.plugin.activerecord.DbPro.query(DbPro.java:109)
at com.jfinal.plugin.activerecord.DbPro.queryColumn(DbPro.java:154)
at com.jfinal.plugin.activerecord.DbPro.queryNumber(DbPro.java:280)
at com.jfinal.plugin.activerecord.DbPro.queryLong(DbPro.java:187)
at com.jfinal.plugin.activerecord.DbPro.queryLong(DbPro.java:192)
at com.jfinal.plugin.activerecord.Db.queryLong(Db.java:144)
at com.renxi.core.controller.AppController.getJudgeAddMessage(AppController.java:153)
at sun.reflect.GeneratedMethodAccessor35.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at com.jfinal.aop.Invocation.invoke(Invocation.java:73)
at com.renxi.core.interceptor.MyInterceptor.doIntercept(MyInterceptor.java:34)
at com.jfinal.aop.PrototypeInterceptor.intercept(PrototypeInterceptor.java:26)
at com.jfinal.aop.Invocation.invoke(Invocation.java:67)
at com.jfinal.ext.interceptor.SessionInViewInterceptor.intercept(SessionInViewInterceptor.java:44)
at com.jfinal.aop.Invocation.invoke(Invocation.java:67)
at com.jfinal.core.ActionHandler.handle(ActionHandler.java:83)
at com.jfinal.plugin.druid.DruidStatViewHandler.handle(DruidStatViewHandler.java:81)
at com.jfinal.core.JFinalFilter.doFilter(JFinalFilter.java:73)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:610)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:503)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.sql.SQLException: connection holder is null
at com.alibaba.druid.pool.DruidPooledConnection.checkStateInternal(DruidPooledConnection.java:1140)
at com.alibaba.druid.pool.DruidPooledConnection.checkState(DruidPooledConnection.java:1131)
at com.alibaba.druid.pool.DruidPooledConnection.prepareStatement(DruidPooledConnection.java:333)
at sun.reflect.GeneratedMethodAccessor31.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at com.jfinal.plugin.activerecord.SqlReporter.invoke(SqlReporter.java:58)
at com.sun.proxy.$Proxy6.prepareStatement(Unknown Source)
at com.jfinal.plugin.activerecord.DbPro.query(DbPro.java:78)
at com.jfinal.plugin.activerecord.DbPro.query(DbPro.java:107)
... 30 more

2018-09-19 15:58

@netwild 有没有办法做其他处理呢.因为我是用的 @Before(CacheInterceptor.class) 这个注解.如果要像这样增加代码的话,个人觉得很麻烦.就不能像hibernate一样实现对缓存数据的更新吗?

2018-08-23 08:57

@JFinal 额,是因为 slf4j-log4j12-1.7.25.jar 这个jar导致的.但是这个jar又是 ehcache-2.2.0.jar 必须的.我想下办法,谢谢了,

2018-08-22 10:53

@JFinal 额,我现在改为 log4j.rootLogger=DEBUG, stdout, file. 都是DEBUG界面了,还是出不来日志文件.我晕了.控制台都出来了.就是不能生成日志文件.不晓得为什么?应该jfinal 不用配置其他的吧

2018-08-21 17:40

@JFinal 我配置的内容是
log4j.rootLogger=ERROR, stdout, file
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%n%-d{yyyy-MM-dd HH:mm:ss}%n[%p]-[Thread: %t]-[%C.%M()]: %m%n

# Output to the File
log4j.appender.file=org.apache.log4j.DailyRollingFileAppender
log4j.appender.file.DatePattern='_'yyyy-MM-dd'.log'
log4j.appender.file.File=./runLog.log
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%n%-d{yyyy-MM-dd HH:mm:ss}%n[%p]-[Thread: %t]-[%C.%M()]: %m%n
但是为什么文件目录在和 log4j.properties 同级下的 runLog.log 没有任何东西呢?我也不知道哪儿没配置对