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

Needing some help with Business Objects in ASP.Net PLEASE

I have an application in asp.net using vb.

The asp.net portion of this application is mainly the user interface. The
UI has references made to our business logic layer. And the business logic
layer uses a database class to access our data environment.

The business logic layer and database class is compiled into a class
library. The database class is a single class that contains all of our
queries there. It is implemented following the Singleton pattern so there
should only be 1 instance of the class.

The problem we are having is when multiple users start hitting the web site,
we get very erratic errors to occur at different points within the
application. All errors are System.InvalidOperationException. Invalid
attempt to read when reader is closed.

The application runs fine with 1 user on the system. So I know that the
code logic is ok. I am concerned that because I implemented a Singleton
database class, that all users in the system are trying to share that 1 class
instance.

Has anybody encountered this before?
Does anyone have any suggestions for me?

Some questions I would love to hear about are
1. When using class libraries, is a copy of the object model unique only at
the application level or at the session level?
2. Is there a way to specify at what level an object model may live within
an asp.net app?

Any feedback someone may have would greatly be appreciated. We have rather
hit a wall here and do not know how to continue.

Thanks.
Nov 9 '06 #1
6 1249
You can check this article out:
5/24/2006
Custom Objects/Collections and Tiered Development
http://sholliday.spaces.live.com/
Some additional thoughts.
Make sure you do some locking with the Singleton.
Or abandon the Singleton thinking altogether.
How are you writing an Asp.Net singleton?
See
10/24/2005
Web Session Wrapper for storing and retrieving objects

Make sure you close your IDataReaders. Don't reuse connection objects.
It is less expensive to start a new connection object, then to tear one down
and build it back up.

I'd take a deep look at the first blog entry above, and then read the MS
article I mention at the bottom of that article.
On my blog, pay attention to the "SqlHelper is a substitute of your
application's data layer object".

I'd abandon a Singleton as a database class. Its more important to
Open LATE
Use quickly.
Close quickly.
Make sure you close and don't let connections linger. This is where I think
youre singleton is probably screwing you.

"Guy Thornton" <wd****************@incresearch.comwrote in message
news:E7**********************************@microsof t.com...
I have an application in asp.net using vb.

The asp.net portion of this application is mainly the user interface. The
UI has references made to our business logic layer. And the business
logic
layer uses a database class to access our data environment.

The business logic layer and database class is compiled into a class
library. The database class is a single class that contains all of our
queries there. It is implemented following the Singleton pattern so there
should only be 1 instance of the class.

The problem we are having is when multiple users start hitting the web
site,
we get very erratic errors to occur at different points within the
application. All errors are System.InvalidOperationException. Invalid
attempt to read when reader is closed.

The application runs fine with 1 user on the system. So I know that the
code logic is ok. I am concerned that because I implemented a Singleton
database class, that all users in the system are trying to share that 1
class
instance.

Has anybody encountered this before?
Does anyone have any suggestions for me?

Some questions I would love to hear about are
1. When using class libraries, is a copy of the object model unique only
at
the application level or at the session level?
2. Is there a way to specify at what level an object model may live
within
an asp.net app?

Any feedback someone may have would greatly be appreciated. We have
rather
hit a wall here and do not know how to continue.

Thanks.

Nov 9 '06 #2
I don't know what is on your site, but it crashed my internet explorer twice
and firefox has high cpu usage and showing an apparent memory leak (memory
usage constantly climbing)

Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available
"sloan" <sl***@ipass.netwrote in message
news:OE**************@TK2MSFTNGP02.phx.gbl...
You can check this article out:
5/24/2006
Custom Objects/Collections and Tiered Development
http://sholliday.spaces.live.com/
Some additional thoughts.
Make sure you do some locking with the Singleton.
Or abandon the Singleton thinking altogether.
How are you writing an Asp.Net singleton?
See
10/24/2005
Web Session Wrapper for storing and retrieving objects

