ODP.NET Managed driver throws an exception while connecting to the Oracle Database

1.4k views Asked by At

Good day,

I am developing a c# application which uses NHibernate + ODP.NET Managed Driver, application throws an exception during connection:

[06.12.2013 12:29:33:324] NHibernate.Exceptions.GenericADOException : could not execute query
   at NHibernate.Loader.Loader.ListIgnoreQueryCache(ISessionImplementor session, QueryParameters queryParameters)
   at NHibernate.Loader.Criteria.CriteriaLoader.List(ISessionImplementor session)
   at NHibernate.Impl.SessionImpl.List(CriteriaImpl criteria, IList results)
   at NHibernate.Impl.CriteriaImpl.List(IList results)
   at NHibernate.Impl.CriteriaImpl.List[T]()
   ...
[Inner Exception] System.ArgumentNullException : Parameter '' cannot be null.
Parameter name: serializationStream
   at OracleInternal.ConnectionPool.PoolManager`3.CreateNewPR(Int32 reqCount, Boolean bForPoolPopulation, ConnectionString csWithDiffOrNewPwd, String instanceName)
   at OracleInternal.ConnectionPool.PoolManager`3.Get(ConnectionString csWithDiffOrNewPwd, Boolean bGetForApp, String affinityInstanceName, Boolean bForceMatch)
   at OracleInternal.ConnectionPool.OraclePoolManager.Get(ConnectionString csWithNewPassword, Boolean bGetForApp, String affinityInstanceName, Boolean bForceMatch)
   at OracleInternal.ConnectionPool.OracleConnectionDispenser`3.Get(ConnectionString cs, PM conPM, ConnectionString pmCS, SecureString securedPassword, SecureString securedProxyPassword)
   at Oracle.ManagedDataAccess.Client.OracleConnection.Open()
   at NHibernate.Connection.DriverConnectionProvider.GetConnection()
   at NHibernate.AdoNet.ConnectionManager.GetConnection()
   at NHibernate.AdoNet.AbstractBatcher.Prepare(IDbCommand cmd)
   at NHibernate.AdoNet.AbstractBatcher.ExecuteReader(IDbCommand cmd)
   at NHibernate.Loader.Loader.GetResultSet(IDbCommand st, Boolean autoDiscoverTypes, Boolean callable, RowSelection selection, ISessionImplementor session)
   at NHibernate.Loader.Loader.DoQuery(ISessionImplementor session, QueryParameters queryParameters, Boolean returnProxies)
   at NHibernate.Loader.Loader.DoQueryAndInitializeNonLazyCollections(ISessionImplementor session, QueryParameters queryParameters, Boolean returnProxies)
   at NHibernate.Loader.Loader.DoList(ISessionImplementor session, QueryParameters queryParameters)

Software version:

Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production

ODP.NET Managed Driver version 121.1.1

With other oracle database: "Oracle Database 11g Release 11.2.0.3.0 - 64bit Production" it is working fine!

With Oracle ODP.NET unmanaged it is also working fine! With Oracle Client (System.Data.OracleClient) is is also working fine!

May be someone knows how to fix that? thanks!

1

There are 1 answers

0
Alexanderius On BEST ANSWER

The problem was in non-standard database encoding. To fix this problem you should use standard encoding in data-base (convert your non-standard encoding in database to standard (UTF8)).