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.  [ 7 posts ] 
Author Message
 Post subject: ORA-01036: illegal variable name/number
PostPosted: Thu Aug 16, 2007 3:52 pm 
Beginner
Beginner

Joined: Wed May 02, 2007 12:24 am
Posts: 41
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.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 17, 2007 8:31 pm 
Beginner
Beginner

Joined: Wed May 02, 2007 12:24 am
Posts: 41
I just switched to the microsoft's oracle driver, no luck...

The problem is that I can't do Select-Before-Update when I'm running on oracle?

Does anyone else have this problem?

Is anyone using oracle and Select-Before-Update?

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 22, 2007 12:30 pm 
Newbie

Joined: Wed Sep 05, 2007 12:22 pm
Posts: 8
We also get the error when performing a simple select statement.

Having stepped into the nhibernate code it would seem the issue is with ODP.Net rather than nhibernate.

We are using v2.102.2.20 of Oracle.DataAccess.dll

Fortunately, for us switching to the Microsoft Driver fixed the issue though we would rather be using odp.net due to the performance gains it gives.

It woould be nice to see if anyone else has experienced the same issue?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 20, 2007 12:12 pm 
Newbie

Joined: Tue Nov 20, 2007 12:08 pm
Posts: 2
Im actually having the same problem, did you solve it??.

I have tu keep using Oracle , so changing to Microsoft is not an option for me :(.

Any help would be very apreciated....

I hope to read an answer soon, thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 20, 2007 1:08 pm 
Newbie

Joined: Wed Sep 05, 2007 12:22 pm
Posts: 8
Hi,

It seems to be a bug with the oracle driver. We have tried the latest version (at the time) of the oracle driver but it made no difference.

If someone from the Hibernate Team could confirm this, that would be great.

Cheers

Russ


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 20, 2007 1:55 pm 
Newbie

Joined: Tue Nov 20, 2007 12:08 pm
Posts: 2
Thanks, Ive been 2 days going crazy with this stuff.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 20, 2007 3:59 pm 
Beginner
Beginner

Joined: Mon Oct 22, 2007 5:44 am
Posts: 28
Hi,

Try to change the Dialect to OracleDialect (Simply remove the 9).
<property name="dialect">NHibernate.Dialect.Oracle9Dialect</property>

If it's not working, attach the class and the mapping file.

_________________
dyahav


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