Make sure you close your IDataReaders. Don't reuse connection objects.
It is less expensive to start a new connection object, then to tear one
down
and build it back up.

I'd take a deep look at the first blog entry above, and then read the MS
article I mention at the bottom of that article.
On my blog, pay attention to the "SqlHelper is a substitute of your
application's data layer object".

I'd abandon a Singleton as a database class. Its more important to
Open LATE
Use quickly.
Close quickly.
Make sure you close and don't let connections linger. This is where I
think
youre singleton is probably screwing you.

"Guy Thornton" <wd****************@incresearch.comwrote in message
news:E7**********************************@microsof t.com...
>I have an application in asp.net using vb.

The asp.net portion of this application is mainly the user interface.
The
UI has references made to our business logic layer. And the business
logic
>layer uses a database class to access our data environment.

The business logic layer and database class is compiled into a class
library. The database class is a single class that contains all of our
queries there. It is implemented following the Singleton pattern so
there
should only be 1 instance of the class.

The problem we are having is when multiple users start hitting the web
site,
>we get very erratic errors to occur at different points within the
application. All errors are System.InvalidOperationException. Invalid
attempt to read when reader is closed.

The application runs fine with 1 user on the system. So I know that the
code logic is ok. I am concerned that because I implemented a Singleton
database class, that all users in the system are trying to share that 1
class
>instance.

Has anybody encountered this before?
Does anyone have any suggestions for me?

Some questions I would love to hear about are
1. When using class libraries, is a copy of the object model unique only
at
>the application level or at the session level?
2. Is there a way to specify at what level an object model may live
within
>an asp.net app?

Any feedback someone may have would greatly be appreciated. We have
rather
>hit a wall here and do not know how to continue.

Thanks.


Nov 9 '06 #3
That's something MS did.

Its a IE issue, some SP they released on August.

Its something along the lines of "http 1.1" in the IE advanced options.

I don't know, it does the same for me.

You'd think an msn space page would actually work with IE.


"David" <da*****************@revilloc.REMOVETHIS.comwrot e in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
I don't know what is on your site, but it crashed my internet explorer
twice
and firefox has high cpu usage and showing an apparent memory leak (memory
usage constantly climbing)

Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available
"sloan" <sl***@ipass.netwrote in message
news:OE**************@TK2MSFTNGP02.phx.gbl...
You can check this article out:
5/24/2006
Custom Objects/Collections and Tiered Development
http://sholliday.spaces.live.com/
Some additional thoughts.
Make sure you do some locking with the Singleton.
Or abandon the Singleton thinking altogether.
How are you writing an Asp.Net singleton?
See
10/24/2005
Web Session Wrapper for storing and retrieving objects

Make sure you close your IDataReaders. Don't reuse connection objects.
It is less expensive to start a new connection object, then to tear one
down
and build it back up.

I'd take a deep look at the first blog entry above, and then read the MS
article I mention at the bottom of that article.
On my blog, pay attention to the "SqlHelper is a substitute of your
application's data layer object".

I'd abandon a Singleton as a database class. Its more important to
Open LATE
Use quickly.
Close quickly.
Make sure you close and don't let connections linger. This is where I
think
youre singleton is probably screwing you.

"Guy Thornton" <wd****************@incresearch.comwrote in message
news:E7**********************************@microsof t.com...
I have an application in asp.net using vb.

The asp.net portion of this application is mainly the user interface.
The
UI has references made to our business logic layer. And the business
logic
layer uses a database class to access our data environment.

The business logic layer and database class is compiled into a class
library. The database class is a single class that contains all of our
queries there. It is implemented following the Singleton pattern so
there
should only be 1 instance of the class.

The problem we are having is when multiple users start hitting the web
site,
we get very erratic errors to occur at different points within the
application. All errors are System.InvalidOperationException. Invalid
attempt to read when reader is closed.

