web.config having multilple connection string name with same connection.

Issue 1:  

<add name="Conn1" connectionString="Data Source= SID;User Id=UN;Password=Pwd" providerName="Oracle.DataAccess.Client"/>

 And use Conn1(Read and Write from DB)  All over the application. (for exam: all Data Access Layer).

Versus

Issue 2:

<add name="Conn1" connectionString="Data Source= SID;User Id=UN;Password=Pwd" providerName="Oracle.DataAccess.Client"/>

<add name="Conn2" connectionString="Data Source= SID ;User Id=UN;Password=Pwd" providerName="Oracle.DataAccess.Client" />

And use Conn1(read from DB) and Conn2(write to DB) All over the application(for exam: all Data Access Layer).

Note: Conn1 and Conn2 has same SID,UserName and Password.

My Question is Does is make sense that Issue2 will be more faster than Issue1 in performance of website. or is there any other way having Issue2 can be proved to helpful( like looking at session of database and can see info about that connection pool ????

Please discuss.


work smarter, Not Harder.

Bhavesh Patel
0
BhaveshPatel
1/30/2008 9:42:12 PM
asp.net.oracle 2269 articles. 0 followers. Follow

8 Replies
1264 Views

Similar Articles

[PageSpeed] 38

I see no reason for Issue2 to be faster than Issue1.  In fact, I could see that it would be slower since you have more ConnectionStrings to deal with (though if this was an issue, it would be infinitesimal).

All you are doing is reading the ConnectionString from the web.config.  If nothing else is different, I do not see that this would make any difference at all.


Christopher Reed
"The oxen are slow, but the earth is patient."
0
Careed
1/30/2008 10:05:08 PM

BhaveshPatel:

Issue 1:  

<add name="Conn1" connectionString="Data Source= SID;User Id=UN;Password=Pwd" providerName="Oracle.DataAccess.Client"/>

 And use Conn1(Read and Write from DB)  All over the application. (for exam: all Data Access Layer).

Versus

Issue 2: <add name="Conn1" connectionString="Data Source= SID;User Id=UN;Password=Pwd" providerName="Oracle.DataAccess.Client"/>

<add name="Conn2" connectionString="Data Source= SID ;User Id=UN;Password=Pwd" providerName="Oracle.DataAccess.Client" />

And use Conn1(read from DB) and Conn2(write to DB) All over the application(for exam: all Data Access Layer).

Note: Conn1 and Conn2 has same SID,UserName and Password.

My Question is Does is make sense that Issue2 will be more faster than Issue1 in performance of website. or is there any other way having Issue2 can be proved to helpful( like looking at session of database and can see info about that connection pool ????

Please discuss.

Issue1 would be faster than Issue2 as Issue1 will fetch the connection from the same connection pool whereas for Issue2, two different connection pools would be created.

-----------------------------------------------------------------

Please click Mark as Answer if this helped in solving your problem.


-----------------------------------------------
Please click Mark as Answer if this helped.
0
aparnagarg
1/31/2008 9:43:37 AM

I must disagree.  These are the same ConnectionStrings regardless of how they are named in the web.config.  Thus, they would have the same connection pool since the connection strings themselves are the same.

A connection pool is created with each unique connection string.  You are using only one connection string, thus you will only have one connection pool.  The web.config conventions are all semantics, not distinct connection strings.

 


Christopher Reed
"The oxen are slow, but the earth is patient."
0
Careed
1/31/2008 1:01:36 PM

Careed:

I must disagree.  These are the same ConnectionStrings regardless of how they are named in the web.config.  Thus, they would have the same connection pool since the connection strings themselves are the same.

A connection pool is created with each unique connection string.  You are using only one connection string, thus you will only have one connection pool.  The web.config conventions are all semantics, not distinct connection strings.

 

 

Hi Christopher,

My understanding of Connection Pooling says that the a connection pool depends on the connection object's parameters. In this case, the first case and the second case mentioned have the same parameter's but they differ in name, which is also a parameter. So, isn't two different connection objects are getting created this way, both having a different connection pool of it's own.


-----------------------------------------------
Please click Mark as Answer if this helped.
0
aparnagarg
1/31/2008 2:20:42 PM
The connection pool is only based on the connection string, not on the short-cut method that ASP.NET provides to use the web.config to store the connection string.  The connection string is the actual string used to defined the connection to the database.  In this case, the two strings conn1 and conn2 are exact, thus, they will generate one connection pool.  The issue is how ADO.NET handles the connection pooling, not how the ConnectionStrings element in the web.config is set up.  In other words, do not confuse the ConnectionStrings element with the actual connection string used in the connection process.  It is at the time of the connection that the connection pooling is determined.  At that point in time, the way the connection string will entered into your programming is immaterial.

Christopher Reed
"The oxen are slow, but the earth is patient."
0
Careed
2/1/2008 4:10:19 AM

Thanks guys!!! It was a good to know about connectionSrtings and Actual connection string used in the connection process.

do you have any article or and link which gives more detail on above statement? I will appreciate it.


work smarter, Not Harder.

Bhavesh Patel
0
BhaveshPatel
2/1/2008 4:34:33 AM

BhaveshPatel:

Thanks guys!!! It was a good to know about connectionSrtings and Actual connection string used in the connection process.

do you have any article or and link which gives more detail on above statement? I will appreciate it.

Visit http://www.15seconds.com/issue/040830.htm

It provides a good examples and explanation on ADO.NET Connection objects and Connection pooling.

Aparna.

----------------------------------------------------------------------

Please click Mark as Answer if this helped in solving your problem.


-----------------------------------------------
Please click Mark as Answer if this helped.
0
aparnagarg
2/1/2008 7:37:35 AM
Look here from MSDN: OleDb, Odbc and Oracle Connection Pooling (ADO.NET)
Christopher Reed
"The oxen are slow, but the earth is patient."
0
Careed
2/1/2008 1:00:15 PM
Reply:

Similar Artilces:

Get connection string from web.config and secure that connection
Hi, I store my connection string on my web.config file, and I want to create a new connection on c# like:SqlConnection con = new SqlConnection();con.ConnectionString= //connection string on web.config fileAfter that, The connection string on the web.config file is in clear text and I want to make it secure but easy to work because this job is to deliver until friday. Is there any easy way to do this and keep the possibility of creating a new connection and making reference to this connection string without need for decrypt data?Thanks, please help!Best regards,David Ribeiro After reading t...

Why we use Web.Config File for connection string wether we can use class Library for get connection for whole web Application
 Why we use Web.Config File for connection string wether we can use class Library for get connection for whole web Application  please help me? Friend, Web.config has its own advantages. 1) Web.Config is used to store the important information like connections strings etc...so that it can be modified even after the code has been    deployed to the server without compiling the entire application again. 2) Since it is a XML file, there is no need of building the project of you are going to change the connection strings.   If you go for the class files,...

