Hello,
I have been using nHibernate using sql-server 2005. And everything is working fine.
I swtiched over to oracle 10g, and now when I save an object I get an:
Error Retrieving Current Persistent State exception. The inner exception is ORA-01036: illegal variable name/number.
The sql that is cuasing the error is a select statement. The query looks strange because instead of using the regular bind parameters :p0, :p1, etc. It is using a '?':
The Select-before-update attribute on Book.hbm.xml is set to true.
error retrieving current persistent state[SQL: SELECT book_.bookId, book_.Version as Version9_, book_.bookNumber as BookN3_9_ FROM Library.Book book_ WHERE book_.BookId=?]
If I copy paste the query, replace ? with the id, and run it under oracle, it returns a row.
My session factory settings in the hibernate.cfg.xml is like this:
<session-factory>
<property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
<!--Oracle-->
<property name="connection.driver_class">NHibernate.Driver.OracleDataClientDriver</property>
<property name="connection.connection_string">Data Source=MyDataSrc; User Id=user;Password=pwd</property>
<property name="dialect">NHibernate.Dialect.Oracle9Dialect</property>
<property name="show_sql">true</property>
<property name="use_outer_join">true</property>
<mapping assembly="Model.Library"/>
</session-factory>
Thanks.
|