On Jun 14, 9:26 am, "Andrus Moor" <[email protected]> wrote:
> Currently dblinq seems to work in this way: new IDbConnection() reads
> connection from static thread-safe ado .net pool (if ado provider implements
> pooling).
> IDbConnection.Dispose() issued by connection creator (dblinq or user who
> passes connection) returns connection to pool.
>
> So I don'nt undrestand what to do?
>
At the moment there looks like each DbLinq DataContext will only ever
create a single IDbConnection (which represents the physical
connection to the database) object. The creation is done in
DatabaseContext.Connect. The single connection object is then passed
to other DbLinq classes to consume. In DatabaseConnection.Dispose the
connection is closed but not disposed of, it would be a problem if it
was disposed of since it is still reference and required by the other
consuming classes.
The correct way to use ADO.Net connection pooling is rather than
keeping a reference to a single connection object and passing it
around the is to create and open a new connection everytime and let
the ADO.Net provider connection pooling take care of reusing
connections. Once the connection is finished with it should be closed
and de-referenced or disposed of. It's something that looks easy to
fix in DbLinq which is good news.
Regards,
Aaron
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"DbLinq" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/dblinq?hl=en
-~----------~----~----~----~------~----~------~--~---