473,397 Members | 1,974 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

System.Data.OracleClient Problem: Could not create an environment: OCIEnvCreate returned -1

ben
Below is the error message I am receiving on a production server with the
Oracle 9.2 client installed. However, on a Oracle 9.0 client installation on
the development server the problem does not occur.

System.Exception: Could not create an environment: OCIEnvCreate returned -1.

This occurs when trying to connect.

using System.Data.OracleClient
this.connection = new OracleConnection("Data Source=" +
ConfigurationSettings.AppSettings["db_orac"] + ";User ID=" +
ConfigurationSettings.AppSettings["db_user"] + ";Password=" +
ConfigurationSettings.AppSettings["db_pass"] + ";");
this.connection.Open();

this.command = new OracleCommand();
this.command.Connection = this.connection;

ds = new DataSet();

command.Parameters.Clear();
command.CommandText = "MyTableSpace.MyPackage.get_list";
command.CommandType = CommandType.StoredProcedure;
command.Parameters.Add(new OracleParameter("io_cursor",
OracleType.Cursor)).Direction = ParameterDirection.Output;

this.da = new OracleDataAdapter(this.command);
this.da.Fill(ds,"List");

this.connection.Close();

I am desperately trying to find a solution. Any help would be much
appreciated!!

Regards,

Ben
Nov 18 '05 #1
4 1624
Ben:

This might be a permissions problem as the asp.net worker process needs
access to the Oracle directory. Try granting it read access and see if that
helps.

"ben" <be********@yahoo.com> wrote in message
news:ed**************@TK2MSFTNGP09.phx.gbl...
Below is the error message I am receiving on a production server with the
Oracle 9.2 client installed. However, on a Oracle 9.0 client installation on the development server the problem does not occur.

System.Exception: Could not create an environment: OCIEnvCreate returned -1.
This occurs when trying to connect.

using System.Data.OracleClient
this.connection = new OracleConnection("Data Source=" +
ConfigurationSettings.AppSettings["db_orac"] + ";User ID=" +
ConfigurationSettings.AppSettings["db_user"] + ";Password=" +
ConfigurationSettings.AppSettings["db_pass"] + ";");
this.connection.Open();

this.command = new OracleCommand();
this.command.Connection = this.connection;

ds = new DataSet();

command.Parameters.Clear();
command.CommandText = "MyTableSpace.MyPackage.get_list";
command.CommandType = CommandType.StoredProcedure;
command.Parameters.Add(new OracleParameter("io_cursor",
OracleType.Cursor)).Direction = ParameterDirection.Output;

this.da = new OracleDataAdapter(this.command);
this.da.Fill(ds,"List");

this.connection.Close();

I am desperately trying to find a solution. Any help would be much
appreciated!!

Regards,

Ben

Nov 18 '05 #2
Hi ben,

I think Elliot is right - just give aspnet process enough privileges to
oracle's bin directory (and directories below).
Or run aspnet app under another account:
Just put a line into
web.config file somewhere under
<system.web> node:

<identity impersonate="true" userName="USER" password="PASSWORD"/>
--
Miha Markic - RightHand .NET consulting & development
miha at rthand com

"ben" <be********@yahoo.com> wrote in message
news:ed**************@TK2MSFTNGP09.phx.gbl...
Below is the error message I am receiving on a production server with the
Oracle 9.2 client installed. However, on a Oracle 9.0 client installation on the development server the problem does not occur.

System.Exception: Could not create an environment: OCIEnvCreate returned -1.
This occurs when trying to connect.

using System.Data.OracleClient
this.connection = new OracleConnection("Data Source=" +
ConfigurationSettings.AppSettings["db_orac"] + ";User ID=" +
ConfigurationSettings.AppSettings["db_user"] + ";Password=" +
ConfigurationSettings.AppSettings["db_pass"] + ";");
this.connection.Open();

this.command = new OracleCommand();
this.command.Connection = this.connection;

ds = new DataSet();

command.Parameters.Clear();
command.CommandText = "MyTableSpace.MyPackage.get_list";
command.CommandType = CommandType.StoredProcedure;
command.Parameters.Add(new OracleParameter("io_cursor",
OracleType.Cursor)).Direction = ParameterDirection.Output;

this.da = new OracleDataAdapter(this.command);
this.da.Fill(ds,"List");

this.connection.Close();

I am desperately trying to find a solution. Any help would be much
appreciated!!

Regards,

Ben

Nov 18 '05 #3
Ben,

I'm having the same problem. However, it only happens for ASP.Net.

I often will do much of my testing of routines and data access from a fat
client before moving the code to the ASP.Net side. I spent much of my time
yesterday developing the code in my test app, when I moved it to ASP.Net the
problem occurred.

