F
fniles
In the Windows application (using VB.NET 2005) I use connection pooling like
the following:
In the main form load I open a connection using a connection string that I
stored in a global variable g_sConnectionString and leave this connection
open and not close it until it exits the application.
Then on each thread/each subsequent sub that needs the connection I create a
local OleDBConnection variable, open the connection using the exact same
connection string as the main form (stored
in global variable g_sConnectionString), and close it after populating a
DataSet.
Then, in the FormClosing event of the main form I close the database
connection.
In an ASPX application the user can close the browser at any page. Do I do
the connection pooling the same way in ASPX where I open the connection at
the Startup Page, leave that connection open, and at subsequent pages I open
connection (using the exact same connection string as the Startup Page) and
close the connection, then at the Startup Page Unload event close the 1st
connection ?
Since user can close the browser at any page, where is the best place to
close the 1st database connection (the one opened in the Startup Page) ?
Thank you.
the following:
In the main form load I open a connection using a connection string that I
stored in a global variable g_sConnectionString and leave this connection
open and not close it until it exits the application.
Then on each thread/each subsequent sub that needs the connection I create a
local OleDBConnection variable, open the connection using the exact same
connection string as the main form (stored
in global variable g_sConnectionString), and close it after populating a
DataSet.
Then, in the FormClosing event of the main form I close the database
connection.
In an ASPX application the user can close the browser at any page. Do I do
the connection pooling the same way in ASPX where I open the connection at
the Startup Page, leave that connection open, and at subsequent pages I open
connection (using the exact same connection string as the Startup Page) and
close the connection, then at the Startup Page Unload event close the 1st
connection ?
Since user can close the browser at any page, where is the best place to
close the 1st database connection (the one opened in the Startup Page) ?
Thank you.