2020-04-09 12:42
这类调用了 DbKit.close(preparedStatement) 的方法都抛出了 SQLException,而在外层会被 try catch 到它,并且会被调用 DbKit.close(connection)
而 DbKit.close(connection) 是会将从 connection 中打开的 preparedStatement 一并关掉,理论上来说是没有问题的
当然,不排除有些数据库驱动或者数据源连接池没有保障 connection.close() 后自动关闭 preparedStatement
所以,jfinal 4.9 已经使用 JDK 7 加入的 try-with-resources 语法对这个地方加强了:
https://gitee.com/jfinal/jfinal/commit/ea4eeefbc4e611e6f794fa77144528480778282e
jfinal 先前的处理方式用了很多年了,是没有问题的
2020-04-08 11:01
@zzutligang 提供更多的你的测试细节,才能找到原因
当前你给的信息量肯定是不够的
2020-04-07 17:30
@zzutligang 这正是要排查的地方, 找到一个最早被调用的地方使用 use 方法,例如在 MyConfig 的 configConstant(Constants me) 中做这事:
public class MyConfig extends JFinalConfig {
public void configConstant(Constants me) {
PropKit.use(...);
...
}
...
}
2020-04-07 16:38
@zzutligang 应该只是一个先后问题,只要 use 一次, 后面一直 get 就可以了
2020-04-07 16:37
@tctc4869 只需关注从数据库取数据, 更新、写入数据不需要扩展