.NETGURU
MSAccess cant cope with the workload of a couple of page requests ?
Messages   Related Types
This message was discovered on ASPFriends.com 'ngfx-oledb' list.


Enrique Avalle
-- Moved from [aspngdata] to [ngfx-oledb] by Alex Lowe <Click here to reveal e-mail address> --

-- Moved from [aspngfreeforall] to [aspngdata] by Rachel Reese <Click here to reveal e-mail address> --

Dear friends,

The plot is the following:

Some clients and hosting providers down here prefer and offer ACCESS as the database solution for our client's sites. So we were forced in some cases to use access as data storage backend for our applications, in ASP.

Now we are working in asp.net (our first attempts) and we use the code depicted below in a class that we use for database connectivity abstraction.

Everything goes ok, but after a couple of iterations with this function, system fails in line "oconn.open" ....

We are very intrigued why the connection cant be opened. It gave us the impression that we used up all access connections (we understand the number of max. concurrent conns are 10) but then this is impossible, as we clearly close it in a correct way.

A number ofHipotesis arises, mostly wrong and improbable:

1) the following function returns an oledbdatareader object with the query result that it is called with. We were quite confident that an oledbdatareader is a disconnected object from the database, and the query is filled in server memory, where the oledbdatareader serves itself ... but then: maybe not and while using the oledbdatareader to interact with each record we are still using the database and hence, missing somehow the .dispose ?

2) The dispose does not happens inmediately and so the conn keeps open effectively reaching access maximum before GC (garbage recollector) actuates ? If so ... how can I solve that ?

3) perhaps a totally unrelated issue, due to our inexperience is pulling our leg :)

We really appreciate any help:

Enrique.

'-----------------------------------------------------------------------------------------------------
Public Shared Function dbread(ByVal sql as string) as OleDBDataReader

Dim oconn as New OLEDBConnection(ConfigurationSettings.AppSettings("connstr"))

oconn.open

dim ocmd as New OLEDBCommand(sql,oconn)

dim odr as OleDBDataReader

odr=ocmd.executereader()

ocmd.dispose()

return odr

oconn.dispose()

end function

--------------------------------------------------------------------

In this particular case, the problem had the following background:

ERROR: Unspecified error

WHERE: Microsoft JET Database Engine

at System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr) at System.Data.OleDb.OleDbConnection.InitializeProvider() at System.Data.OleDb.OleDbConnection.Open() at cndg.db.dbread(String sql) in C:\Documents and Settings\Administrator\VSWebCache\cndg.rotaip.com\bin\db.vb:line 44 at ASP.log_aspx.Page_Load(Object sender, EventArgs e) in E:\Sitios Web de Enrique\clearinghouse\log.aspx:line 430 at System.Web.UI.Control.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain()

BUT again, the error is generated from ANY page after some db usage....

The connection string is: Provider=Microsoft.Jet.OLEDB.4.0; Data Source=c:\datahomes\clearinghouse\CNDG.mdb;

Reply to this message...
 
    
Alex Dresko
DataReaders are actually connected to the data source. Since you haven't
posted your code, I can't determine if applying that knowledge to your
project would affect it or not. If it concerns you, I wouldn't worry too
much about having to use Access. Some people balk on the idea, but if
that's what you have to use it works most of the time. Another tip I
would suggest is to look at your connection string. Typically, when I
used to work with ASP, my connection strings looked similar to
"Driver={Microsoft Access Driver (*.mdb)};DBQ=c:\database.mdb".. In
fact, that connection string will probably be forever etched into my
mind. That being said, I still can't force myself to remember a proper
.NET connection string (for OleDb) which looks something like this..
"PROVIDER=Microsoft.Jet.OLEDB.4.0;USER ID=admin;DATA
SOURCE=c:\database.mdb" Also, you don't normally need to worry about
GC. The CLR takes care of this quite well and it is recommended that you
not call the Dispose() method unless the class you are working with uses
unmanaged resources.

Alex Dresko
Three Point Oh!

