473,326 Members | 2,048 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Unspecified error on Database Connection in Multiple Threads

I am starting up a number of threads. Each one specifies a connection to the
same database.

Sub ReaderThread()

Dim cn As New System.Data.OleDb.OleDbConnection
cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
dbaseFile
cn.Open()

etc...

After the 65th thread starts up I get the error:

{System.Data.OleDb.OleDbException}
[System.Data.OleDb.OleDbException]: {System.Data.OleDb.OleDbException}
HelpLink: Nothing
InnerException: Nothing
Message: "Unspecified error"
Source: "Microsoft JET Database Engine"
StackTrace: " at
System.Data.OleDb.OleDbConnection.ProcessResults(I nt32 hr)
at System.Data.OleDb.OleDbConnection.InitializeProvid er()
at System.Data.OleDb.OleDbConnection.Open()
at EDAC_DataLogger.Form1.ReaderThread() in C:\Company\xxxxxxxxxx
DataLogger Form1 V1.1.vb:line 212"
TargetSite: {System.Reflection.RuntimeMethodInfo}

The error on line 212 is the cn.Open() command. I don't know if there is
something significant about opening 65 connections. If I do 64 threads it
all runs OK.

-Jerry


Nov 21 '05 #1
3 6165
Jerry:

connection objects aren't Thread Safe. I can't tell what's going on just
from this - but it should blow up pretty quickly. When are you sending
Command objects through?

However, I just say that on GP - I'm guessing the connection pool is full on
the Access DB. Please tell me that you aren't seriously trying to open > 5
connections to an access DB?

--
W.G. Ryan MVP (Windows Embedded)

TiBA Solutions
www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
"Jerry Spence1" <je**********@somewhere.com> wrote in message
news:41***********************@ptn-nntp-reader03.plus.net...
I am starting up a number of threads. Each one specifies a connection to the same database.

Sub ReaderThread()

Dim cn As New System.Data.OleDb.OleDbConnection
cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
dbaseFile
cn.Open()

etc...

After the 65th thread starts up I get the error:

{System.Data.OleDb.OleDbException}
[System.Data.OleDb.OleDbException]: {System.Data.OleDb.OleDbException}
HelpLink: Nothing
InnerException: Nothing
Message: "Unspecified error"
Source: "Microsoft JET Database Engine"
StackTrace: " at
System.Data.OleDb.OleDbConnection.ProcessResults(I nt32 hr)
at System.Data.OleDb.OleDbConnection.InitializeProvid er()
at System.Data.OleDb.OleDbConnection.Open()
at EDAC_DataLogger.Form1.ReaderThread() in C:\Company\xxxxxxxxxx
DataLogger Form1 V1.1.vb:line 212"
TargetSite: {System.Reflection.RuntimeMethodInfo}

The error on line 212 is the cn.Open() command. I don't know if there is
something significant about opening 65 connections. If I do 64 threads it
all runs OK.

-Jerry

Nov 21 '05 #2
Jerry:

connection objects aren't Thread Safe. I can't tell what's going on just
from this - but it should blow up pretty quickly. When are you sending
Command objects through?

However, I just say that on GP - I'm guessing the connection pool is full on
the Access DB. Please tell me that you aren't seriously trying to open > 5
connections to an access DB?

--
W.G. Ryan MVP (Windows Embedded)

TiBA Solutions
www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
"Jerry Spence1" <je**********@somewhere.com> wrote in message
news:41***********************@ptn-nntp-reader03.plus.net...
I am starting up a number of threads. Each one specifies a connection to the same database.

Sub ReaderThread()

Dim cn As New System.Data.OleDb.OleDbConnection
cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
dbaseFile
cn.Open()

etc...

After the 65th thread starts up I get the error:

{System.Data.OleDb.OleDbException}
[System.Data.OleDb.OleDbException]: {System.Data.OleDb.OleDbException}
HelpLink: Nothing
InnerException: Nothing
Message: "Unspecified error"
Source: "Microsoft JET Database Engine"
StackTrace: " at
System.Data.OleDb.OleDbConnection.ProcessResults(I nt32 hr)
at System.Data.OleDb.OleDbConnection.InitializeProvid er()
at System.Data.OleDb.OleDbConnection.Open()
at EDAC_DataLogger.Form1.ReaderThread() in C:\Company\xxxxxxxxxx
DataLogger Form1 V1.1.vb:line 212"
TargetSite: {System.Reflection.RuntimeMethodInfo}

