473,386 Members | 1,706 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,386 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 6172
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.