Hi all,
I took some sample code I ran in 2.0.3 and ran it with the jars and libs from 2.1 beta 6. My code ran fine but took more than 3 times as long to execute the database query!! Mind you this the same exact code run under both versions.
Following is snippets of my code:
Iterator it = null;
Session session = null;
Transaction t = null;
SessionFactory sessions = new Configuration()
.addClass(DataSrcClmn.class)
.addClass(FldrClmn.class)
.buildSessionFactory();
session = sessions.openSession();
t = session.beginTransaction();
it = session.iterate(
"from DataSrcClmn as f where f.SrcNum = :SrcNum",
"2000", Hibernate.STRING);
while (it.hasNext() ) {
DataSrcClmn clm = (DataSrcClmn)it.next();
}
t.commit();
session.close();
Under 2.0.3, this executed in about 22 seconds to return 714 objects, while under 2.1 beta 6 this takes 73 seconds.
Is there something wrong with my code that it runs so slowly with the beta?
Thanks in advance,
Daniel
Below is my mapping file for DataSrcClmn. (Let me know if you need the one for FldrClmn as well):
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd" >
<hibernate-mapping>
<!--
Created by Middlegen Hibernate plugin
http://boss.bekk.no/boss/middlegen/
http://hibernate.sourceforge.net/
-->
<class
name="test.hibernate.DataSrcClmn"
table="DATA_SRC_CLMN"
>
<id
name="clmnNum"
type="int"
column="CLMN_NUM"
>
<generator class="assigned" />
</id>
<property
name="dataSrcNum"
type="int"
column="DATA_SRC_NUM"
not-null="true"
unique="true"
length="5"
>
<meta attribute="use-in-tostring">true</meta>
</property>
<property
name="clmnName"
type="java.lang.String"
column="CLMN_NAME"
not-null="true"
unique="true"
length="30"
>
<meta attribute="use-in-tostring">true</meta>
</property>
<property
name="attrName"
type="java.lang.String"
column="ATTR_NAME"
not-null="true"
length="200"
>
<meta attribute="use-in-tostring">true</meta>
</property>
<property
name="clmnDesc"
type="java.lang.String"
column="CLMN_DESC"
length="2000"
>
<meta attribute="use-in-tostring">true</meta>
</property>
<property
name="dataTypeCd"
type="java.lang.String"
column="DATA_TYPE_CD"
not-null="true"
length="12"
>
<meta attribute="use-in-tostring">true</meta>
</property>
<property
name="dataOfstCnt"
type="int"
column="DATA_OFST_CNT"
not-null="true"
length="5"
>
<meta attribute="use-in-tostring">true</meta>
</property>
<property
name="dataLngthCnt"
type="short"
column="DATA_LNGTH_CNT"
not-null="true"
length="4"
>
<meta attribute="use-in-tostring">true</meta>
</property>
<property
name="dataScaleCnt"
type="boolean"
column="DATA_SCALE_CNT"
not-null="true"
length="1"
>
<meta attribute="use-in-tostring">true</meta>
</property>
<property
name="nullSw"
type="java.lang.String"
column="NULL_SW"
not-null="true"
length="1"
>
<meta attribute="use-in-tostring">true</meta>
</property>
<property
name="cdTblName"
type="java.lang.String"
column="CD_TBL_NAME"
length="30"
>
<meta attribute="use-in-tostring">true</meta>
</property>
<property
name="lstName"
type="java.lang.String"
column="LST_NAME"
length="30"
>
<meta attribute="use-in-tostring">true</meta>
</property>
<property
name="ngtvNumSw"
type="java.lang.String"
column="NGTV_NUM_SW"
not-null="true"
length="1"
>
<meta attribute="use-in-tostring">true</meta>
</property>
<property
name="dataFrmtTxt"
type="java.lang.String"
column="DATA_FRMT_TXT"
length="50"
>
<meta attribute="use-in-tostring">true</meta>
</property>
<property
name="sasFldName"
type="java.lang.String"
column="SAS_FLD_NAME"
unique="true"
length="8"
>
<meta attribute="use-in-tostring">true</meta>
</property>
<property
name="pcSasFldName"
type="java.lang.String"
column="PC_SAS_FLD_NAME"
length="30"
>
<meta attribute="use-in-tostring">true</meta>
</property>
<property
name="sasLabelTxt"
type="java.lang.String"
column="SAS_LABEL_TXT"
length="200"
>
<meta attribute="use-in-tostring">true</meta>
</property>
<property
name="creatTs"
type="java.sql.Timestamp"
column="CREAT_TS"
not-null="true"
length="7"
>
<meta attribute="use-in-tostring">true</meta>
</property>
<property
name="creatUserId"
type="java.lang.String"
column="CREAT_USER_ID"
not-null="true"
length="20"
>
<meta attribute="use-in-tostring">true</meta>
</property>
<property
name="updtTs"
type="java.sql.Timestamp"
column="UPDT_TS"
length="7"
>
<meta attribute="use-in-tostring">true</meta>
</property>
<property
name="updtUserId"
type="java.lang.String"
column="UPDT_USER_ID"
length="20"
>
<meta attribute="use-in-tostring">true</meta>
</property>
<property
name="sqncNum"
type="int"
column="SQNC_NUM"
not-null="true"
length="6"
>
<meta attribute="use-in-tostring">true</meta>
</property>
<property
name="sasCmtTxt"
type="java.lang.String"
column="SAS_CMT_TXT"
length="40"
>
<meta attribute="use-in-tostring">true</meta>
</property>
<property
name="slctTxt"
type="java.lang.String"
column="SLCT_TXT"
length="2000"
>
<meta attribute="use-in-tostring">true</meta>
</property>
<property
name="tmpltOnlySw"
type="java.lang.String"
column="TMPLT_ONLY_SW"
length="1"
>
<meta attribute="use-in-tostring">true</meta>
</property>
<property
name="newClmnSw"
type="java.lang.String"
column="NEW_CLMN_SW"
not-null="true"
length="1"
>
<meta attribute="use-in-tostring">true</meta>
</property>
<property
name="fldrUpgrdSw"
type="java.lang.String"
column="FLDR_UPGRD_SW"
not-null="true"
length="1"
>
<meta attribute="use-in-tostring">true</meta>
</property>
<property
name="padKeySqncNum"
type="java.lang.Integer"
column="PAD_KEY_SQNC_NUM"
length="1"
>
<meta attribute="use-in-tostring">true</meta>
</property>
<!-- associations -->
<!-- bi-directional one-to-one association to FldrClmn -->
<one-to-one
name="FldrClmn"
class="test.hibernate.FldrClmn"
outer-join="auto"
/>
</class>
</hibernate-mapping>