[Mono-devel-list] Npgsql possible bug

Francisco Figueiredo Jr. fxjrlists at yahoo.com.br
Sun Dec 28 09:20:23 EST 2003


yoros at wanadoo.es wrote:
> On Sat, Dec 27, 2003 at 09:09:35PM -0300, Francisco Figueiredo Jr. wrote:
> 

>>I also think the connection shouldn't be disposing the connection. As, Jaroslaw
>>said, you could use the connection with other commands.
>>
>>Unfortunately I'm not using my development machine right now, and so, I can't
>>check it better, but I think we may be missing something in the
>>NpgsqlDataAdapter to close the connection when using commands, maybe specifing
>>the CloseConnection behavior as Jaroslaw said.
>>
> 
> 
> Be careful with that because it's possible to create a new
> NpgsqlDataAdapter with a connection in the constructor... this let us to
> construct a DataAdapter with a shared connection and that connection
> shouldn't be closed by the DataAdapter. I think that NpgsqlDataAdapter
> should close only the connection it created.

Ooooops, I think I did s little confusion here: where I said connection, 
I should have said command :) Sorry for this mistake.
Pedro, you are completely right. The DataAdapter shouldn't be closing 
the connection, only the ones it creates.


> 
> In the other hand, researching MS.NET behaviour I noticed that it opens
> and closes the physical connection for each "DataSet.Update()" call. I
> think that's the best way to handle unmanaged resources in managed world
> because we can't ensure the Finalizer/Dispose call by the client of our
> classes.
> 
> I'll be working in this as soon as I could...
> 

Great! Thanks for checking that.


Regards,

Francisco Figueiredo Jr.





More information about the Mono-devel-list mailing list