OLEDB Connection problem using Connect String from Web.config
Hi,Cananybody tell me why I am getting the following error for the following code below An OLE DB Provider was not specified in the ConnectionString.  An example would be, 'Provider=SQLOLEDB;'. "Ppp" is a connection defined in Web.config which works with SqlDatasource in the application. DataSet RunQuery(String QueryString) { String ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["Ppp"].ConnectionString; OleDbConnection DBConnection = new OleDbConnection( ConnectionString); OleDbDataAdapter DBAdapter; DataSet ResultsDataSet = new DataSet(); M....

Connect a DataSet to a database with a connection string defined outside of web.config
I believe this to be a fairly small issue in a fairly complex scenario; I'll do my best to explain. We have 2 solutions, and one is built using the other as a foundation.  In other words, one solution has all the functionality of the other, and then some other things added on.These 2 solutions need to connect to different databasesMany of the projects in the solutions, as well as the web.config file are "branched" between the two solutions.  Meaning that editing the web.config file in one solution will effect it in the other.To allow each solution to connect to a...

How to access connection to sqldatasource from code behind if the connect string is declared in web.config
Hi,  I have given my connection strings to database in web.config. How can I use these while writing the code in code behind page using sqldatasource. It would be great if I can get an sample. ConfigurationManager.ConnectionStrings["yourConnectionStringName"].ConnectionString you can use your SqlDataSource.ConnectionString property in the code behind to wire it up.Good Luck and happy programming!Let's build community! If my post helped you, mark it as the Answer and I will do the same when you help me...this will help everybody!...

Updating Web.Config( ^SqlConnectionString^ was not found in web.config. Connection String was not updated).
hi ppl i installed the forum and when it was fininshed im not getting the fierst screen. when i wrote it myself on the explorer http://localhost/Forums it gave an error like this:::::::::::::::    Login failed for user 'amit'. Reason: Not associated with a trusted SQL Server connection Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlClient.SqlException: Login failed for user 'amit'. Reason:...

How do I use my web.config connection string in my DataAdapter/Connection that I created with drag/drop and data binding
This is a little hard to put into words... I have a form with a number of textbox fields on it that are bound to a data adapter. The data adapter and it's sql connection were created by dragging the objects onto the screen from the toolbox (not in code). I open connections in other places and use my connection string in web.config for those. The on-screen sql connection object doesn't seem to allow me to just fill in the function that pulls my conn string from web.config so in page.load, I set it's connection string to my connection string. Does the page load fire before the connect...

web.config/ADO.NET command/connection string problem?
Ok, I have searched everywhere and not been able to find an answer yet so I hope someone can help me. I have an application that uses a key in the web.config file to reference a connection string to SQL Server 2000. In the development environment, this works as expected. However, when I edit the web.config file to reference a new database (initial catalog) it doesn't seem to register for some of the command objects (based on stored procs). I will receive an error that the user could not log on to database X, even though the connection should now be referencing database Y. This only happens w...

web.config, app.config Connection strings
Hi all,   My difficulty is the configuration of the following Connection String.    <connectionStrings>        <add name="RMS_DAL.My.MySettings.RMSConnectionString" connectionString="Data Source=DEV01;Initial Catalog=RMS;Integrated Security=True"            providerName="System.Data.SqlClient" />    </connectionStrings>    In visual Studio  I have a 3 tier "Solution" like this  &nb...

Connect to DB connection in web.config
Hi All, I have a simple question (i think it is anyway) :-) In my web.config file I have a connectionstring: <connectionStrings>    <add name="General" connectionString="Data Source=000.000.000.000;Initial Catalog=demifire;User Id=*****;Password=****;" providerName="System.Data.SqlClient"/> </connectionStrings> My question is how do I reference this file from a codebehind page? At the top of the codebehind:Imports System.Data.SqlClientImports System.ConfigurationImports System.Web.Configuration Dim con As SqlConnection     ...

