我想宣布下一项声明: Session session = sessionFactory.getCurrentSession(); List<User> result = (List<User>) sessionFactory.getCurrentSession()
.createQuery("from User WHERE master_id=:master_
当我为spring应用程序运行一个测试用例(Junit)时,我得到了这个bug。我的测试类包含:public class MyTestClass extends AbstractControllerTest {
public TestName testMethodName = new TestName();
@Befo
org.hibernate.exception.SQLGrammarException: could not execute query at org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessExcepti
log.debug("Opening Hibernate Session in method "+pjp.getSignature());
// Rethrows the Exception but makes sure the session will be closed
SessionFactoryUtils.closeSession
org.hibernate.impl.SessionImpl.close(SessionImpl.java:325) at org.springframework.orm.hibernate3.SessionFactoryUtils.closeSessionOrRegisterDeferredClose(Session
我有一个服务层类,它具有注释@Controller和在服务调用中生成线程,这是在更新数据库中的内容。我在线程的方法中使用了@transaction注释。但我得到了hibernate例外“没有会话找到”。是否需要向线程添加任何注释?
org.springframework.orm.hibernate4.SpringSessionContext.currentSession(SpringSessionContext.java:97) at org.hibernate.internal.SessionFactoryImpl.getCurrentSession(SessionFactoryImpl.