|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Would this bottle-neck my multithreaded App?
Hi Guys,
I have a multithreaded VB application, and it makes lots of calls to a database. Originally I had it so that each worker thread made its own seperate connection to the DB, but under intense traffic Access would start to give error messages saying that too many clients are connected to it. So, to resolve this I have made 1 single thread store the database connection in a public Variable.... Public DBC As ADODB.Connection Now all of the Worker threads use it whenever they need to access the database. However, what I would like to know is the following.... Would having all of the worker threads share the same database connection slow down my application?
__________________
LozWare Website Directory Whooo! Free submissions, no recip needed. I'm a nice guy
Last edited by LozWare : May 21st, 2006 at 10:08 AM. |
|
#2
|
||||
|
||||
|
if they all share the same connection, there is risk of conflicts: one worker thread
accessing the database in the same time other thread is accessing it. for example, worker thread #1 is now reading something. while it's reading, worker thread #2 is trying to insert new record. not good. I'm not sure if the built-in locking mechanism of Access can handle this, you better add your own locking system. |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > Would this bottle-neck my multithreaded App? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|