Hibernate4 提示Could not obtain transaction-synchronized Session for current thread
非web项目通过getCurrentSession()这个api获取session时一直提示Could not obtain transaction-synchronized Session for current thread这个异常,如果采用opensession来获取的话则没有问题,但opensession的话要自己管理session,要手动关闭,不方便,使用getCurrentSessio
原创
2016-11-15 21:42:20 ·
2906 阅读 ·
0 评论