473,390 Members | 1,303 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,390 software developers and data experts.

Using OleDb w/MSJet to Access DB causing exception in webmethod

I'm receiving an exception when my webmethod exits after opening/closing an
Access database.

I can reproduce this easily enough by creating a new default ASP .NET Web
Service in VS.NET 2003. Adding this code to the default HelloWorld()
webmethod will cause the problem.

String* sConnection = S"Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;Data
Source=c:\\mydb.mdb";

OleDbConnection* poDbConnection = new OleDbConnection();
poDbConnection->set_ConnectionString( sConnection );
poDbConnection->Open();
poDbConnection->Close();
poDbConnection->Dispose();

When HelloWorld exits, you'll get the following exception in the trace window:

An unhandled exception of type 'System.Threading.ThreadAbortException'
occurred in Unknown Module.
Additional information: Thread was being aborted.

I'm using Windows XP SP2, VS.NET 2003 and framework 1.1 SP1

While this doesn't cause the app to crash outright, it is delaying all
subsequent calls that are made on that webmethod. I'm seeing delays of
several minutes in some cases!

I'm at my wits end with this and have exhausted all my options. Am I
missing something obvious? Is there a way to get this to shutdown gracefully?

-jb
Nov 23 '05 #1
1 2080
Hi,

Try not to call an object's Dispose method like this. What happens if you
just call open and close, but leave off the Dispose method? Another
thought is to make sure that the Jet driver is thread safe. If it is not
thread safe (e.g. was intended for single user applications) then you can
expect all kinds of issues.

I hope this helps,

Dan Rogers
Microsoft Corporation

--------------------
Thread-Topic: Using OleDb w/MSJet to Access DB causing exception in
webmethod
thread-index: AcTkgfD0Qm6Y2nmHTtm33f4s2h2atg==
X-WBNR-Posting-Host: 207.236.239.4
From: =?Utf-8?B?c3BpY3l6?= <sp****@discussions.microsoft.com>
Subject: Using OleDb w/MSJet to Access DB causing exception in webmethod
Date: Fri, 17 Dec 2004 13:47:01 -0800
Lines: 32
Message-ID: <07**********************************@microsoft.co m>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.public.dotnet.framework.webservices
NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
Xref: cpmsftngxa10.phx.gbl
microsoft.public.dotnet.framework.webservices:8192
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

I'm receiving an exception when my webmethod exits after opening/closing an
Access database.

I can reproduce this easily enough by creating a new default ASP .NET Web
Service in VS.NET 2003. Adding this code to the default HelloWorld()
webmethod will cause the problem.

String* sConnection = S"Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;Data
Source=c:\\mydb.mdb";

OleDbConnection* poDbConnection = new OleDbConnection();
poDbConnection->set_ConnectionString( sConnection );
poDbConnection->Open();
poDbConnection->Close();
poDbConnection->Dispose();

When HelloWorld exits, you'll get the following exception in the trace
window:

An unhandled exception of type 'System.Threading.ThreadAbortException'
occurred in Unknown Module.
Additional information: Thread was being aborted.

I'm using Windows XP SP2, VS.NET 2003 and framework 1.1 SP1

While this doesn't cause the app to crash outright, it is delaying all
subsequent calls that are made on that webmethod. I'm seeing delays of
several minutes in some cases!

I'm at my wits end with this and have exhausted all my options. Am I
missing something obvious? Is there a way to get this to shutdown
gracefully?

-jb

Nov 23 '05 #2

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

Similar topics

5
by: Geert-Pieter Hof | last post by:
Hello, My VB application read and writes data from and to a MS Excel workbook, using the Microsoft.Jet.OLEDB.4.0 provider. I have installed the MS ActiveX Data Object 2.0 Library on my computer...
4
by: Oceania | last post by:
Hi All, I did try using the sample code from the ADO.net forum to link one table, it is working fine. But, I got a problem when I tried to link all tables (20 tables)... Please help, thank...
8
by: John | last post by:
Hi I need to be able to call a web service method, receive the dataset that web method returns and store it in an access table. My problem is that I don't know how to "receive" a complex type...
4
ollyb303
by: ollyb303 | last post by:
Hi, wasn't sure whether I should post this under .net, IIS or access, but I've plumped for .net! I have a problem with an asp.net website which I am hosting on a windows server 2003 under IIS...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: 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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.