The error on line 212 is the cn.Open() command. I don't know if there is
something significant about opening 65 connections. If I do 64 threads it
all runs OK.

-Jerry

Nov 21 '05 #3
Yes I am (or was). Each single connection was through a different thread.
Because you can only have one Datareader open I had to define a seperate
connection for each thread which was a pain (whereas I did have the
connection as public). There could be a large number of threads generated
(100 up).

Since posting this I have found the answer. There is a restriction of 64
connections on a database. I have now managed to sych the threads so that I
close some before opening too many.

Thanks for your help.

-Jerry

"W.G. Ryan eMVP" <Wi*********@NoSpam.gmail.com> wrote in message
news:eh**************@tk2msftngp13.phx.gbl...
Jerry:

connection objects aren't Thread Safe. I can't tell what's going on just
from this - but it should blow up pretty quickly. When are you sending
Command objects through?

However, I just say that on GP - I'm guessing the connection pool is full on the Access DB. Please tell me that you aren't seriously trying to open > 5 connections to an access DB?

--
W.G. Ryan MVP (Windows Embedded)

TiBA Solutions
www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
"Jerry Spence1" <je**********@somewhere.com> wrote in message
news:41***********************@ptn-nntp-reader03.plus.net...
I am starting up a number of threads. Each one specifies a connection to

the
same database.

Sub ReaderThread()

Dim cn As New System.Data.OleDb.OleDbConnection
cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
dbaseFile
cn.Open()

etc...

After the 65th thread starts up I get the error:

{System.Data.OleDb.OleDbException}
[System.Data.OleDb.OleDbException]: {System.Data.OleDb.OleDbException} HelpLink: Nothing
InnerException: Nothing
Message: "Unspecified error"
Source: "Microsoft JET Database Engine"
StackTrace: " at
System.Data.OleDb.OleDbConnection.ProcessResults(I nt32 hr)
at System.Data.OleDb.OleDbConnection.InitializeProvid er()
at System.Data.OleDb.OleDbConnection.Open()
at EDAC_DataLogger.Form1.ReaderThread() in C:\Company\xxxxxxxxxx
DataLogger Form1 V1.1.vb:line 212"
TargetSite: {System.Reflection.RuntimeMethodInfo}

The error on line 212 is the cn.Open() command. I don't know if there is
something significant about opening 65 connections. If I do 64 threads it all runs OK.

-Jerry


Nov 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: rOadhOg | last post by:
Help please! I set up a simple access 2000 database and I'm running IIS5. The first time I try it, it works, then it seems like I have to wait for some kind of time out for it to work again,...
6
by: wk6pack | last post by:
Hi, I have a question about my coding practise. I have a class method to return a value from a database. I open the connection do my search and dispose the reader. Open the reader with a new...
4
by: Mark | last post by:
OK. Here we go. I have an ASP.NET application that does many hits to a SQL Server DB on a separate server. When I first created this application (2 years ago) and was very new to ASP/ASP.NET, to...
4
by: Troy | last post by:
We recently installed the .Net framework on a windows 2000 server. Shortly after that we experienced intermitant problems running a web based program that accesses an Access 2002 database. The...
7
by: Jim McGivney | last post by:
ASPX page from VS.net-C# on host's computer using oleDataAdaptor to connect to Microsoft Access database. The page loads, but when connection to the database is attempted to fill a datagrid the...
0
by: Jerry Spence1 | last post by:
I am starting up a number of threads. Each one specifies a connection to the same database. Sub ReaderThread() Dim cn As New System.Data.OleDb.OleDbConnection cn.ConnectionString =...
35
by: Terry Jolly | last post by:
Web Solution Goal: Have a global database connection Why: (There will be 30+ tables, represented by 30+ classes) I only want to reference the database connection once. I put the connection...
0
by: fniles | last post by:
I am using VB.Net 2003 and MS Access database. Sometimes when I open the database, I got the error "Unspecified error" The application validate users, when it validates users, it reads from a...
11
by: Jialiang Ge [MSFT] | last post by:
Hello Peter, I once came across the same error "ExecuteReader requires the command to have a transaction when the connection assigned? with running two threads talking with the database. There...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.