-->
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.  [ 3 posts ] 
Author Message
 Post subject: Migrating 2.1 to 3.0 performance issues
PostPosted: Sun Mar 19, 2006 4:40 pm 
Beginner
Beginner

Joined: Mon Dec 06, 2004 4:20 pm
Posts: 34
In migrating from 2.1 to 3.0, I am finding significant performance problems when the session factory digests the mapping files. I have about 150 mapping files that were converted from 2.1 to 3.0 (via xdoclet regeneration). My performance has since suffered greatly. When the SessionFactory loads the mappings it now takes nearly 3 minutes, vs. about 10 seconds in 2.1!!!! Here's a sample 3.0 mapping.. Any ideas please - I know there may be some changes to the mapping file (such as role?), but xdoclet is not putting them in... would this have an impact?

Code:
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE hibernate-mapping PUBLIC
    "-//Hibernate/Hibernate Mapping DTD 2.0//EN"
    "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">

<hibernate-mapping
>
    <class
        name="gov.mass.eos.business.model.ce.household.Referral"
        table="Referral"
        select-before-update="true"
    >

        <id
            name="referralId"
            column="ReferralId"
            type="java.lang.Long"
            unsaved-value="null"
        >
            <generator class="sequence">
                <param name="sequence">ReferralId</param>
              <!-- 
                  To add non XDoclet generator parameters, create a file named
                  hibernate-generator-params-Referral.xml
                  containing the additional parameters and place it in your merge dir.
              -->
            </generator>
        </id>

        <property
            name="typeCode"
            type="java.lang.String"
            update="true"
            insert="true"
            column="TypeCode"
            length="10"
        />

        <property
            name="effectiveDate"
            type="java.util.Date"
            update="true"
            insert="true"
            column="EffectiveDate"
            length="7"
        />

        <property
            name="followupCode"
            type="java.lang.String"
            update="true"
            insert="true"
            column="FollowupCode"
            length="10"
        />

        <many-to-one
            name="household"
            class="gov.mass.eos.business.model.ce.household.Household"
            cascade="none"
            outer-join="auto"
            update="true"
            insert="true"
        >
            <column
                name="HouseholdId"
            />
        </many-to-one>

        <many-to-one
            name="referralOrganization"
            class="gov.mass.eos.business.model.ce.household.ReferralOrganization"
            cascade="none"
            outer-join="auto"
            update="true"
            insert="true"
        >
            <column
                name="ReferralOrganizationId"
            />
        </many-to-one>

        <property
            name="lastUpdateDateTime"
            type="java.util.Date"
            update="true"
            insert="true"
            column="lastUpdateDateTime"
        />

        <property
            name="lastUpdateProgramName"
            type="java.lang.String"
            update="true"
            insert="true"
            column="lastUpdateProgramName"
        />

        <property
            name="lastUpdateStaffMemberId"
            type="java.lang.Long"
            update="true"
            insert="true"
            column="lastUpdateStaffMemberId"
        />

        <!--
            To add non XDoclet property mappings, create a file named
                hibernate-properties-Referral.xml
            containing the additional properties and place it in your merge dir.
        -->

    </class>

</hibernate-mapping>



Hibernate version:3.0

Code between sessionFactory.openSession() and session.close():
public static Session currentSession() throws HibernateException {
Session session = (Session) threadLocal.get();

if (session == null || !(session.isOpen())) {
if (sessionFactory == null) {
try {
Configuration config = new Configuration();
sessionFactory = config.configure().buildSessionFactory();
}
catch (Exception e) {
log.error(SESSION_FACTORY_ERROR);
throw new EosRTException(SESSION_FACTORY_ERROR, e);
}
}
session = sessionFactory.openSession();
threadLocal.set(session);
}
return session;
}


Name and version of the database you are using:Oracle10.g


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 19, 2006 4:55 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
This is a Hibernate 2 mapping file. Makew sure your using at least XDoclet 1.2.3 (much better to use the CVS snapshot). Also; make sure you have the version set to "3.0" in the Ant task.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 20, 2006 7:24 am 
Pro
Pro

Joined: Mon Jan 24, 2005 5:39 am
Posts: 216
Location: Germany
If the previous post does not help,
you can try these links:

http://www.hibernate.org/194.html
[url]http://www.hibernate.org/300.html
[/url]

_________________
dont forget to rate !


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.