🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.delphi.database.bdp
3 messages
3 total messages Started by john Thu, 21 Dec 2006 19:39
reuse BdpConnection
#10
Author: john
Date: Thu, 21 Dec 2006 19:39
15 lines
1488 bytes
BDS 2006

since there seems to be some activity here I will try another question. Is 
anyone successfully reusing BdpConnection instances by just changing their 
connection string? What I mean is

conn.Close();
conn.ConnectionString = "database=adiffdb;username=adiff_user;"; //etc..
conn.Open();

With connection pooling on or off, this doesnt work for me. After 5 times of 
doing this the Open() call hangs. It would be nice if it did work, because 
as it is, you need to new a new connection object instance everytime. Then 
you have to manually write code to update every single BdpCommand in your 
app to use the new instance. 
Re: reuse BdpConnection
#11
Author: Dmitriy Nagirnyak
Date: Fri, 22 Dec 2006 01:39
28 lines
1875 bytes
Hello john,

> Is anyone successfully reusing BdpConnection instances by
> just changing their connection string? What I mean is
> 
> conn.Close();
> conn.ConnectionString = "database=adiffdb;username=adiff_user;";
> //etc..
> conn.Open();
> With connection pooling on or off, this doesnt work for me. After 5
> times of doing this the Open() call hangs. It would be nice if it did
> work, because as it is, you need to new a new connection object
> instance everytime. Then you have to manually write code to update
> every single BdpCommand in your app to use the new instance.
> 

I've never did this trick. What application type do you have (Win, Web) and 
what for do you need to keep BdpConnections for different connections?

BTW, if you're running against MSSQL I would suggest you verify your connection 
pooling is working using the SQL:

select hostname, status, count(*) as Connections
from master..sysprocesses
where spid > 50 and loginame = 'YouApplicationUsername'
group by hostname, status

Cheers.
Re: reuse BdpConnection
#12
Author: john
Date: Fri, 22 Dec 2006 16:30
29 lines
2054 bytes
"Dmitriy Nagirnyak" <nagir_at_argocomputing_com_au> wrote in message 
news:c0626a0585728c8f391fd020e14@newsgroups.borland.com...
> Hello john,
>
>> Is anyone successfully reusing BdpConnection instances by
>> just changing their connection string? What I mean is
>>
>> conn.Close();
>> conn.ConnectionString = "database=adiffdb;username=adiff_user;";
>> //etc..
>> conn.Open();
>> With connection pooling on or off, this doesnt work for me. After 5
>> times of doing this the Open() call hangs. It would be nice if it did
>> work, because as it is, you need to new a new connection object
>> instance everytime. Then you have to manually write code to update
>> every single BdpCommand in your app to use the new instance.
>>
>
> I've never did this trick. What application type do you have (Win, Web) 
> and what for do you need to keep BdpConnections for different connections?
>

Hi,

WinForms thick client. One place I run into it alot is in adding the ability 
to connect to different databases with different user names at runtime. I 
wonder if other ado.net providers can have their connection reused? I 
haven't tried others.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads