摘要: public class MyContext{ private static final ThreadLocal contextSession = new ThreadLocal(); private static final ThreadLocal contexRequest = ne... 阅读全文
posted @ 2015-06-25 17:02 断点. 阅读(327) 评论(0) 推荐(0) 编辑
摘要: 这两天想看看hibernate的东西,就跟着官网教程自己做,被官网网页上的配置文件给坑了。有两个注意的地方,如果是按照官网的筒子们注意啦,一个是hibernate的头xsd验证文件,不修改成dtd读取hibernate.cxf.xml会抛出Could not parse configuration:... 阅读全文
posted @ 2015-04-21 23:27 断点. 阅读(1217) 评论(0) 推荐(0) 编辑
摘要: String.split时 分隔符是“|”时应该用“\\|”不然就是坑爹了java 在catch 和finally中都有return时,会返回finally中的值如果在finally中写了return语句,name在catch语句中写throw new Exception()时,不会向外层抛出exc... 阅读全文
posted @ 2014-11-21 16:22 断点. 阅读(155) 评论(0) 推荐(0) 编辑
摘要: 总结:hibernate在进行批量处理不给力的主要原因就是Session中存在缓存,而hibernate的机制就是通过session中的一级缓存去同步数据库,所以当进行批量处理时,缓存中保存的数据量很大时会消耗很大内存资源,造成各种崩溃。 其实平时工作中用到大量的批处理数据还是挺少的,很少遇到... 阅读全文
posted @ 2014-05-27 17:10 断点. 阅读(384) 评论(0) 推荐(0) 编辑