spring4+hibernate4 在getCurrentSession时候出现异常

错误是:Could not obtain transaction-synchronized Session for current thread
spring4+hibernate 事务管理的时候遇到一个问题,如题,openSession是可以的,但是sessionFactory.getCurrentSession()时候就出现上面的问题

而且郁闷的是junit4测试的时候也是可以getCurrentSession的,一步步运行进去可以看到是SpringSessionContent这个类中的currentSession方法报错的,抛出异常是因为
TransactionSynchronizationManager.isSynchronizationActive()为false

求大神指点迷津...

http://wenku.baidu.com/link?url=OimQ-55pxZvbAF6EB24aNP4XEJxzfPQEE1Q8gixNlbzPS8coXpuNoekV08ij4aIkQU3P3WC0v0FteFXqgYQuyGHD9lzigQGJuhObHIQ9fH3
应该对你有用

用openSesssion就可以 如果要用getCurrentSession的话要在配置文件里配一个事务管理器