-----Original Message-----
From: Enrique Avalle [mailto:Click here to reveal e-mail address]
Sent: Thursday, August 15, 2002 12:29 PM
To: ngfx-oledb
Subject: [ngfx-oledb] MSAccess cant cope with the workload of a couple
of page requests ?

-- Moved from [aspngdata] to [ngfx-oledb] by Alex Lowe
<Click here to reveal e-mail address> --

-- Moved from [aspngfreeforall] to [aspngdata] by Rachel Reese
<Click here to reveal e-mail address> --

Dear friends,

The plot is the following:

Some clients and hosting providers down here prefer and offer ACCESS as
the database solution for our client's sites. So we were forced in some
cases to use access as data storage backend for our applications, in
ASP.

Now we are working in asp.net (our first attempts) and we use the code
depicted below in a class that we use for database connectivity
abstraction.

Everything goes ok, but after a couple of iterations with this function,
system fails in line "oconn.open" ....

We are very intrigued why the connection cant be opened. It gave us the
impression that we used up all access connections (we understand the
number of max. concurrent conns are 10) but then this is impossible, as
we clearly close it in a correct way.

A number ofHipotesis arises, mostly wrong and improbable:

1) the following function returns an oledbdatareader object with the
query result that it is called with. We were quite confident that an
oledbdatareader is a disconnected object from the database, and the
query is filled in server memory, where the oledbdatareader serves
itself ... but then: maybe not and while using the oledbdatareader to
interact with each record we are still using the database and hence,
missing somehow the .dispose ?

2) The dispose does not happens inmediately and so the conn keeps open
effectively reaching access maximum before GC (garbage recollector)
actuates ? If so ... how can I solve that ?

3) perhaps a totally unrelated issue, due to our inexperience is pulling
our leg :)

We really appreciate any help:

Enrique.

'-----------------------------------------------------------------------
------------------------------
Public Shared Function dbread(ByVal sql as string) as OleDBDataReader

Dim oconn as New
OLEDBConnection(ConfigurationSettings.AppSettings("connstr"))

oconn.open

dim ocmd as New OLEDBCommand(sql,oconn)

dim odr as OleDBDataReader

odr=ocmd.executereader()

ocmd.dispose()

return odr

oconn.dispose()

end function

--------------------------------------------------------------------

In this particular case, the problem had the following background:

ERROR: Unspecified error

WHERE: Microsoft JET Database Engine

at System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr) at
System.Data.OleDb.OleDbConnection.InitializeProvider() at
System.Data.OleDb.OleDbConnection.Open() at cndg.db.dbread(String sql)
in C:\Documents and
Settings\Administrator\VSWebCache\cndg.rotaip.com\bin\db.vb:line 44 at
ASP.log_aspx.Page_Load(Object sender, EventArgs e) in E:\Sitios Web de
Enrique\clearinghouse\log.aspx:line 430 at
System.Web.UI.Control.OnLoad(EventArgs e) at
System.Web.UI.Control.LoadRecursive() at
System.Web.UI.Page.ProcessRequestMain()

BUT again, the error is generated from ANY page after some db usage....

The connection string is: Provider=Microsoft.Jet.OLEDB.4.0; Data
Source=c:\datahomes\clearinghouse\CNDG.mdb;
| [ngfx-oledb] member Click here to reveal e-mail address = YOUR ID
| http://www.aspfriends.com/aspfriends/ngfx-oledb.asp = JOIN/QUIT

Reply to this message...
 
    
Nick Durcholz
I am a C# developer myselft, so I don't know the specifics of VB, but I can see one glaring reason why this would be happening: you are returning from the function before disposing the connection. Are you absolutely sure that the statement 'oconn.Dispose()' is being executed? In any language that has a return statement, this line always exits from the function immediately, and no code after it is executed is run.

--------------------------------
From: Nick Durcholz
Reply to this message...
 
 
System.Configuration.ConfigurationSettings
System.Data.OleDb.OleDbConnection
System.EventArgs
System.Web.UI.Control
System.Web.UI.Page




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification