Carlos -- you can modify the dispose on the FbCommand so that if a
datareader is active when the command is disposed, the command doesn't
actually dispose, but modifies some internal flag on the FbDataReader that
tells the FbDataReader that it now "owns" the command and should dispose the
command when the reader is disposed.
 

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] 
> On Behalf Of Carlos_Guzmán_Álvarez
> Sent: Tuesday, June 13, 2006 11:43 AM
> To: For users and developers of the Firebird .NET providers
> Subject: Re: [Firebird-net-provider] Problem on dispose 
> implementaionin fbcommand
> 
> Hello:
> > Hello,
> >
> > i found a little error in the dispose implementation.
> >  1 . why you close active reader when you dispose the fbcommand ?
> >
> >  because with the microsoft application block you can do it :
> >
> > Database db = Helper.GetDB();
> > using (DbCommand dbCommand = db.GetSqlStringCommand("SELECT * FROM 
> > TOTO"))
> > {
> >  return db.ExecuteReader(dbCommand);
> > }
> >
> > and after you can use the datareader.
> >   
> Because the DataReader needs the command to be not disposed 
> to be able 
> to fetch data. When disposing the command it will be released in the 
> Firebird Server as well, and the reader will be trying to use a non 
> valid command.
> 
> 
> -- 
> Carlos Guzmán Álvarez
> Vigo-Spain
> 
> http://carlosga.blogspot.com/
> 
> No hay un solo rey que no descienda de un esclavo, 
> ni un esclavo que no haya tenido reyes en su familia.
> 
> 
> 
> _______________________________________________
> Firebird-net-provider mailing list
> Firebird-net-provider@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/firebird-net-prov
ider=???
=0



_______________________________________________
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

Reply via email to