大神都来看看吧!!!-Could not obtain transaction-synchronized Session for current thread
异常情况:
Exception in thread "taskExecutor-1" org.hibernate.HibernateException: Could not obtain transaction-synchronized Session for current thread
at org.springframework.orm.hibernate4.SpringSessionContext.currentSession(SpringSessionContext.java:134)
at org.hibernate.internal.SessionFactoryImpl.getCurrentSession(SessionFactoryImpl.java:1014)
at cn.uihome.hibernate.dao.HibernateGenericDao.getCurrentSession(HibernateGenericDao.java:73)
at cn.uihome.hibernate.dao.HibernateGenericDao.save(HibernateGenericDao.java:106)
at cn.uihome.hibernate.basedao.BaseDao.save(BaseDao.java:187)
at cn.uihome.service.noification.NotificationCommentManager.addNotificationComment(NotificationCommentManager.java:45)
at cn.com.guju.util.notification.NotificationCommentUtil.updateNotification(NotificationCommentUtil.java:123)
at cn.com.guju.util.notification.NotificationCommentUtil.addNotificationForCommented(NotificationCommentUtil.java:101)
at cn.com.guju.aop.task.activity.AsyncActivityTask.run(AsyncActivityTask.java:32)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
我是想在action里 开启一个新的线程,但这个线程涉及到Hibernate数据库的操作,所以报这个问题,求救大神给解决啊!!!!!!