-
Oct 31st, 2005, 05:08 AM
#1
openSessionInViewInterceptor and Java heap space
Hi!
I am building web application (blogs, pictures...). I am using openSessionInViewInterceptor. It works fine but when I try to display member's page i get exception: Java heap space. All connections are set to lazy="true". Seems to me, that all member's connections (blog, gallery, messages, comments) are loaded to memory. Am I right? Do You have any solution for that?
--
Regards,
Luk
-
Oct 31st, 2005, 08:59 AM
#2
Sounds like you are running out of memory. Since you are using one session, hiberante will cache each object in that one session. If you are loading a massive amount of data, you could run out of memory. The solution is to call clear on the hibernate session.
-
Nov 1st, 2005, 11:40 AM
#3
Do You know, how to do this in openSessionInViewInterceptor?
-
Nov 2nd, 2005, 12:53 AM
#4
You can't do it in the interceptor directory. I recommend you evict your objects from the session immediately following the processing of those objects. This means doing it inside your DAO, for instance (or whereever you have access to the session).
If you are doing a mass update, consider bypassing hibernate, and executing one single UPDATE into the DB.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules