I have developed a application using NHibernate version 1.0.2.0 over ORACLE version 10.2.0.1.0 in the Server and the same version for the Oracle Client.
I have a table with more than 1 million records, and the object to build has one property for each field in the table. It means nothing special.
When i am trying to do a session.Load() to get an specific object (using the primary key) spends about 3 seconds, while if i use session.CreateSQLQuery() to get the same object using the primary key as weel it spends about 0,05 seconds.
If do the same test with a few data in the table (about 10000) is working both methods fine. But if the table has 1 million records the load take a long time.
I have debud the application and the problem is in the method DoQuery() in the class NHibernate.Loader.Loader. And in the line 326:
for( count = 0; count < maxRows && rs.Read(); count++ )
To do the rs.Read() takes about 3 seconds.
the object rs is a System.Data.OracleClient.OracleDataReader
and the query to do is :
SELECT regdi0_.REGDIID as REGDIID0_, regdi0_.REGID as REGID0_,
regdi0_.DITAHUN as DITAHUN0_, regdi0_.DIKODE as DIKODE0_,
regdi0_.DINOMOR as DINOMOR0_, regdi0_.DITANGGAL as DITANGGAL0_
FROM REGDI regdi0_ WHERE regdi0_.REGDIID=:p0
I think there is a problem biulding the Oracle Command inside the NHibernate. Someone else has the same problem??
Hibernate version: 1.0.2.0
Mapping documents:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">
<class name="PerformanceNHibernate.RegDI, PerformanceNHibernate"
table="REGDI" >
<id name="RDI_RegDIId" column="REGDIID" type="String">
<generator class="uuid.hex"/>
</id>
<property name ="RDI_RegisterLink" column ="REGID" type ="String"/>
<property column="DIKODE" type="String" name="RDI_DICode" not-null="true" length="6" />
<property column="DINOMOR" type="String" name="RDI_DINomor" length="30" />
<property column="DITAHUN" type="Int32" name="RDI_DIYear" />
<property column="DITANGGAL" type="DateTime" name="RDI_DIDate" />
</class>
</hibernate-mapping>
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Name and version of the database you are using:
ORACLE version 10.2.0.1.0 in
The generated SQL (show_sql=true):[code][/code]