I'm having trouble running a multi-criteria query in Oracle. The
generated query looks correct (see log below). I can execute the same
query using SQL Developer. I can also execute non multi-criteria
queries with no problem. I've attached the NH config and a snippet
from the logs below.

I've tried setting the hbm2ddl property to 'keywords' and 'auto-
quote'. No difference.

Thanks.

Sudip

----------------------------------------------------------------------------------------
In order to get multi-criteria queries to work, I had to create a
class derived from OracleDataClientDriver as follows:

public class MTOracleDataClientDriver :
NHibernate.Driver.OracleDataClientDriver
{
   public override bool SupportsMultipleQueries
    {
      get { return true; }
    }
}

--------------
NH config:
---------------
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
    <session-factory>
      <property
name="connection.provider">NHibernate.Connection.DriverConnectionProvider,
NHibernate</property>

      <!-- This is the System.Data.dll provider for MSSQL Server -->
      <property
name="connection.driver_class">Acme.BusinessEntity.DataAccess.Persistence.MTOracleDataClientDriver,
Acme.BusinessEntity.DataAccess</property>
      <property name="connection.connection_string">
        Data Source=XXXX;User Id=xxxx;Password=xxxx;
      </property>
      <property name="show_sql">true</property>
      <property name="dialect">NHibernate.Dialect.Oracle10gDialect</
property>
      <property
name="proxyfactory.factory_class">NHibernate.ByteCode.Castle.ProxyFactoryFactory,
NHibernate.ByteCode.Castle</property>
      <property name="hbm2ddl.keywords">none</property>
    </session-factory>
  </hibernate-configuration>

---------
Logs:
---------

2009-11-16 21:16:23,878 [ENGDEV-LT1-ConsoleHost]
[NHibernate.AdoNet.AbstractBatcher] [ERROR] Could not execute query:
SELECT this_.c_Order_Id as c1_5_0_, this_.c_ReferenceNumber as
c2_5_0_, this_.c_Description as c3_5_0_, this_.c_InvoiceMethod as
c4_5_0_, this_.c_AccountId as c5_5_0_ FROM t_be_Order_cor_ord this_;

SELECT count(*) as y0_ FROM t_be_Order_cor_ord this_;



Oracle.DataAccess.Client.OracleException ORA-00911: invalid
character    at
Oracle.DataAccess.Client.OracleException.HandleErrorHelper(Int32
errCode, OracleConnection conn, IntPtr opsErrCtx, OpoSqlValCtx*
pOpoSqlValCtx, Object src, String procedure)

   at Oracle.DataAccess.Client.OracleException.HandleError(Int32
errCode, OracleConnection conn, String procedure, IntPtr opsErrCtx,
OpoSqlValCtx* pOpoSqlValCtx, Object src)

   at Oracle.DataAccess.Client.OracleCommand.ExecuteReader(Boolean
requery, Boolean fillRequest, CommandBehavior behavior)

   at Oracle.DataAccess.Client.OracleCommand.ExecuteDbDataReader
(CommandBehavior behavior)

   at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader
()

   at NHibernate.AdoNet.AbstractBatcher.ExecuteReader(IDbCommand cmd)

2009-11-16 21:16:23,941 [ENGDEV-LT1-ConsoleHost]
[NHibernate.Transaction.AdoTransaction] [DEBUG] IDbTransaction
disposed.

--

You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=.


Reply via email to