The application runs fine with 1 user on the system. So I know that
the
code logic is ok. I am concerned that because I implemented a
Singleton
database class, that all users in the system are trying to share that 1
class
instance.

Has anybody encountered this before?
Does anyone have any suggestions for me?

Some questions I would love to hear about are
1. When using class libraries, is a copy of the object model unique
only
at
the application level or at the session level?
2. Is there a way to specify at what level an object model may live
within
an asp.net app?

Any feedback someone may have would greatly be appreciated. We have
rather
hit a wall here and do not know how to continue.

Thanks.


Nov 9 '06 #4
Ah, OK, but it still is a big problem.

It even fails on firefox, but at least I get a chance to read the page on
FF. I reading it on my laptop, which is on my knee and it gets really hot,
so I saved the page to my HD, removed the script at the top and can read it.
(I could only do this in FF, IE crashed twice. I gave up with IE.).

Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available

"sloan" <sl***@ipass.netwrote in message
news:%2******************@TK2MSFTNGP03.phx.gbl...
That's something MS did.

Its a IE issue, some SP they released on August.

Its something along the lines of "http 1.1" in the IE advanced options.

I don't know, it does the same for me.

You'd think an msn space page would actually work with IE.


"David" <da*****************@revilloc.REMOVETHIS.comwrot e in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
>I don't know what is on your site, but it crashed my internet explorer
twice
>and firefox has high cpu usage and showing an apparent memory leak
(memory
usage constantly climbing)

Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available
"sloan" <sl***@ipass.netwrote in message
news:OE**************@TK2MSFTNGP02.phx.gbl...
You can check this article out:
5/24/2006
Custom Objects/Collections and Tiered Development
http://sholliday.spaces.live.com/
Some additional thoughts.
Make sure you do some locking with the Singleton.
Or abandon the Singleton thinking altogether.
How are you writing an Asp.Net singleton?
See
10/24/2005
Web Session Wrapper for storing and retrieving objects

Make sure you close your IDataReaders. Don't reuse connection objects.
It is less expensive to start a new connection object, then to tear one
down
and build it back up.

I'd take a deep look at the first blog entry above, and then read the
MS
article I mention at the bottom of that article.
On my blog, pay attention to the "SqlHelper is a substitute of your
application's data layer object".

I'd abandon a Singleton as a database class. Its more important to
Open LATE
Use quickly.
Close quickly.
Make sure you close and don't let connections linger. This is where I
think
youre singleton is probably screwing you.

"Guy Thornton" <wd****************@incresearch.comwrote in message
news:E7**********************************@microsof t.com...
I have an application in asp.net using vb.

The asp.net portion of this application is mainly the user interface.
The
UI has references made to our business logic layer. And the business
logic
layer uses a database class to access our data environment.

The business logic layer and database class is compiled into a class
library. The database class is a single class that contains all of
our
queries there. It is implemented following the Singleton pattern so
there
should only be 1 instance of the class.

The problem we are having is when multiple users start hitting the web
site,
we get very erratic errors to occur at different points within the
application. All errors are System.InvalidOperationException.
Invalid
attempt to read when reader is closed.

The application runs fine with 1 user on the system. So I know that
the
>code logic is ok. I am concerned that because I implemented a
Singleton
>database class, that all users in the system are trying to share that
1
class
instance.

Has anybody encountered this before?
Does anyone have any suggestions for me?

Some questions I would love to hear about are
1. When using class libraries, is a copy of the object model unique
only
at
the application level or at the session level?
2. Is there a way to specify at what level an object model may live
within
an asp.net app?

Any feedback someone may have would greatly be appreciated. We have
rather
hit a wall here and do not know how to continue.

Thanks.




Nov 9 '06 #5

My FireFox works ok with it. (No crashes).

Yeah, I gave up on IE also. I have FF open .. with my blog stuff, and is
the only thing I have in FF.

I just did a Windows Update yesterday, so ............ I'm as good as I can
get with IE.

Crazy stuff, crazy stuff.


