Hi all,
I am using v22branch and I am experiencing a long time to startup hibernate. I've read something about serialization implemented in version 2.2 but I don't know if its enabled by default or if I should set some property. I am loading 2 simple one-to-many collection classes.
Is there any improvement in startup speed?
All the code to initialize hibernate and to use it has been generated automatically by Hibernate Synchronizer. AFAIK there should be much difference in speed if I just did my initialization procedures. There is no overhead introduced by Synchronizer.
Here are my hibernate xml files (the attributes are in portuguese, but I guess this is not a problem):
Code:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-configuration
PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd">
<hibernate-configuration>
<session-factory>
<!-- dialect for PostgreSQL -->
<property name="dialect">net.sf.hibernate.dialect.PostgreSQLDialect</property>
<!-- local connection properties -->
<property name="hibernate.connection.url">jdbc:postgresql://fred:5432/cceng</property>
<property name="hibernate.connection.driver_class">org.postgresql.Driver</property>
<property name="hibernate.connection.username">cceng</property>
<property name="hibernate.connection.password">cceng</property>
<!--
<property name="hibernate.connection.provider_class">net.sf.hibernate.connection.C3P0ConnectionProvider</property>
<property name="hibernate.c3p0.minPoolSize">5</property>
<property name="hibernate.c3p0.maxPoolSize">20</property>
<property name="hibernate.c3p0.timeout">1800</property>
<property name="hibernate.c3p0.max_statement">50</property>
-->
<property name="hibernate.show_sql">true</property>
<property name="hibernate.use_outer_join">true</property>
<mapping resource="RecRdv.hbm" />
<mapping resource="Trecho.hbm" />
</session-factory>
</hibernate-configuration>
RecRdv.hbm:
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd" >
<hibernate-mapping package="business">
<class
name="RecRdv"
table="rec_rdv"
>
<id
name="Key"
type="java.lang.String"
column="key"
length="32"
>
<generator class="uuid.hex"/>
</id>
<property
name="Identificador"
column="identificador"
type="java.lang.String"
length="30"
not-null="false"
/>
<property
name="Status"
column="status"
type="business.types.RecRdv.StatusEnumType"
not-null="false"
/>
<property
name="Gdh"
column="gdh"
type="timestamp"
not-null="false"
length="8"
/>
<property
name="Denominacao"
column="denominacao"
type="string"
not-null="false"
length="50"
/>
<property
name="Extensao"
column="extensao"
type="java.lang.Float"
not-null="false"
/>
<property
name="Coordenadas"
column="coordenadas"
type="business.types.postgis.MultiPointType"
not-null="false"
/>
<set name="Trechos" cascade="all-delete-orphan" lazy="true" inverse="true">
<key column="rec_rdv_key"/>
<one-to-many class="Trecho"/>
</set>
</class>
</hibernate-mapping>
Trecho.hbm:
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd" >
<hibernate-mapping package="business">
<class
name="Trecho"
table="trecho"
>
<id
name="Key"
type="java.lang.String"
column="key"
length="32"
>
<generator class="uuid.hex"/>
</id>
<property
name="TipoRodovia"
column="tipo_rdv"
type="business.types.Trecho.TipoRodoviaEnumType"
not-null="false"
length="4"
/>
<property
name="CondicaoMeteorologica"
column="cond_met"
type="business.types.Trecho.CondicaoMeteorologicaEnumType"
not-null="false"
length="4"
/>
<property
name="CondicaoEspecial"
column="cond_esp"
type="business.types.Trecho.CondicaoEspecialEnumType"
not-null="false"
length="4"
/>
<property
name="Coordenadas"
column="coordenadas"
type="business.types.postgis.MultiPointType"
not-null="false"
/>
<property
name="TipoFluxo"
column="tipo_fluxo"
type="business.types.Trecho.TipoFluxoEnumType"
not-null="false"
length="4"
/>
<property
name="LarguraAcostamento"
column="larg_acost"
type="java.lang.Float"
not-null="false"
length="4"
/>
<property
name="LarguraPista"
column="larg_pista"
type="java.lang.Float"
not-null="false"
length="4"
/>
<property
name="CaracteristicaTerreno"
column="caracteristica"
type="business.types.Trecho.CaracteristicaTerrenoEnumType"
not-null="false"
length="4"
/>
<many-to-one
name="RecRdv"
class="RecRdv"
not-null="true"
>
<column name="rec_rdv_key"/>
</many-to-one>
</class>
</hibernate-mapping>