-->
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.  [ 1 post ] 
Author Message
 Post subject: The right driver and configuration for Oracle, with 2.0GA
PostPosted: Sun Sep 21, 2008 12:30 pm 
Newbie

Joined: Sat Sep 20, 2008 3:39 pm
Posts: 3
I am working on an application using NHibernate 2.0GA. It’s partially working with the two available drivers: NHibernate.Driver.OracleDataClientDriver and NHibernate.Driver. OracleClientDriver. Following the discrete samples found on the web, I tried the following alternative configurations:

<!--Use OracleDataClientDriver-->
<!--<property name="connection.driver_class">NHibernate.Driver.OracleDataClientDriver</property>
<property name="connection.connection_string">Data source=progd1;User Id=***;Password=***;</property>-->


And:
<!--Use OracleClientDriver-->
<property name="connection.driver_class">NHibernate.Driver.OracleClientDriver</property>
<property name="connection.connection_string">Data source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=***)(PORT=1521)))(CONNECT_DATA=(SID = progd1)));User Id=***;Password=***;</property>


With the first configuration I can load the data from database. But cannot save data. I feel the NHibernate is not generating the correct insert statement understood by the driver. See my earlier post: http://forum.hibernate.org/viewtopic.php?t=990795.

With the second configuration I cannot even load the data. Seems the driver cannot even understand the generated select statement. Here is the generated sql:

SELECT workflowin0_.WORKFLOWINDEXID as WORKFLOW1_32_0_, workflowin0_.[NAME] as column2_32_0_, workflowin0_.[DESCRIPTION] as column3_32_0_ FROM WORKFLOWINDEX workflowin0_ WHERE workflowin0_.WORKFLOWINDEXID=?

And it throws exception "ORA-01747: invalid user.table.column, table.column, or column specification".

When I paste this select statement on SQLPlus and replace the ‘?’ mark with parameter, I get exactly the same error.

So, what are the right driver and configuration for accessing Oracle 10g, using NHibernate 2.0GA? Did anyone successfully used this version for Oracle?

Here is the complete configuration section in my app.config:

<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
<bytecode-provider type="lcg"/>
<reflection-optimizer use="true"/>
<session-factory name="NHibernate.Default">
<property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>

<!--Use OracleDataClientDriver-->
<!--<property name="connection.driver_class">NHibernate.Driver.OracleDataClientDriver</property>
<property name="connection.connection_string">Data source=progd1;User Id=***;Password=***;</property>-->

<!--Use OracleClientDriver-->
<property name="connection.driver_class">NHibernate.Driver.OracleClientDriver</property>
<property name="connection.connection_string">Data source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=***)(PORT=1521)))(CONNECT_DATA=(SID = progd1)));User Id=***;Password=***;</property>

<property name="show_sql">true</property>
<property name="dialect">NHibernate.Dialect.Oracle9Dialect</property>
<property name="use_outer_join">true</property>
<property name="command_timeout">444</property>
<property name="query.substitutions">true 1, false 0, yes 'Y', no 'N'</property>
<property name="adonet.wrap_result_sets">false</property>

<mapping assembly="ProgressiveNhEdm"/>
</session-factory>
</hibernate-configuration>


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.