|
From: Alberto P. <alb...@ti...> - 2007-08-30 06:30:32
|
Ok.
I remove my Dispose method at the end of the function.
Then, why after 200 command execution a process memory it increase from
30 mb to 400 mb,
in few minuts?
It seems that the GC does not understand that comes however executed the
auto Dispose() command.=20
How never?=20
It's necessary to set up some flag?=20
Using others driver net it is for Oracle that for Sql Serveur this does
not happen.=20
Thanks
-----Messaggio originale-----
Da: Jiri Cincura [mailto:di...@ci...]=20
Inviato: mercoled=EC 29 agosto 2007 18.31
A: alb...@ti...; For users and developers of the Firebird .NET
providers
Oggetto: Re: [Firebird-net-provider] Invalid attempt of read when the
reader is closed.
On 8/29/07, alb...@ti... <alb...@ti...> wrote:
> Hi,
> using a version 2.1.0 RC-1 i have
> some problem with a Dispose
> method.
>
> Why throw this exception ?
> "Invalid attempt of read when
> the reader is closed."
>
> I create a FbCommand in this mode:
>
> private
> static object executeQuery(DbConnection p_conn, string p_sql,=20
> hashtable
> p_params)
> {
> DbCommand oc =3D null;
> object res =3D DBNull.Value;
>
> if (p_conn.getType().Equals(typeOf(FbConnection)) ){
> oc =3D
> new FbCommand(p_sql, (FbConnection)p_conn);
> ... assign params
> res =3D oc.ExecuteReader();
>
> }
> ...other
> database connection type, such as Oracle, Sql Server...
>
> oc.
> Dispose();
>
> return res;
> }
>
> I use the Dispose() method
> because I see the memory of the
> main process increase in exponential
> mode.
>
> Sorry for my bad english.
>
> Thanks.
>
> Alberto
>
When you dispose connection, the connection is also closed. So then,
you're not able to read domething from datareader.
--=20
Jiri {x2} Cincura (Microsoft Student Partner)
http://blog.vyvojar.cz/jirka/ | http://www.ID3renamer.com
--=20
No virus found in this incoming message.
Checked by AVG Free Edition.=20
Version: 7.5.484 / Virus Database: 269.12.10/976 - Release Date:
27/08/2007 18.20
|