Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: 4031 - errors

Re: 4031 - errors

From: Niall Litchfield <niall.litchfield_at_gmail.com>
Date: Tue, 8 Jun 2004 09:59:58 +0100
Message-ID: <7765c89704060801598c1fbf9@mail.gmail.com>


In c#

using System;

using System.Data;
using Oracle.DataAccess.Client;
using Oracle.DataAccess.Types;

namespace Oranet4
{

	/// <summary>
	/// Summary description for Class1.
	/// </summary>
	class Class1
	{
		/// <summary>
		/// The main entry point for the application.
		/// </summary>
		[STAThread]
		static void Main(string[] args)
		{
			//
			// TODO: Add code to start application here
			//
			// assume we have a valid connection, etc...
			// create a basic connect string to connect to our standard database
			string connStr = "User Id=scott;Password=tiger;Data Source=oranet";
			OracleConnection conn = new OracleConnection(connStr);
			try
			{
				conn.Open();
				OracleCommand cmd = new OracleCommand();
				cmd.Connection=conn;
				cmd.CommandText="select * from emp";
				cmd.FetchSize = 10000;
			
				OracleDataReader rdr = cmd.ExecuteReader();

				while (rdr.Read())
				{
					Console.WriteLine(rdr.GetOracleString(1));
				}

				conn.Close();
				conn.Dispose();

			}
			catch (OracleException ex)
			{
				Console.WriteLine(ex.Message);
				conn.Dispose();
	
			}
	
		}
	}

}

Note I'm calling dispose on the Connection object at the end of my code, and in my exception handler. This just tells the .net garbage collector to clean up after me as I'm done with the connection object. Every object has a dispose method.

The code is written against the Oracle Data Provider but only the getOracleString method used to return the enames is not available in the ms provider - use getstring there.

HTH Niall Litchfield
Oracle DBA
http://www.niall.litchfield.dial.pipex.com

On Mon, 7 Jun 2004 16:22:29 -0400, Fedock, John (KAM.RHQ) <john.fedock_at_us.kline.com> wrote:
>
> Kathy,
>
> Can you comment on #2 listed below (the dispose parameter). Where is it set at?
>
> Thanks
>
> John
>
>
> -----Original Message-----
> From: Duret, Kathy [mailto:kduret_at_starkinvestments.com]
> Sent: Wednesday, June 02, 2004 5:04 PM
> To: 'oracle-l_at_freelists.org'
> Subject: RE: 4031 - errors
>
> OK - here are some things that contributed to my problems and woes:
>
> 1) we set cursor_space_for_time = false - had been set to true for some
> prepared statements we were running
> this also gave us a bonus where it fixed leaks from update across
> db_links and heterogeneous services (not my idea ok, I lost the fight
> reminder to self to get bigger boxing gloves)
>
> 2) .net - set the dispose parameter..... release alot of resources,
> especially with cursors, has to do with the garbage collection
> there is also another parameter to adjust so connections for connection
> pooling don't hang on forever
> Apparently microsoft sets it to infinity...haven't played with it yet.
>
> 3) The other choke, gasp, dba had alot of dbms_outputs in procedure,
> functions except that he moved into production instead of commenting them
> out.
> one procedure that called another function which called another
> function, had more than 20 of these things. And yes same person who is
> updating
> across the links.....
>
> 4) I still have to look into the shared_pool_reserve and letting go there.
> I didn't want to change too many things at once... Didn't want to
> cause other problems.
>
> I have some other issues to look into but this seems to have helped 80% of
> my problems. The other 20% well, let's just say I am encouraging him to
> find another position.......
>
> Thanks to everyone for the help.
>
> Kathy
>
> This transmission contains information solely for intended recipient and may
> be privileged, confidential and/or otherwise protect from disclosure. If
> you are not the intended recipient, please contact the sender and delete all
> copies of this transmission. This message and/or the materials contained
> herein are not an offer to sell, or a solicitation of an offer to buy, any
> securities or other instruments. The information has been obtained or
> derived from sources believed by us to be reliable, but we do not represent
> that it is accurate or complete. Any opinions or estimates contained in
> this information constitute our judgment as of this date and are subject to
> change without notice. Any information you share with us will be used in
> the operation of our business, and we do not request and do not want any
> material, nonpublic information. Absent an express prior written agreement,
> we are not agreeing to treat any information confidentially and will use any
> and all information and reserve the right to publish or disclose any
> information you share with us.
> ----------------------------------------------------------------
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> ----------------------------------------------------------------
> To unsubscribe send email to: oracle-l-request_at_freelists.org
> put 'unsubscribe' in the subject line.
> --
> Archives are at http://www.freelists.org/archives/oracle-l/
> FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
> -----------------------------------------------------------------
> ----------------------------------------------------------------
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> ----------------------------------------------------------------
> To unsubscribe send email to: oracle-l-request_at_freelists.org
> put 'unsubscribe' in the subject line.
> --
> Archives are at http://www.freelists.org/archives/oracle-l/
> FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
> -----------------------------------------------------------------
>



Please see the official ORACLE-L FAQ: http://www.orafaq.com

To unsubscribe send email to: oracle-l-request_at_freelists.org put 'unsubscribe' in the subject line.
--
Archives are at http://www.freelists.org/archives/oracle-l/
FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------
Received on Tue Jun 08 2004 - 03:57:17 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US