Re: Connection pooling question
Fniles,
Why not buy the book from Bill, it does not help you much in a high
theoretical question without answer.
However for those practical questions that you have now it is very good.
(I had it on my desk Bill, however my collegues took it away)
Cor
"fniles" <fniles@pfmail. comschreef in bericht
news:e$oWnVcgHH A.596@TK2MSFTNG P05.phx.gbl...
Fniles,
Why not buy the book from Bill, it does not help you much in a high
theoretical question without answer.
However for those practical questions that you have now it is very good.
(I had it on my desk Bill, however my collegues took it away)
Cor
"fniles" <fniles@pfmail. comschreef in bericht
news:e$oWnVcgHH A.596@TK2MSFTNG P05.phx.gbl...
Also, 1 more question.
The way I do connection pooling is the following:
In the main form load I open a connection using a connection string that I
stored in a global variable g_sConnectionSt ring and leave this connection
open and not close it until it exits the application.
Then on each thread I create a local OleDBConnection variable, open the
connection using the exact same connection string as the main form (stored
in global variable g_sConnectionSt ring), and close it after populating a
DataSet.
Is this correct ?
>
Thank you.
>
"William (Bill) Vaughn" <billva@NoSpamA tAll_betav.comw rote in message
news:ulZ4z6UgHH A.1388@TK2MSFTN GP05.phx.gbl...
>
>
The way I do connection pooling is the following:
In the main form load I open a connection using a connection string that I
stored in a global variable g_sConnectionSt ring and leave this connection
open and not close it until it exits the application.
Then on each thread I create a local OleDBConnection variable, open the
connection using the exact same connection string as the main form (stored
in global variable g_sConnectionSt ring), and close it after populating a
DataSet.
Is this correct ?
>
Thank you.
>
"William (Bill) Vaughn" <billva@NoSpamA tAll_betav.comw rote in message
news:ulZ4z6UgHH A.1388@TK2MSFTN GP05.phx.gbl...
>CP::Connecti on Pool
>The differences between JET and SQL Server are ... well, dramatic. They
>are designed very differently. JET is a throw-back to shared-file ISAM
>(dBASE) database engines (circa 1970's) while SQL Server is a
>service-based engine designed to handle many, many users and far more
>secure and scalable database requirements. I characterize JET as a "home"
>database and I don't recommend it for any (serious) business
>applications--despite the fact that it's in very wide use all over the
>world in lots of businesses. It makes a sad web DBMS engine. While it can
>work, you're likely to see more and more serious (unsolvable) problems
>with JET when used incorrectly.
>>
>Will SQL Server tolerate code that does not properly close connections?
>Nope, its connection pool will overflow if you don't write the
>application correctly. Will it expose more counters and trace metrics to
>let you inspect the CP status? Sure and then some. Is it designed for use
>in a web site? Absolutely.
>>
>I looked at your code (again) and I see that you're manually opening the
>connection. You don't have to. In your case I suggest that you don't. The
>Fill method opens the connection (if it's not already open), runs the
>query, populates the DataSet and closes the connection (if it was opened
>by Fill).
>>
>I still suspect you might be over-running the ability of JET to handle
>the workload. Remember JET can't stop work on a query and service another
>request. All requests are handled serially (unlike SQL Server).
>>
>I discuss all of this and more in my latest book.
>>
>--
>William (Bill) Vaughn
>Author, Mentor, Consultant
>Microsoft MVP
>INETA Speaker
>www.betav.com/blog/billva
>www.betav.com
>Please reply only to the newsgroup so that others can benefit.
>This posting is provided "AS IS" with no warranties, and confers no
>rights.
>______________ _______________ _____
>Visit www.hitchhikerguides.net to get more information on my latest
>books:
>Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition) and
>Hitchhiker's Guide to SQL Server 2005 Compact Edition
>>
>-----------------------------------------------------------------------------------------------------------------------
>"fniles" <fniles@pfmail. comwrote in message
>news:ego1grRgH HA.3960@TK2MSFT NGP02.phx.gbl.. .
>>
>>
>The differences between JET and SQL Server are ... well, dramatic. They
>are designed very differently. JET is a throw-back to shared-file ISAM
>(dBASE) database engines (circa 1970's) while SQL Server is a
>service-based engine designed to handle many, many users and far more
>secure and scalable database requirements. I characterize JET as a "home"
>database and I don't recommend it for any (serious) business
>applications--despite the fact that it's in very wide use all over the
>world in lots of businesses. It makes a sad web DBMS engine. While it can
>work, you're likely to see more and more serious (unsolvable) problems
>with JET when used incorrectly.
>>
>Will SQL Server tolerate code that does not properly close connections?
>Nope, its connection pool will overflow if you don't write the
>application correctly. Will it expose more counters and trace metrics to
>let you inspect the CP status? Sure and then some. Is it designed for use
>in a web site? Absolutely.
>>
>I looked at your code (again) and I see that you're manually opening the
>connection. You don't have to. In your case I suggest that you don't. The
>Fill method opens the connection (if it's not already open), runs the
>query, populates the DataSet and closes the connection (if it was opened
>by Fill).
>>
>I still suspect you might be over-running the ability of JET to handle
>the workload. Remember JET can't stop work on a query and service another
>request. All requests are handled serially (unlike SQL Server).
>>
>I discuss all of this and more in my latest book.
>>
>--
>William (Bill) Vaughn
>Author, Mentor, Consultant
>Microsoft MVP
>INETA Speaker
>www.betav.com/blog/billva
>www.betav.com
>Please reply only to the newsgroup so that others can benefit.
>This posting is provided "AS IS" with no warranties, and confers no
>rights.
>______________ _______________ _____
>Visit www.hitchhikerguides.net to get more information on my latest
>books:
>Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition) and
>Hitchhiker's Guide to SQL Server 2005 Compact Edition
>>
>-----------------------------------------------------------------------------------------------------------------------
>"fniles" <fniles@pfmail. comwrote in message
>news:ego1grRgH HA.3960@TK2MSFT NGP02.phx.gbl.. .
>>Thank you.
>>>>If the cause of your problem is the CP
>>What did you mean by CP ?
>>>
>>>>JET is not designed for this kind of work.
>>So, if I use SQL Server (and assuming I use the code like below, except
>>using SqlConnection instead of OLEDbConnection ), most likely I will not
>>have the problem where the pool is filling like in Access ? Is the
>>maximum pool size in Access smaller than in SQL Server (where the
>>default is 100) ?
>>>
>>I close the connection right after I fill the dataset like shown below.
>>Can I close the connection faster then the way I do it ?
>>This code is called everytime somebody login to the application.
>>>
>>Dim cmd As New OleDb.OleDbComm and
>>Dim da As OleDb.OleDbData Adapter
>>Dim ds As DataSet
>>Dim ConnectionDemoO LE As OleDb.OleDbConn ection
>>With cmd
>> bDBSuccess = OpenDBDemoOLE(C onnectionDemoOL E)
>> If bDBSuccess Then
>> .Connection = ConnectionDemoO LE
>> .CommandText = sql
>> Try
>> da = New OleDb.OleDbData Adapter
>> ds = New DataSet
>> da.SelectComman d = cmd
>> da.Fill(ds)
>> CloseConDemoOLE (ConnectionDemo OLE)
>> Catch ex As Exception
>> end try
>> Sub CloseConDemoOLE (ByRef ConnectionDemoO LE As OleDb.OleDbConn ection)
>> If Not ConnectionDemoO LE Is Nothing Then
>> ConnectionDemoO LE.Close()
>> ConnectionDemoO LE = Nothing
>> End If
>> End Sub
>>>
>> Function OpenDBDemoOLE(B yRef ConnectionDemoO LE As
>>OleDb.OleDbCo nnection) As Boolean
>> Try
>> ConnectionDemoO LE = New OleDb.OleDbConn ection
>> OpenDBDemoOLE = True
>> With ConnectionDemoO LE
>> .ConnectionStri ng = g_dbPathDemo
>> .Open()
>> If .State = ConnectionState .Closed Then
>> CloseConDemoOLE (ConnectionDemo OLE)
>> OpenDBDemoOLE = False
>> End If
>> End With
>> Catch ex As Exception
>>end try
>>>
>>"William (Bill) Vaughn" <billva@NoSpamA tAll_betav.comw rote in message
>>news:Oroa83Qg HHA.3460@TK2MSF TNGP04.phx.gbl. ..
>>>Ah, I doubt if this will help. It assumes that the engine has enough
>>>idle time to do it's work. The fundamental issue is clear. If the cause
>>>of your problem is the CP and the pool is filling then something is
>>>overloadin g the engine or your code is not releasing/closing
>>>connection s in a timely fashion. Again, JET is not designed for this
>>>kind of work. I think you're beating a dead horse.
>>>>
>>>--
>>>William (Bill) Vaughn
>>>Author, Mentor, Consultant
>>>Microsoft MVP
>>>INETA Speaker
>>>www.betav.com/blog/billva
>>>www.betav.com
>>>Please reply only to the newsgroup so that others can benefit.
>>>This posting is provided "AS IS" with no warranties, and confers no
>>>rights.
>>>____________ _______________ _______
>>>Visit www.hitchhikerguides.net to get more information on my latest
>>>books:
>>>Hitchhiker 's Guide to Visual Studio and SQL Server (7th Edition) and
>>>Hitchhiker 's Guide to SQL Server 2005 Compact Edition
>>>>
>>>-----------------------------------------------------------------------------------------------------------------------
>>>"fniles" <fniles@pfmail. comwrote in message
>>>news:OUmc0jK gHHA.2640@TK2MS FTNGP06.phx.gbl ...
>>>>Thank you.
>>>>I do use try/catch, but I get the "Unspecifie d error".
>>>>>
>>>>When the maximum pool size has been reached and I get an error, how
>>>>can I loop and wait until a connection is available again ?
>>>>>
>>>> Try
>>>> ConnectionOLE = New OleDb.OleDbConn ection
>>>> OpenDBOLE = True
>>>> With ConnectionOLE
>>>> .ConnectionStri ng = g_dbPath
>>>> .Open() --IF MAX POOL SIZE HAS BEEN REACHED, IT WILL
>>>>GO to the Catch. How can I loop and wait to open the db until a
>>>>connectio n is available again ?
>>>> End With
>>>> Catch ex As Exception
>>>> Try
>>>>>
>>>>Thank you.
>>>>>
>>>>"William (Bill) Vaughn" <billva@NoSpamA tAll_betav.comw rote in
>>>>message news:OlI3%236Hg HHA.4804@TK2MSF TNGP02.phx.gbl. ..
>>>>>See >>>>>
>>>>>>
>>>>>--
>>>>>William (Bill) Vaughn
>>>>>Author, Mentor, Consultant
>>>>>Microsof t MVP
>>>>>INETA Speaker
>>>>>www.betav.com/blog/billva
>>>>>www.betav.com
>>>>>Please reply only to the newsgroup so that others can benefit.
>>>>>This posting is provided "AS IS" with no warranties, and confers no
>>>>>rights.
>>>>>__________ _______________ _________
>>>>>Visit www.hitchhikerguides.net to get more information on my latest
>>>>>books:
>>>>>Hitchhiker 's Guide to Visual Studio and SQL Server (7th Edition) and
>>>>>Hitchhiker 's Guide to SQL Server 2005 Compact Edition
>>>>>>
>>>>>-----------------------------------------------------------------------------------------------------------------------
>>>>>"fniles" <fniles@pfmail. comwrote in message
>>>>>news:%23uA CzGHgHHA.4260@T K2MSFTNGP03.phx .gbl...
>>>>>>>I am using VB.Net 2003 over a LAN, and I have no choice but to use MS
>>>>>>>Access .
>>>>>>In SQL Server, in the connection string you can set the max pool
>>>>>>size, can you do that in MS Access ?
>>>>>>
>>>>>>>>>>Nop e.
>>>>>>
>>>>>>>
>>>>>>You mentioned that "If you exhaust the pool you should get a timeout
>>>>>>exception ." So, you will get an error, right ?
>>>>>>I mean if you put try-catch-end try, it will go to the Cath section,
>>>>>>right ?
>>>>>>
>>>>>>>>>>Right .
>>>>>>
>>>>>>In my other posting I posted that sometimes I get "Unspecifie d
>>>>>>error" on the Open method when opening up the OleDBConnection . This
>>>>>>does not happen all the time, only sometimes, which makes me think
>>>>>>that maybe the maximum pool size has been reached ? Is it possible
>>>>>>that the "Unspecifie d error" on the Open method caused by the
>>>>>>maximum pool size has been reached ?
>>>>>>
>>>>>>>>>"Unspe cified" errors generally means you don't have a Try/Catch
>>>>>>>>>bloc k to trap the specific exception. In Access/JET, yes it might
>>>>>>>>>mean the pool is full or the database is corrupt, or almost
>>>>>>>>>anythi ng else.
>>>>>>
>>>>>>
>>>>>>>
>>>>>> Dim swError As StreamWriter
>>>>>> Dim sSub As String
>>>>>> Try
>>>>>> sSub = "1"
>>>>>> ConnectionOLE = New OleDb.OleDbConn ection
>>>>>> OpenDBOLE = True
>>>>>> With ConnectionOLE
>>>>>> .ConnectionStri ng = g_dbPath
>>>>>> sSub = "2"
>>>>>> .Open() --IF MAX POOL SIZE HAS BEEN REACHED, IT
>>>>>>WILL GO TO THE Catch section below ?
>>>>>>
>>>>>>>>In theory... yes.
>>>>>>
>>>>>>
>>>>>> sSub = "3"
>>>>>> End With
>>>>>> Catch ex As Exception
>>>>>> swError = New StreamWriter(Ap plication.Start upPath &
>>>>>>"\AQError Log" & Date.Now.ToStri ng("MMddyy") & ".txt", True)
>>>>>> swError.Write(N ow & " OpenDBOLE - error = " &
>>>>>>ex.Messag e & " sub = " & sSub & " g_dbPath = " & g_dbPath & vbCrLf)
>>>>>> swError.Close()
>>>>>> swError = Nothing
>>>>>> End Try
>>>>>>>
>>>>>>Thank you.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>"Willia m (Bill) Vaughn" <billva@NoSpamA tAll_betav.comw rote in
>>>>>>message news:u2%23Nf5Gg HHA.3388@TK2MSF TNGP02.phx.gbl. ..
>>>>>>>>I don't think there are any system counters exposed by the JET
>>>>>>>>provide r or by OLE DB to monitor the CP.
>>>>>>>If you exhaust the pool you should get a timeout exception.
>>>>>>>Howeve r, (and Ginny please correct me here), if you're working with
>>>>>>>JET and an ASP application, you've got your wires crossed. JET is
>>>>>>>not designed to provide data for more than one user. Sure, you can
>>>>>>>share a JET .MDB database over a LAN, but each user gets its own
>>>>>>>JET engine to access the file. Using it in a web application that
>>>>>>>requir es one JET engine to access the data is problematic at best.
>>>>>>>I suggest using a DBMS designed for the web--SQL Express.
>>>>>>>>
>>>>>>>hth
>>>>>>>>
>>>>>>>--
>>>>>>>Willia m (Bill) Vaughn
>>>>>>>Author , Mentor, Consultant
>>>>>>>Microsof t MVP
>>>>>>>INETA Speaker
>>>>>>>www.betav.com/blog/billva
>>>>>>>www.betav.com
>>>>>>>Please reply only to the newsgroup so that others can benefit.
>>>>>>>This posting is provided "AS IS" with no warranties, and confers no
>>>>>>>rights .
>>>>>>>________ _______________ ___________
>>>>>>>Visit www.hitchhikerguides.net to get more information on my latest
>>>>>>>books:
>>>>>>>Hitchhik er's Guide to Visual Studio and SQL Server (7th Edition)
>>>>>>>and
>>>>>>>Hitchhik er's Guide to SQL Server 2005 Compact Edition
>>>>>>>>
>>>>>>>-----------------------------------------------------------------------------------------------------------------------
>>>>>>>"fnile s" <fniles@pfmail. comwrote in message
>>>>>>>news:ejD HZzGgHHA.4368@T K2MSFTNGP03.phx .gbl...
>>>>>>>>>I am using VS2003 and connecting to MS Access database.
>>>>>>>>When using a connection pooling (every time I open the
>>>>>>>>OLEDBCO NNECTION I use the exact matching connection string),
>>>>>>>>1. how can I know how many connection has been used ?
>>>>>>>>2. If the maximum pool size has been reached, what happens when I
>>>>>>>>call the method Open to open the connection ? Will I get an error
>>>>>>>>? MSDN says the request is queued, but will I get an error in the
>>>>>>>>open method ?
>>>>>>>>>
>>>>>>>>Connect ionDemoOLE = New OleDb.OleDbConn ection
>>>>>>>>sPath = "Provider=Micro soft.Jet.OLEDB. 4.0;Data Source=" & sDBPath
>>>>>>>>& ";OLE DB
>>>>>>>>Service s=-1"
>>>>>>>>With ConnectionDemoO LE
>>>>>>>> .ConnectionStri ng = sPath
>>>>>>>> .Open() --what happens here when the maximum pool size has
>>>>>>>>been reached ?
>>>>>>>>>
>>>>>>>>Thank s
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>>>If the cause of your problem is the CP
>>What did you mean by CP ?
>>>
>>>>JET is not designed for this kind of work.
>>So, if I use SQL Server (and assuming I use the code like below, except
>>using SqlConnection instead of OLEDbConnection ), most likely I will not
>>have the problem where the pool is filling like in Access ? Is the
>>maximum pool size in Access smaller than in SQL Server (where the
>>default is 100) ?
>>>
>>I close the connection right after I fill the dataset like shown below.
>>Can I close the connection faster then the way I do it ?
>>This code is called everytime somebody login to the application.
>>>
>>Dim cmd As New OleDb.OleDbComm and
>>Dim da As OleDb.OleDbData Adapter
>>Dim ds As DataSet
>>Dim ConnectionDemoO LE As OleDb.OleDbConn ection
>>With cmd
>> bDBSuccess = OpenDBDemoOLE(C onnectionDemoOL E)
>> If bDBSuccess Then
>> .Connection = ConnectionDemoO LE
>> .CommandText = sql
>> Try
>> da = New OleDb.OleDbData Adapter
>> ds = New DataSet
>> da.SelectComman d = cmd
>> da.Fill(ds)
>> CloseConDemoOLE (ConnectionDemo OLE)
>> Catch ex As Exception
>> end try
>> Sub CloseConDemoOLE (ByRef ConnectionDemoO LE As OleDb.OleDbConn ection)
>> If Not ConnectionDemoO LE Is Nothing Then
>> ConnectionDemoO LE.Close()
>> ConnectionDemoO LE = Nothing
>> End If
>> End Sub
>>>
>> Function OpenDBDemoOLE(B yRef ConnectionDemoO LE As
>>OleDb.OleDbCo nnection) As Boolean
>> Try
>> ConnectionDemoO LE = New OleDb.OleDbConn ection
>> OpenDBDemoOLE = True
>> With ConnectionDemoO LE
>> .ConnectionStri ng = g_dbPathDemo
>> .Open()
>> If .State = ConnectionState .Closed Then
>> CloseConDemoOLE (ConnectionDemo OLE)
>> OpenDBDemoOLE = False
>> End If
>> End With
>> Catch ex As Exception
>>end try
>>>
>>"William (Bill) Vaughn" <billva@NoSpamA tAll_betav.comw rote in message
>>news:Oroa83Qg HHA.3460@TK2MSF TNGP04.phx.gbl. ..
>>>Ah, I doubt if this will help. It assumes that the engine has enough
>>>idle time to do it's work. The fundamental issue is clear. If the cause
>>>of your problem is the CP and the pool is filling then something is
>>>overloadin g the engine or your code is not releasing/closing
>>>connection s in a timely fashion. Again, JET is not designed for this
>>>kind of work. I think you're beating a dead horse.
>>>>
>>>--
>>>William (Bill) Vaughn
>>>Author, Mentor, Consultant
>>>Microsoft MVP
>>>INETA Speaker
>>>www.betav.com/blog/billva
>>>www.betav.com
>>>Please reply only to the newsgroup so that others can benefit.
>>>This posting is provided "AS IS" with no warranties, and confers no
>>>rights.
>>>____________ _______________ _______
>>>Visit www.hitchhikerguides.net to get more information on my latest
>>>books:
>>>Hitchhiker 's Guide to Visual Studio and SQL Server (7th Edition) and
>>>Hitchhiker 's Guide to SQL Server 2005 Compact Edition
>>>>
>>>-----------------------------------------------------------------------------------------------------------------------
>>>"fniles" <fniles@pfmail. comwrote in message
>>>news:OUmc0jK gHHA.2640@TK2MS FTNGP06.phx.gbl ...
>>>>Thank you.
>>>>I do use try/catch, but I get the "Unspecifie d error".
>>>>>
>>>>When the maximum pool size has been reached and I get an error, how
>>>>can I loop and wait until a connection is available again ?
>>>>>
>>>> Try
>>>> ConnectionOLE = New OleDb.OleDbConn ection
>>>> OpenDBOLE = True
>>>> With ConnectionOLE
>>>> .ConnectionStri ng = g_dbPath
>>>> .Open() --IF MAX POOL SIZE HAS BEEN REACHED, IT WILL
>>>>GO to the Catch. How can I loop and wait to open the db until a
>>>>connectio n is available again ?
>>>> End With
>>>> Catch ex As Exception
>>>> Try
>>>>>
>>>>Thank you.
>>>>>
>>>>"William (Bill) Vaughn" <billva@NoSpamA tAll_betav.comw rote in
>>>>message news:OlI3%236Hg HHA.4804@TK2MSF TNGP02.phx.gbl. ..
>>>>>See >>>>>
>>>>>>
>>>>>--
>>>>>William (Bill) Vaughn
>>>>>Author, Mentor, Consultant
>>>>>Microsof t MVP
>>>>>INETA Speaker
>>>>>www.betav.com/blog/billva
>>>>>www.betav.com
>>>>>Please reply only to the newsgroup so that others can benefit.
>>>>>This posting is provided "AS IS" with no warranties, and confers no
>>>>>rights.
>>>>>__________ _______________ _________
>>>>>Visit www.hitchhikerguides.net to get more information on my latest
>>>>>books:
>>>>>Hitchhiker 's Guide to Visual Studio and SQL Server (7th Edition) and
>>>>>Hitchhiker 's Guide to SQL Server 2005 Compact Edition
>>>>>>
>>>>>-----------------------------------------------------------------------------------------------------------------------
>>>>>"fniles" <fniles@pfmail. comwrote in message
>>>>>news:%23uA CzGHgHHA.4260@T K2MSFTNGP03.phx .gbl...
>>>>>>>I am using VB.Net 2003 over a LAN, and I have no choice but to use MS
>>>>>>>Access .
>>>>>>In SQL Server, in the connection string you can set the max pool
>>>>>>size, can you do that in MS Access ?
>>>>>>
>>>>>>>>>>Nop e.
>>>>>>
>>>>>>>
>>>>>>You mentioned that "If you exhaust the pool you should get a timeout
>>>>>>exception ." So, you will get an error, right ?
>>>>>>I mean if you put try-catch-end try, it will go to the Cath section,
>>>>>>right ?
>>>>>>
>>>>>>>>>>Right .
>>>>>>
>>>>>>In my other posting I posted that sometimes I get "Unspecifie d
>>>>>>error" on the Open method when opening up the OleDBConnection . This
>>>>>>does not happen all the time, only sometimes, which makes me think
>>>>>>that maybe the maximum pool size has been reached ? Is it possible
>>>>>>that the "Unspecifie d error" on the Open method caused by the
>>>>>>maximum pool size has been reached ?
>>>>>>
>>>>>>>>>"Unspe cified" errors generally means you don't have a Try/Catch
>>>>>>>>>bloc k to trap the specific exception. In Access/JET, yes it might
>>>>>>>>>mean the pool is full or the database is corrupt, or almost
>>>>>>>>>anythi ng else.
>>>>>>
>>>>>>
>>>>>>>
>>>>>> Dim swError As StreamWriter
>>>>>> Dim sSub As String
>>>>>> Try
>>>>>> sSub = "1"
>>>>>> ConnectionOLE = New OleDb.OleDbConn ection
>>>>>> OpenDBOLE = True
>>>>>> With ConnectionOLE
>>>>>> .ConnectionStri ng = g_dbPath
>>>>>> sSub = "2"
>>>>>> .Open() --IF MAX POOL SIZE HAS BEEN REACHED, IT
>>>>>>WILL GO TO THE Catch section below ?
>>>>>>
>>>>>>>>In theory... yes.
>>>>>>
>>>>>>
>>>>>> sSub = "3"
>>>>>> End With
>>>>>> Catch ex As Exception
>>>>>> swError = New StreamWriter(Ap plication.Start upPath &
>>>>>>"\AQError Log" & Date.Now.ToStri ng("MMddyy") & ".txt", True)
>>>>>> swError.Write(N ow & " OpenDBOLE - error = " &
>>>>>>ex.Messag e & " sub = " & sSub & " g_dbPath = " & g_dbPath & vbCrLf)
>>>>>> swError.Close()
>>>>>> swError = Nothing
>>>>>> End Try
>>>>>>>
>>>>>>Thank you.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>"Willia m (Bill) Vaughn" <billva@NoSpamA tAll_betav.comw rote in
>>>>>>message news:u2%23Nf5Gg HHA.3388@TK2MSF TNGP02.phx.gbl. ..
>>>>>>>>I don't think there are any system counters exposed by the JET
>>>>>>>>provide r or by OLE DB to monitor the CP.
>>>>>>>If you exhaust the pool you should get a timeout exception.
>>>>>>>Howeve r, (and Ginny please correct me here), if you're working with
>>>>>>>JET and an ASP application, you've got your wires crossed. JET is
>>>>>>>not designed to provide data for more than one user. Sure, you can
>>>>>>>share a JET .MDB database over a LAN, but each user gets its own
>>>>>>>JET engine to access the file. Using it in a web application that
>>>>>>>requir es one JET engine to access the data is problematic at best.
>>>>>>>I suggest using a DBMS designed for the web--SQL Express.
>>>>>>>>
>>>>>>>hth
>>>>>>>>
>>>>>>>--
>>>>>>>Willia m (Bill) Vaughn
>>>>>>>Author , Mentor, Consultant
>>>>>>>Microsof t MVP
>>>>>>>INETA Speaker
>>>>>>>www.betav.com/blog/billva
>>>>>>>www.betav.com
>>>>>>>Please reply only to the newsgroup so that others can benefit.
>>>>>>>This posting is provided "AS IS" with no warranties, and confers no
>>>>>>>rights .
>>>>>>>________ _______________ ___________
>>>>>>>Visit www.hitchhikerguides.net to get more information on my latest
>>>>>>>books:
>>>>>>>Hitchhik er's Guide to Visual Studio and SQL Server (7th Edition)
>>>>>>>and
>>>>>>>Hitchhik er's Guide to SQL Server 2005 Compact Edition
>>>>>>>>
>>>>>>>-----------------------------------------------------------------------------------------------------------------------
>>>>>>>"fnile s" <fniles@pfmail. comwrote in message
>>>>>>>news:ejD HZzGgHHA.4368@T K2MSFTNGP03.phx .gbl...
>>>>>>>>>I am using VS2003 and connecting to MS Access database.
>>>>>>>>When using a connection pooling (every time I open the
>>>>>>>>OLEDBCO NNECTION I use the exact matching connection string),
>>>>>>>>1. how can I know how many connection has been used ?
>>>>>>>>2. If the maximum pool size has been reached, what happens when I
>>>>>>>>call the method Open to open the connection ? Will I get an error
>>>>>>>>? MSDN says the request is queued, but will I get an error in the
>>>>>>>>open method ?
>>>>>>>>>
>>>>>>>>Connect ionDemoOLE = New OleDb.OleDbConn ection
>>>>>>>>sPath = "Provider=Micro soft.Jet.OLEDB. 4.0;Data Source=" & sDBPath
>>>>>>>>& ";OLE DB
>>>>>>>>Service s=-1"
>>>>>>>>With ConnectionDemoO LE
>>>>>>>> .ConnectionStri ng = sPath
>>>>>>>> .Open() --what happens here when the maximum pool size has
>>>>>>>>been reached ?
>>>>>>>>>
>>>>>>>>Thank s
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>
Comment