Pattern « Session « JPA Q&A





1. Session & HttpSession, best practice pattern    forum.hibernate.org

Hello, What would be best practice for the following pattern: The user logs in. The User object is retrieved and stored in the HttpSession. Thereafter, we use the HttpSession-cached object unless we make changes to the User object. I understand that the User record in the DB may change and the HttpSession object will not reflect the change. How this would ...

2. Session in View Pattern and Portlet Development    forum.hibernate.org

I'm about to use Hibernate and Spring in a Portlet project. And would like to know how to apply the Session in View pattern. Since the web.xml is specified for each portlet application I would have to specify many Session in View filters. Is this a problem and is anyone else using Session in View with Portlets? I'm using Websphere Portal ...

4. general question about Open Session in View pattern    forum.hibernate.org

Hello; I'm developing a new module for an existing struts application that doesn't (currently) use Hibernate, but my module is required to do so. I understand that a good way to handle the LazyInit... problem is to employ the above OSIV pattern, and handle session mgmt with a Servlet Filter. All the examples I have found show to configure the webapp ...

5. current-session pattern and StaleObjectStateException    forum.hibernate.org

Hi, Looking at the current-session design here: http://www.hibernate.org/42.html it seems to me it cannot handle retries on StaleObjectStateException. To my understanding, if I wanted to retry the operation on StaleObjectStateException, I'd have to rollback the current transaction and session, open a new session and transaction and re-execute the servlet. The problem is that there is no way for me to invoke ...

6. Question about the Session per Request pattern    forum.hibernate.org

Hi all, Almost all of the implementations of the Session per Request pattern that I have seen preassume that there's a 1-to-1 relationship between Http requests and Servlet container's threads, however nowhere in the Servlet spec is it specified that there should be such a relationship. Although that most of the current Servlet containers handle request in this way, (i.e. establish ...

7. Question about the Open Session in View pattern    forum.hibernate.org

Come on, I can't be the only person to ever wonder about this. The behavior I'm seeing appears to directly violate the documentation. If I'm a complete moron and missed something obvious, then tell me. That's fine. I just want to know what's going on. In case it matters, I'm using MySQL 4.1.18 as the database.

8. Open Session in View pattern doubt - help    forum.hibernate.org

I learned and believed filters complete running before the response is sent and before the page is rendered. Is the author talking about response of the earlier request? I mean closing the open session of request1 while sending the response for request2? I feel like I am missing something great here. Most of you guys seem to have already landed in ...

9. How to implement Request per Session Pattern    forum.hibernate.org