List Info

Thread: Single or Multiple Connections




Single or Multiple Connections
country flaguser name
United States
2007-02-19 01:24:13
I have to execute mutiple(4_5) stored procedures one after
the
another. What is the best way for executing them and why?
a) Opening the connection at the begining of the first
procedures and
closing it at the end of the last connection.
2) Opening and closing the connections for each and every
procedures.

Thanks in advance.

Hemant


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "DotNetDevelopment, VB.NET, C# .NET,
ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting"
group.
To post to this group, send email to DotNetDevelopmentgooglegroups.com
To unsubscribe from this group, send email to
DotNetDevelopment-unsubscribegooglegroups.com
For more options, visit this group at
http:
//cm.megasolutions.net/forums/default.aspx
-~----------~----~----~----~------~----~------~--~---


Re: Single or Multiple Connections
country flaguser name
United States
2007-02-19 12:34:06
I would go for the second option, Open and close the
connections for
each.
though if you need to absolutely execute all 5 in order
everytime...
why not make this a transaction? and use a single SP to
execute it ?

Regards,
Alexandre Brisebois

On Feb 19, 2:24 am, "Hemant" <hemantjpa...gmail.com> wrote:
> I have to execute mutiple(4_5) stored procedures one
after the
> another. What is the best way for executing them and
why?
> a) Opening the connection at the begining of the first
procedures and
> closing it at the end of the last connection.
> 2) Opening and closing the connections for each and
every procedures.
>
> Thanks in advance.
>
> Hemant


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "DotNetDevelopment, VB.NET, C# .NET,
ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting"
group.
To post to this group, send email to DotNetDevelopmentgooglegroups.com
To unsubscribe from this group, send email to
DotNetDevelopment-unsubscribegooglegroups.com
For more options, visit this group at
http:
//cm.megasolutions.net/forums/default.aspx
-~----------~----~----~----~------~----~------~--~---


Re: Single or Multiple Connections
user name
2007-02-19 16:02:59
First one is best, open on first and close on last procedure execute is the best way of doing it and its "by the book" option

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting&quot; group.
To post to this group, send email to DotNetDevelopmentgooglegroups.com
To unsubscribe from this group, send email to DotNetDevelopment-unsubscribegooglegroups.com
For more options, visit this group at
http://cm.megasolutions.net/forums/default.aspx
-~----------~----~----~----~------~----~------~--~---

Re: Single or Multiple Connections
country flaguser name
United States
2007-02-19 17:22:55
Hi,

I would like to add some more information.
I am going to do some processing after each of the SP's and
then call
the next one.
I also need to ensure the entire set is in a transaction.
Remeber my connections are pooled.
So please provide an answer now.

Thanks,
Hemant

On Feb 19, 4:02 pm, "ivan ivan" <verth...gmail.com> wrote:
> First one is best, open on first and close on last
procedure execute is the
> best way of doing it and its "by the book"
option


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "DotNetDevelopment, VB.NET, C# .NET,
ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting"
group.
To post to this group, send email to DotNetDevelopmentgooglegroups.com
To unsubscribe from this group, send email to
DotNetDevelopment-unsubscribegooglegroups.com
For more options, visit this group at
http:
//cm.megasolutions.net/forums/default.aspx
-~----------~----~----~----~------~----~------~--~---


Re: Single or Multiple Connections
user name
2007-02-20 01:27:15
Connections are expencive thus if you have some logic between execution that will take some time to execute then its better to open/close connection on each execution.

On 2/20/07, Hemant < hemantjpatelgmail.com">hemantjpatelgmail.com> wrote:

Hi,

I would like to add some more information.
I am going to do some processing after each of the SP's and then call
the next one.
I also need to ensure the entire set is in a transaction.
Remeber my connections are pooled.
So please provide an answer now.

Thanks,
Hemant

