On Sun, 21 May 2006 20:22:23 +0200, "Arsalan Ahmad"
<arsal__@hotmail.com> wrote:
[color=blue]
>Hi,
>
>I am using MySQL .NET Connector and I am afraid that it does not support
>connection pooling and that is why I think that opening a new connection by
>each control in a page request will make it quite slow.
>
>Regards,
>
>Arsalan
>
>"Damien" <Damien_The_Unbeliever@hotmail.com> wrote in message
>news:1148199924.229929.308770@38g2000cwa.googlegr oups.com...[color=green]
>> Arsalan Ahmad wrote:[color=darkred]
>>> Hi all,
>>>
>>> I am creating a website in which in an Item detail page there are a
>>> number
>>> of web controls (7 or 8) and what is happening that inside each of
>>> control's
>>> Page_Load() function I am creating a database object to query data from
>>> database (using MySQL database). So it means that for each page request I
>>> am
>>> using 7 or 8 database connection which is something quite bad as far as
>>> performance is concerned. So please tell me how can change my design to
>>> use
>>> only one database connection object per page request? Important thing is
>>> I
>>> need to close database connection also once page request is fulfil and if
>>> I
>>> dont close database connection then database connection is still there
>>> for a
>>> very long time and it could cause bottleneck at my database server for
>>> more
>>> new connections.
>>>
>>> Thanks,
>>>
>>> Arsalan[/color]
>>
>> Which data provider are you using? The OleDbConnection and
>> OdbcConnection classes both support connection pooling, so if you're
>> using either of them, it shouldn't be an issue to follow the "open a
>> connection, do a command, close the connection" model. It looks like
>> you'll use a lot of connections, but behind the scenes the connection
>> pool will manage it for you.
>>
>> Damien
>>[/color]
>[/color]
My understanding is that if you put connectionpooling in your connect
string to mysql, independent of the driver in .net, you will get
connection pooling to the database. Let me know if this is wrong, but
I don't think so.
Peter Kellner
http://peterkellner.net