"David" <da*****************@revilloc.REMOVETHIS.comwrot e in message
news:et**************@TK2MSFTNGP03.phx.gbl...
Ah, OK, but it still is a big problem.

It even fails on firefox, but at least I get a chance to read the page on
FF. I reading it on my laptop, which is on my knee and it gets really hot,
so I saved the page to my HD, removed the script at the top and can read
it.
(I could only do this in FF, IE crashed twice. I gave up with IE.).

Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available

"sloan" <sl***@ipass.netwrote in message
news:%2******************@TK2MSFTNGP03.phx.gbl...
That's something MS did.

Its a IE issue, some SP they released on August.

Its something along the lines of "http 1.1" in the IE advanced options.

I don't know, it does the same for me.

You'd think an msn space page would actually work with IE.


"David" <da*****************@revilloc.REMOVETHIS.comwrot e in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
I don't know what is on your site, but it crashed my internet explorer
twice
and firefox has high cpu usage and showing an apparent memory leak
(memory
usage constantly climbing)

Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available
"sloan" <sl***@ipass.netwrote in message
news:OE**************@TK2MSFTNGP02.phx.gbl...
You can check this article out:
5/24/2006
Custom Objects/Collections and Tiered Development
http://sholliday.spaces.live.com/
Some additional thoughts.
Make sure you do some locking with the Singleton.
Or abandon the Singleton thinking altogether.
How are you writing an Asp.Net singleton?
See
10/24/2005
Web Session Wrapper for storing and retrieving objects

Make sure you close your IDataReaders. Don't reuse connection
objects.
It is less expensive to start a new connection object, then to tear
one
down
and build it back up.

I'd take a deep look at the first blog entry above, and then read the
MS
article I mention at the bottom of that article.
On my blog, pay attention to the "SqlHelper is a substitute of your
application's data layer object".

I'd abandon a Singleton as a database class. Its more important to
Open LATE
Use quickly.
Close quickly.
Make sure you close and don't let connections linger. This is where
I
think
youre singleton is probably screwing you.

"Guy Thornton" <wd****************@incresearch.comwrote in message
news:E7**********************************@microsof t.com...
I have an application in asp.net using vb.

The asp.net portion of this application is mainly the user
interface.
The
UI has references made to our business logic layer. And the
business
logic
layer uses a database class to access our data environment.

The business logic layer and database class is compiled into a class
library. The database class is a single class that contains all of
our
queries there. It is implemented following the Singleton pattern so
there
should only be 1 instance of the class.

The problem we are having is when multiple users start hitting the
web
site,
we get very erratic errors to occur at different points within the
application. All errors are System.InvalidOperationException.
Invalid
attempt to read when reader is closed.

The application runs fine with 1 user on the system. So I know that
the
code logic is ok. I am concerned that because I implemented a
Singleton
database class, that all users in the system are trying to share
that
1
class
instance.

Has anybody encountered this before?
Does anyone have any suggestions for me?

Some questions I would love to hear about are
1. When using class libraries, is a copy of the object model unique
only
at
the application level or at the session level?
2. Is there a way to specify at what level an object model may live
within
an asp.net app?

Any feedback someone may have would greatly be appreciated. We have
rather
hit a wall here and do not know how to continue.

Thanks.





Nov 9 '06 #6
Sloan,

Thanks for the information, I am reviewing that now. I thought I would
write you back since you asked about how I implemented singleton in asp.net.

In my class library, as I mentioned, I have a database class that is my data
layer. In this class I have a private static variable that will hold the
single instance of the class.
So it would look something like this:

Public Class MyDatabaseClass
{
...
private static MyDatabaseClass dbInstance;
... //other private attributes

Public static MyDatabaseClass myDb()
{
if (dbInstance == null)
dbInstance = new MyDatabaseClass;
return dbInstance;
}
}

Everything else is implemented as instance methods or functions.