Putting this connection into a config connection string
Hi I have as so many others before me built the perfect site that runs 100% locally but when it is uploaded to the server and you try to connect to your online DB it falls over. I know i need to change the connection string, but i have tried nearly every configuration possible and still have no access. I eventually asked my hosting company and they sent me the following script:   string myConnectionString = "Database=<***>; Data Source=mysql16.easycgi.com;User Id=<***>;Password=<***>"; MySqlConnection myConnection = new MySqlConnection(myConnectionStr...

app.config connection string not being read
I have a Web app that has a UI Website Project and a DB dataset/db project. I am running SQL Server 2005 Express on my localhost for development purposes. I have the connectionstring for the DB in the DB projects app.config. The site is running perfectly on my localhost, but when I deploy the site to the review server and change the app.config's connectionstring accordingly a connection to the DB cannot be established. I then tried changing all the db names, usernames, password to jibberish in my app.config file on my localhost and running AND THE SITE STILL RAN ON LOCALHOST. For so...

The connection name 'name' was not found in the applications configuration or the connection string is empty
    I have been trying to host my website on Go Daddy for about 3 weeks and I have cleared several problems but this one remains. I can get into the ASPNETDB database for doing logins , etc because login works and I can add new users. The data also shows up in the ASPNETDB files. Anytime a form tries to access  my database called "PINEmgt", it crashes. To try to understand where the problem is located,I built a very simple application without login controls and put in it one Detailform accessing a single line table "Signin". I c...

seriously confused about connections strings, app.config, web.config ...
I have a web application that comprises the following: A web project (with a web.config file containing a connection string - but no data access code in the web project) A data access project that uses LINQ-SQL classes to provide entities to the web project UI (this project has a settings file and an app.config - both of which have connection strings) When I build and deploy, there is no settings file or app.config in the Bin directory with the data access .dll, but changing the connection string in the web.config file doesn't change the database accordingly - so ...

Web resources about - web.config having multilple connection string name with same connection. - asp.net.oracle

Connection - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

iMedia Connection: Interactive Marketing News, Features, Podcasts and Video - iMediaConnection.com
High-quality data, if not used properly, can still lead marketers to make bad decisions. Consider these common ways that numbers are used to ...

HTTP persistent connection - Wikipedia, the free encyclopedia
... tacked on to an existing protocol. If the browser supports keep-alive, it adds an additional header to the request: Following this, the connection ...

CareerSonar Turns Facebook Friends Into Job Connections
Looking for a job ? Among your Facebook friends lies the potential for employment. CareerSonar , a new service, brings together a person’s connections ...

Man Charged With Aggravated Arson In Connection To Columbus Warehouse Fire
Police have charged 30-year-old Robin Toms with aggravated arson.

Adam Savage from 'MythBusters' has an incredible connection to the 'Star Wars' franchise
Adam Savage, co-host of the popular " MythBusters " television show, soured on the plot of "Interstellar." But when it comes to the newest films ...

Heavyset woman with facial hair arrested in connection to downto - CBS News 8 - San Diego, CA News Station ...
Police were on the lookout Thursday for a heavyset woman with facial hair who stabbed a man in the East Village.

Arrest made in connection with California mosque fire
CNN Arrest made in connection with California mosque fire CNN (CNN) A California man was arrested Saturday in connection with a fire at a ...

UK Police Make Arrest in Connection With VTech Hacking
British law enforcement officials arrest a 21-year-old man in connection with attack on toy maker VTech that exposed 6 million parents and children ...

"News Feed" For Slower Connections: Facebook's Strategy To Build A Stronger User Base
The changes in News Feed will more efficiently show relevant stories in a slow connection and let users compose comments when they are offline. ...

Resources last updated: 12/30/2015 10:06:26 PM