-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: outOfMemory : cache configuration
PostPosted: Tue Aug 22, 2006 4:32 am 
Newbie

Joined: Mon Aug 21, 2006 11:47 am
Posts: 5
Hibernate version:3.1
Name and version of the database you are using:Oracle9i

Hi,

i'm working on a study for making a DOM cache over a relationnal database.
Database contains XML documents stored as subtrees.
Here is the main table :
Code:
CREATE TABLE XDB_ANCHORS
(
DOC_ID        NUMBER(10),
ID            NUMBER(10), //subtree id
PARENT_ID     NUMBER(10), // parent subtree id
POSITION  NUMBER(10), subtree position in the parent subtree
CONTENT       CLOB //XML
)


CONTENT mapping is done using a UserType which takes the clob and creates a DOM.
So the transformation is done by hibernate and data are cached.

With small files it works fine, but with normal XML files (around 250Mb) I get an outOfMemory exception : Java Heap size.

Cached objects are never freed by session cache.
I used a profiler and I have no reference on my objects, there are only hibernate references.

I think that the problems comes from my cache configuration or maybe as i use UserType i have to evict the objects myself ?

Regards

William

mapping
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
        "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
        "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping>
   <class name="com.airbus.hdom.dom.AdocDocumentFragment" table="XDB_ANCHORS" mutable="false">
      <cache usage="read-only"/>
      <composite-id>
           <key-property name="docId" column="DOC_ID" type="int"/>
           <key-property name="id" type="int" column="ID"/>
           <key-property name="evo" type="int" column="EVO"/>
       </composite-id>
       
      <property name="parentId" column="PARENT_ID"/>
      <property name="key" column="KEY"/>
      <property name="isRemoved" column="ISREMOVED"/>
      <property name="startOffset" column="START_OFFSET"/>
      <property name="endOffset" column="END_OFFSET"/>
      <property name="root" type="com.airbus.hdom.util.HibernateTypes.ClobToDomType">
         <column name="CONTENT" sql-type="CLOB"/>
      </property>
    </class>
</hibernate-mapping>


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 23, 2006 9:07 am 
Newbie

Joined: Mon Aug 21, 2006 11:47 am
Posts: 5
i load objects from database using an oracle PIPELINED stored procedure.

so it returns a collection : is it possible to evict an object from the collection without evicting the entire collection ?

thanks


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 28, 2006 2:38 pm 
Newbie

Joined: Wed Nov 22, 2006 5:09 pm
Posts: 8
Hi Will,

I guess this is more of a question. Since you have used PIPELINED SP's. I have just started using them, Could you please let me know how to call them in the JAVA application. What are the necessary items required e.g mapping ect.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 28, 2006 2:50 pm 
Senior
Senior

Joined: Mon Oct 23, 2006 5:12 am
Posts: 141
Location: Galicia, Spain
Quote:
Cached objects are never freed by session cache


What do you mean? If you close() the session the objects are not freed?

What session/transaction strategy are you using?

_________________
andresgr (--don't forget to rate)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 28, 2006 5:04 pm 
Newbie

Joined: Sat May 14, 2005 11:19 am
Posts: 14
Hibernate keeps a snapshot of all objects in the session until you close() it, clear() it or evict() the object. To avoid those snapshots you can setCacheMode(CacheMode.IGNORE) on your query or use a stateless session.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.