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.  [ 3 posts ] 
Author Message
 Post subject: Oracle does not work in a web service
PostPosted: Wed Sep 13, 2006 6:52 am 
Newbie

Joined: Wed Sep 13, 2006 6:41 am
Posts: 3
Hi everyone,
I have a problem with web service an Oracle.
I have this code:

---Start code---
XmlDocument inDoc = new XmlDocument ();
inDoc.Load(@"C:\HUBEAI\Normalizzatore\Transact\Code\CreditScoring\Esempi\FormatoInputNormalizzatore_output.xml");
string inputData = inDoc.InnerXml;

string connectionProvider = "NHibernate.Connection.DriverConnectionProvider";
string dialect = "NHibernate.Dialect.OracleDialect";
string connectionDriver = "NHibernate.Driver.OracleClientDriver";
string connectionString = @"Data Source=pgolractest.seat.it; User Id=XXX; Password=XXX; Persist Security Info=true; Pooling=false";
string confAssembly = "Seat.CreditScoring.Entities, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b63b839fda4bc3d8";

NHibernate.Cfg.Configuration cfg = new NHibernate.Cfg.Configuration();
cfg.SetProperty(NHibernate.Cfg.Environment.ConnectionProvider, connectionProvider);
cfg.SetProperty(NHibernate.Cfg.Environment.Dialect, dialect);
cfg.SetProperty(NHibernate.Cfg.Environment.ConnectionDriver, connectionDriver);

cfg.SetProperty(NHibernate.Cfg.Environment.ConnectionString, connectionString);
Assembly entitiesAssembly = Assembly.Load(confAssembly);
cfg.AddAssembly(entitiesAssembly);
InputDbAccessLayerImpl dbAccess = new InputDbAccessLayerImpl(cfg);
InputData input = new InputData();
input.Input = inputData;
input.StartDate = DateTime.Now;
input.StopDate = DateTime.Now;
input.State='I';
dbAccess.InsertInputData (input);
---End code---

This code simply add a entry in a Oracle db (table InputData). It properly works if I run it in a console application.
If I run it in a web method of a web service, it returns this error: cannot open connection ---> NHibernate.ADOException: cannot open connection ---> NHibernate.ADOException: Could not create connection from Driver ---> System.Exception: System.Data.OracleClient requires Oracle client software version 8.1.7 or greater.
However I use the same driver with the same Oracle client version (9.2) from the same machine! If I use the same code changing the driver to SQL Server 2000, the web service works.
I can't understand why it does not work and I ask for your help.

Thanks,
Gionni


Top
 Profile  
 
 Post subject: Re: Oracle does not work in a web service
PostPosted: Wed Sep 13, 2006 8:56 am 
Expert
Expert

Joined: Thu Jan 19, 2006 4:29 pm
Posts: 348
Gionni wrote:
This code simply add a entry in a Oracle db (table InputData). It properly works if I run it in a console application.
If I run it in a web method of a web service, it returns this error: cannot open connection ---> NHibernate.ADOException: cannot open connection ---> NHibernate.ADOException: Could not create connection from Driver ---> System.Exception: System.Data.OracleClient requires Oracle client software version 8.1.7 or greater.
However I use the same driver with the same Oracle client version (9.2) from the same machine! If I use the same code changing the driver to SQL Server 2000, the web service works.
I can't understand why it does not work and I ask for your help.


We have had similar problems due to invalid access rights on Oracle installation folder. Granting "Full access" to everyne, and specifyng "replace on child entitys" in advanced page has cured the problem, thought it might not be suitable in Your enviroment. (So You might want to figure out the minimum rights needed to grant for aspnet user)

Gert

_________________
If a reply helps You, rate it!


Top
 Profile  
 
 Post subject: Re: Oracle does not work in a web service
PostPosted: Thu Sep 14, 2006 11:54 am 
Newbie

Joined: Wed Sep 13, 2006 6:41 am
Posts: 3
Quote:
Granting "Full access" to everyne, and specifyng "replace on child entitys" in advanced page has cured the problem, thought it might not be suitable in Your enviroment. (So You might want to figure out the minimum rights needed to grant for aspnet user)


Thanks a lot for your response. I was beating my head against the wall and you saved my life.

Thanks, Gionni


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