开发者

DWR + Spring + JPA Session Closed

开发者 https://www.devze.com 2022-12-09 00:14 出处:网络
Background The application I am working on currently uses Spring + JPA. Everything was working fine before we decided to introduce DWR.

Background

The application I am working on currently uses Spring + JPA. Everything was working fine before we decided to introduce DWR.

Using DWR I invoke a method on a Service class and it then redirects to the Controller.

try{
      return WebContextFactory.get()
                        .forwardToString("/search.do?searchString=" + searchString);
}catch(...){

}

After this, when the search method is invoked at the DAO, it does not find an pen session.

Session session = (Session) entityManager.getDelegate();

This session here is closed...

I think my changes(of introducing DWR) should not in any way affect th开发者_Go百科e Session creation.

Awaiting inputs.

Shardul.


Issue resolved.

The problem was with the configuration of OpenEntityManagerInViewFilter in the web.xml. It was not intercepting the DWR requests as it was mapped to a

*.do

instead of

/*

Shardul.

0

精彩评论

暂无评论...
验证码 换一张
取 消