Hi,
I am trying to access a fairly complicated database (with cyclic dependencies) with Hibernate as JPA provider under JSE.
Even with simple operations I get OutOfMemory errors.
A heap dump analysis shows that
Code:
The classloader/component "sun.misc.Launcher$AppClassLoader @ 0x2fc51b8" occupies 57.874.744 (82,53%) bytes. The memory is accumulated in one instance of "java.util.HashMap$Entry[]" loaded by "<system class loader>".
hibernate.cfg.xml:
Code:
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="connection.url">jdbc:postgresql://localhost/bla</property>
<property name="connection.username">postgres</property>
<property name="connection.driver_class">org.postgresql.Driver</property>
<property name="dialect">org.hibernate.dialect.PostgreSQLDialect</property>
<property name="connection.password">bla</property>
<property name="transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</property>
<property name="current_session_context_class">thread</property>
<!-- this will show us all sql statements -->
<property name="hibernate.show_sql">true</property>
<property name="hibernate.format_sql">true</property>
<!-- Achtung nicht in Produktion verwenden, das Schema wird automatisch erzeugt -->
<property name="hibernate.hbm2ddl.auto">validate</property>
</session-factory>
</hibernate-configuration>
persistence.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
<persistence-unit name="bafoeg3">
<properties>
<property name="hibernate.ejb.cfgfile" value="/hibernate.cfg.xml" />
</properties>
</persistence-unit>
</persistence>
In the log I see tons of entries like
Code:
10:52:59,560 DEBUG [EntityLoader] Static select for entity bla.dbaccess.domain.KennzeichenFreibetrag: select kennzeiche0_.id as id712_0_, kennzeiche0_.abrev as abrev712_0_, kennzeiche0_.available as available712_0_, kennzeiche0_.mask as mask712_0_, kennzeiche0_.value as value712_0_ from KeyEntity kennzeiche0_ where kennzeiche0_.id=? and kennzeiche0_.TYPE='frb' for update
Any ideas what might going wrong?
Thanks,
Hans