Results 1 to 4 of 4

Thread: openSessionInViewInterceptor and Java heap space

  1. #1
    Join Date
    Jul 2005
    Posts
    9

    Default 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

  2. #2
    Join Date
    Aug 2004
    Location
    New York
    Posts
    168

    Default

    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.
    Karl Baum
    weblog: www.jroller.com/page/kbaum

  3. #3
    Join Date
    Jul 2005
    Posts
    9

    Default

    Do You know, how to do this in openSessionInViewInterceptor?

  4. #4
    Join Date
    Aug 2004
    Location
    Hawaii, US
    Posts
    225

    Default

    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
  •