Connect to OracleXE on Windows Server 2008 x64

Connect to OracleXE on Windows Server 2008 x64

Postby ths » Tue 27 Nov 2012 14:50

Hello,

I have a problem to connect to OracleXE on Windows Server 2008 x64. Both OracleXE 11g R2 and ASP.NET MVC3 Application are installed on this server. It seems that dotConnect is looking for information in a wrong section of registry. Setting Home=XE in the connection string (the entry in registry is Wow6432Node\Oracle\KEY_XE) does not help.
The option Direct=True works fine.

dotCoonect version is Version=7.1.58.0

Error message:
Can not obtain Oracle client information from registry. Make sure that Oracle Client Software is installed, or use Direct mode of connecting to server.
Stack Trace:


[InvalidOperationException: Can not obtain Oracle client information from registry. Make sure that Oracle Client Software is installed, or use Direct mode of connecting to server.]
Devart.Data.Oracle.OracleHomeCollection.a() +1971
Devart.Data.Oracle.OracleInternalConnection..ctor(ag connectionOptions, OracleInternalConnection proxyConnection) +762
Devart.Data.Oracle.df.a(j A_0, Object A_1, DbConnectionBase A_2) +141
Devart.Common.DbConnectionFactory.a(DbConnectionPool A_0, j A_1, DbConnectionBase A_2) +394
Devart.Common.DbConnectionPool.a(DbConnectionBase A_0) +51
Devart.Common.DbConnectionPool.GetObject(DbConnectionBase owningConnection) +901
Devart.Common.DbConnectionFactory.b(DbConnectionBase A_0) +270
Devart.Common.DbConnectionClosed.Open(DbConnectionBase outerConnection) +385
Devart.Common.DbConnectionBase.Open() +516
Devart.Data.Oracle.OracleConnection.Open() +282
System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(Boolean openCondition, DbConnection storeConnectionToOpen, DbConnection originalConnection, String exceptionCode, String attemptedOperation, Boolean& closeStoreConnectionOnFailure) +67

[EntityException: The underlying provider failed on Open.]
System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(Boolean openCondition, DbConnection storeConnectionToOpen, DbConnection originalConnection, String exceptionCode, String attemptedOperation, Boolean& closeStoreConnectionOnFailure) +10975150
System.Data.EntityClient.EntityConnection.Open() +142
COMPANYTHModel.COMPANYTHEntities.CHECKPASSWORD(String PUSERNUMBER, String PUSERPASSWORD, Nullable`1& PUSERID) in C:\Projects\Visual Studio\COMPANY\City\COMPANYCityArchive\COMPANYCityArchive\Models\DevArtDbContextDM.Designer.cs:295
COMPANYCity.Repositories.AccountRepository.GetUserByStoredPassword(String UserName, String UserPassword) in C:\Projects\Visual Studio\COMPANY\City\COMPANYCityArchive\COMPANYCityArchive\Repositories\Account\AccountRepository.cs:35
COMPANYCityArchive.Controllers.AccountController.LogOn(LogOnModel model, String returnUrl) in C:\Projects\Visual Studio\COMPANY\City\COMPANYCityArchive\COMPANYCityArchive\Controllers\AccountController.cs:38
lambda_method(Closure , ControllerBase , Object[] ) +179
System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +248
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +39
System.Web.Mvc.<>c__DisplayClass15.<InvokeActionMethodWithFilters>b__12() +125
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +640
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +312
System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +691
System.Web.Mvc.Controller.ExecuteCore() +162
System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +305
System.Web.Mvc.<>c__DisplayClassb.<BeginProcessRequest>b__5() +62
System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0() +20
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +453
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +371


Thanks,
Vladimir
ths
 
Posts: 53
Joined: Thu 29 Dec 2011 16:18

Re: Connect to OracleXE on Windows Server 2008 x64

Postby Pinturiccio » Fri 30 Nov 2012 14:37

Please make sure that capacity of your application (x86 or x64) and capacity of your Oracle Client are the same. You can check the capacity of the process of your application in Task Manager.

ths wrote:the entry in registry is Wow6432Node\Oracle\KEY_XE

This shows that your Oracle XE Client 11g R2 has x86 capacity, and if your application is run as a x64 one, you will get the exception "Cannot obtain Oracle client information from registry. Make sure that Oracle Client Software is installed, or use Direct mode of connecting to server."
Pinturiccio
Devart Team
 
Posts: 1891
Joined: Wed 02 Nov 2011 09:44

Re: Connect to OracleXE on Windows Server 2008 x64

Postby ths » Fri 30 Nov 2012 15:09

Pinturiccio wrote:Please make sure that capacity of your application (x86 or x64) and capacity of your Oracle Client are the same. You can check the capacity of the process of your application in Task Manager.

ths wrote:the entry in registry is Wow6432Node\Oracle\KEY_XE

This shows that your Oracle XE Client 11g R2 has x86 capacity, and if your application is run as a x64 one, you will get the exception "Cannot obtain Oracle client information from registry. Make sure that Oracle Client Software is installed, or use Direct mode of connecting to server."


Hello Pinturiccio,
thank you very much. You are absolutely right.
For everybody who has similar problems with ASP.NET applications, the solution is in the correct settings for corresponding Application Pool.
On Application Pool, select "Extended Settings" and set "Activate 32-Bit-Applications = True".

Thanks, Vladimir
ths
 
Posts: 53
Joined: Thu 29 Dec 2011 16:18


Return to dotConnect for Oracle