So now, elsewhere within the object model, this would be called as
MyDatabaseClass.mydb

I do agree with your assessment, however that the fact that I am using this
1 instance of a database layer is causing my problems.

Thanks for your help.
Guy.

"sloan" wrote:
You can check this article out:
5/24/2006
Custom Objects/Collections and Tiered Development
http://sholliday.spaces.live.com/
Some additional thoughts.
Make sure you do some locking with the Singleton.
Or abandon the Singleton thinking altogether.
How are you writing an Asp.Net singleton?
See
10/24/2005
Web Session Wrapper for storing and retrieving objects

Make sure you close your IDataReaders. Don't reuse connection objects.
It is less expensive to start a new connection object, then to tear one down
and build it back up.

I'd take a deep look at the first blog entry above, and then read the MS
article I mention at the bottom of that article.
On my blog, pay attention to the "SqlHelper is a substitute of your
application's data layer object".

I'd abandon a Singleton as a database class. Its more important to
Open LATE
Use quickly.
Close quickly.
Make sure you close and don't let connections linger. This is where I think
youre singleton is probably screwing you.

"Guy Thornton" <wd****************@incresearch.comwrote in message
news:E7**********************************@microsof t.com...
I have an application in asp.net using vb.

The asp.net portion of this application is mainly the user interface. The
UI has references made to our business logic layer. And the business
logic
layer uses a database class to access our data environment.

The business logic layer and database class is compiled into a class
library. The database class is a single class that contains all of our
queries there. It is implemented following the Singleton pattern so there
should only be 1 instance of the class.

The problem we are having is when multiple users start hitting the web
site,
we get very erratic errors to occur at different points within the
application. All errors are System.InvalidOperationException. Invalid
attempt to read when reader is closed.

The application runs fine with 1 user on the system. So I know that the
code logic is ok. I am concerned that because I implemented a Singleton
database class, that all users in the system are trying to share that 1
class
instance.

Has anybody encountered this before?
Does anyone have any suggestions for me?

Some questions I would love to hear about are
1. When using class libraries, is a copy of the object model unique only
at
the application level or at the session level?
2. Is there a way to specify at what level an object model may live
within
an asp.net app?

Any feedback someone may have would greatly be appreciated. We have
rather
hit a wall here and do not know how to continue.

Thanks.


Nov 9 '06 #7

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

Similar topics

7
by: Jack Addington | last post by:
I've got a fairly simple application implementation that over time is going to get a lot bigger. I'm really trying to implement it in a way that will facilitate the growth. I am first writing a...
25
by: Stuart Hilditch | last post by:
Hi all, I am hoping that someone with some experience developing nTier apps can give me some advice here. I am writing an nTier web app that began with a Data Access Layer (DAL), Business...
10
by: pcthug | last post by:
Hi All, I am creating multi-tier app in vb.net using visual studio .net. I create a invoice.vb class file with properties, events and methods. This also has a line item collection class...
12
by: Noel | last post by:
Hello, I'm currently developing a web service that retrieves data from an employee table. I would like to send and retrieve a custom employee class to/from the webservice. I have currently coded...
3
by: Smithers | last post by:
In Windows Forms MDI applications... I'm wondering if it is standard practice to create DAL and business objects as static classes. The only alternative (please enlighten me if I'm wrong about...
4
by: Tarun Mistry | last post by:
Hi all, I have posted this in both the c# and asp.net groups as it applies to both (apologies if it breaks some group rules). I am making a web app in asp.net using c#. This is the first fully OO...
0
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted...
3
by: waheed azad | last post by:
Hi, I have a been developing an accounting system for a non-profit organization. I had decided to to divide the solution, in three layers, presentation, business layer and database layer. ...
5
by: =?Utf-8?B?QkY=?= | last post by:
I want to improve the response time of my application. I have 3 options: 1. Run both ASPX pages and our business objects on web server and use web farm technology. 2. Move our business objects...
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: 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
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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.