On Feb 19, 4:02 pm, "ivan ivan" < verth...gmail.com">verth...gmail.com> wrote:
>; First one is best, open on first and close on last procedure execute is the
> best way of doing it and its "by the book" option

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting&quot; group.
To post to this group, send email to DotNetDevelopmentgooglegroups.com
To unsubscribe from this group, send email to DotNetDevelopment-unsubscribegooglegroups.com
For more options, visit this group at
http://cm.megasolutions.net/forums/default.aspx
-~----------~----~----~----~------~----~------~--~---

Re: Single or Multiple Connections
country flaguser name
United States
2007-02-19 22:18:29
I would suggest go with first option, because creating
connection and
closing the connection every time is overload for Server and
if all
the stored procedures are of single transaction, best to go
with
single connection.

Hemant wrote:
> Hi,
>
> I would like to add some more information.
> I am going to do some processing after each of the SP's
and then call
> the next one.
> I also need to ensure the entire set is in a
transaction.
> Remeber my connections are pooled.
> So please provide an answer now.
>
> Thanks,
> Hemant
>
> On Feb 19, 4:02 pm, "ivan ivan"
<verth...gmail.com> wrote:
> > First one is best, open on first and close on last
procedure execute is the
> > best way of doing it and its "by the
book" option


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "DotNetDevelopment, VB.NET, C# .NET,
ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting"
group.
To post to this group, send email to DotNetDevelopmentgooglegroups.com
To unsubscribe from this group, send email to
DotNetDevelopment-unsubscribegooglegroups.com
For more options, visit this group at
http:
//cm.megasolutions.net/forums/default.aspx
-~----------~----~----~----~------~----~------~--~---


Re: Single or Multiple Connections
user name
2007-02-19 02:42:09
hai,

 ;use class file for executing stored procedures

using this u have only using single connection

for example
i have crated a class


sample.vb
-------------
i am using connection string from web.config file


Dim strconn As String = System.Configuration.ConfigurationManager.ConnectionStrings(";connectionstring name").ConnectionString


ok

Take care
bye


On 2/19/07, Hemant < hemantjpatelgmail.com">hemantjpatelgmail.com> wrote:

I have to execute mutiple(4_5) stored procedures one after the
another. What is the best way for executing them and why?
a) Opening the connection at the begining of the first procedures and
closing it at the end of the last connection.
2) Opening and closing the connections for each and every procedures.

Thanks in advance.

Hemant

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting&quot; group.
To post to this group, send email to DotNetDevelopmentgooglegroups.com
To unsubscribe from this group, send email to DotNetDevelopment-unsubscribegooglegroups.com
For more options, visit this group at
http://cm.megasolutions.net/forums/default.aspx
-~----------~----~----~----~------~----~------~--~---

Re: Single or Multiple Connections
user name
2007-02-23 02:46:01
I will prefer option first if there is some processing between the stored procedure.
As u said that there is connection pooling.
For connection Pooling it is must to frequently close connection.

 
On 2/19/07, RangaRaj S < rangaraj84gmail.com">rangaraj84gmail.com> wrote:
hai,

&nbsp;use class file for executing stored procedures

using this u have only using single connection

for example
i have crated a class


sample.vb
-------------
i am using connection string from web.config file


Dim strconn As String = System.Configuration.ConfigurationManager.ConnectionStrings (&quot;connectionstring name").ConnectionString


ok

Take care
bye



On 2/19/07, Hemant <gmail.com" target="_blank">hemantjpatelgmail.com > wrote:

I have to execute mutiple(4_5) stored procedures one after the
another. What is the best way for executing them and why?
a) Opening the connection at the begining of the first procedures and
closing it at the end of the last connection.
2) Opening and closing the connections for each and every procedures.

Thanks in advance.

Hemant

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting&quot; group.
To post to this group, send email to DotNetDevelopmentgooglegroups.com
To unsubscribe from this group, send email to DotNetDevelopment-unsubscribegooglegroups.com
For more options, visit this group at
http://cm.megasolutions.net/forums/default.aspx
-~----------~----~----~----~------~----~------~--~---

[1-8]

about | contact  Other archives ( Real Estate discussion Medical topics )