Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


Using COM as an encapsulation object

Using COM as an encapsulation object

Using COM as an encapsulation object

I manage a pretty massive intranet system that currently uses session state to hold the majority of a user's permissions, group access lists, preferences, etc. In the beginning, that approach worked fine, but now, we are reaching the point where the tax on server memory is affecting performance.

So, my three-part question is:

a) Is a COM object the best way to encapsulate data for an ASP/SQL 2000 application (not yet migrated to .Net).

b) Is their a non-binary/non-DLL way to go about this?

c) If not COM, then what?

I am loosely basing this on the idea of enterprise Java beans, but it may not be a valid comparison. Thanks for any suggestions! I've only used a few third-party COM objects, so this will be a newbie scenario.

RE: Using COM as an encapsulation object

You have broken the fundamental rule of web scalability...you have made stateful objects (and seek to make stateful COM objects).

Your current approach to stateful objects are to place things in session.  As you are seeing, this doesn't scale.

You will have similar problems moving to stateful COM objects.

My recommendation, remove the state and put everything back in the database and query as you need it.  In that way, your database and your connection to the database will cache things as needed.  Especially if your database and web server are on the same box.

It sounds like JUST the wrong thing to do, performance wise, but it will give you the scalability you are looking for.


RE: Using COM as an encapsulation object

I appreciate where you're coming from, but don't necessarily agree. In the Java model, for example, enterprise Java beans and/or other class objects are used exactly for this purpose: Encapsulating data so that return trips to the database can be avoided. There are pros and cons on either side of the debate.

Given that a full application re-write is not an option, I am still seeking an OOD-type of solution that can replace just the session objects. That would be a much simpler endeavor than rebuilding the entire application architecture. I have thought about writing "stateful" xml files to a temp directory, which may be an option. Client-side cookies, however, are not.

RE: Using COM as an encapsulation object

If the database and webserver are on the same box then its kinda a moot point because then, at certain point, everything is getting cached in memory and disk.

However, if the database and webserver are on different servers then avoiding the round-trip is a cost-savings I will agree.

Writing COM components that read the information from the database and persist that information locally to XML files might be one way to go, assuming the data is relatively static (like profile information).  You could employ a simple read-through caching technique with a specified TTL (time to live) on the locally cached data.

In this way, you avoid the round-trip and still allow your COM components to be stateless (they get their state from the locally cached XML files).

Another consideration would be to deploy MSDE (Microsoft Data Engine...e.g. embedded SQL Server) on the WebServer and use it as the cache instead of XML.  The same approach to TTL and read-through would apply, and then you could choose as similiar a data model as you like when compared to the source system.


RE: Using COM as an encapsulation object

Thanks, TR. It is a rather convoluted mess, with some session data static, and other data dynamic (depending on verious user-based actions). All told, there are between 10-20 session objects per session. Many are not instantiated until certain tasks are performed, and some are immediately expired after certain multi-step tasks have been completed.

Also, SQL Server does reside on a separate box. I have considered just caching everything in a SQL temp table, but there again, you would have to hit the database on every page hit. That's what I'm trying to avoid.

I will Google for TTL-related tutorials -- good suggestion. If you happen to know of any good links, please post them here.

Thanks, again!

RE: Using COM as an encapsulation object

Hello all, I'm in a pretty similar position to runprn, having inherited a large, COM-based web app that has not yet migrated to .Net.  The existing programming team, who grew the app over 9 years, also violated the rule of web scalability, and made their COM objects stateful.

I was wondering if runprn found a solution, since I'm in a very similar position of not being able to re-write the code base, but the app must continue to work & function as we move eveything else over to .Net.  I'm curious if the 'stateful' xml files option was chosen, and how that's worked, and would greatly appreciate pointers on any examples/articles folks might have,

Thanks a lot!

Kiwi Kelley
Univ. of Auckland,
New Zealand

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close