"ben" <be********@yahoo.com> wrote in message
news:ed**************@TK2MSFTNGP09.phx.gbl...
Below is the error message I am receiving on a production server with the
Oracle 9.2 client installed. However, on a Oracle 9.0 client installation on the development server the problem does not occur.

System.Exception: Could not create an environment: OCIEnvCreate returned -1.
This occurs when trying to connect.

using System.Data.OracleClient
this.connection = new OracleConnection("Data Source=" +
ConfigurationSettings.AppSettings["db_orac"] + ";User ID=" +
ConfigurationSettings.AppSettings["db_user"] + ";Password=" +
ConfigurationSettings.AppSettings["db_pass"] + ";");
this.connection.Open();

this.command = new OracleCommand();
this.command.Connection = this.connection;

ds = new DataSet();

command.Parameters.Clear();
command.CommandText = "MyTableSpace.MyPackage.get_list";
command.CommandType = CommandType.StoredProcedure;
command.Parameters.Add(new OracleParameter("io_cursor",
OracleType.Cursor)).Direction = ParameterDirection.Output;

this.da = new OracleDataAdapter(this.command);
this.da.Fill(ds,"List");

this.connection.Close();

I am desperately trying to find a solution. Any help would be much
appreciated!!

Regards,

Ben

Nov 18 '05 #4
Miha,
Thanks for the timely advice..
Adding the identity impersonate tag to the web.config file did the trick...

Richard
"Miha Markic" <miha at rthand com> wrote in message
news:e3**************@TK2MSFTNGP09.phx.gbl...
Hi ben,

I think Elliot is right - just give aspnet process enough privileges to
oracle's bin directory (and directories below).
Or run aspnet app under another account:
Just put a line into
web.config file somewhere under
<system.web> node:

<identity impersonate="true" userName="USER" password="PASSWORD"/>
--
Miha Markic - RightHand .NET consulting & development
miha at rthand com

"ben" <be********@yahoo.com> wrote in message
news:ed**************@TK2MSFTNGP09.phx.gbl...
Below is the error message I am receiving on a production server with the Oracle 9.2 client installed. However, on a Oracle 9.0 client
installation on
the development server the problem does not occur.

System.Exception: Could not create an environment: OCIEnvCreate

returned -1.

This occurs when trying to connect.

using System.Data.OracleClient
this.connection = new OracleConnection("Data Source=" +
ConfigurationSettings.AppSettings["db_orac"] + ";User ID=" +
ConfigurationSettings.AppSettings["db_user"] + ";Password=" +
ConfigurationSettings.AppSettings["db_pass"] + ";");
this.connection.Open();

this.command = new OracleCommand();
this.command.Connection = this.connection;

ds = new DataSet();

command.Parameters.Clear();
command.CommandText = "MyTableSpace.MyPackage.get_list";
command.CommandType = CommandType.StoredProcedure;
command.Parameters.Add(new OracleParameter("io_cursor",
OracleType.Cursor)).Direction = ParameterDirection.Output;

this.da = new OracleDataAdapter(this.command);
this.da.Fill(ds,"List");

this.connection.Close();

I am desperately trying to find a solution. Any help would be much
appreciated!!

Regards,

Ben


Nov 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Penn Markham | last post by:
Hello all, I am writing a script where I need to use the system() function to call htpasswd. I can do this just fine on the command line...works great (see attached file, test.php). When my...
1
by: Kevin Vogt | last post by:
When initially loaded, my web application (below) takes ~120000 milliseconds to open its connection. But repeated executions take 0 milliseconds each. But when I wait for approx. 5 minutes and try...
4
by: ben | last post by:
Below is the error message I am receiving on a production server with the Oracle 9.2 client installed. However, on a Oracle 9.0 client installation on the development server the problem does not...
2
by: JJ | last post by:
Hi, I don't know if this is the correct newsgroup to post this question, but here goes. I have installed Visual Studio .Net Professional 2003. I checked the version and it is 7.1.3088. It...
7
by: JS | last post by:
Can somebody explain how to get the tablespace out of quiesce mode? I am executing on each node of my EEE Win2K system: db2 quiesece tablespace for table schema.tablename RESET I get the...
0
by: Andy Fish | last post by:
Hi, I have an asp.net/ado.net application that I have just ported to work with Oracle, using microsoft's own System.Data.OracleClient. I am having great difficulty working out what configuration...
7
by: Mark Rae | last post by:
Hi, Has anyone successfully used the FTP stuff in the System.Net namespace against a VMS FTP server? I'm trying to do this at the moment and can't even get a directory listing, although there...
4
by: vbcsdotnet | last post by:
hello I run an sql which returns a datarow itemarray field of system.datetime. the problem is the database only stores the date, but the returned value includes a time of 12:00:00 AM. I do not...
3
by: sriram347 | last post by:
Hi I am a newbie to ASP.NET. I developed a web page (project type is web application) and I keep getting this error. B]Error message : "System.AccessViolation Exception attempted to read or...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.