Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / December 2004

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
spicyz - 17 Dec 2004 21:47 GMT
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
Dan Rogers - 20 Dec 2004 21:11 GMT
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?= <spicyz@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: <0701C8FB-BFA6-4CFA-AB9C-CFCEF9664321@microsoft.com>
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

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.