Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DCOM Server Hanging 2

Status
Not open for further replies.

Yazster

Programmer
Sep 20, 2000
175
0
0
CA
Hi, I'm hoping someone can help me.

I have a 3 tier system, with the data services on a PC, all activeX exes accessed through DCOM.

Now for the most part, this works extremely well, and access speeds are very impressive (as opposed to a previous 2-tier implementation, where clients were accessing databases directly).

My problem is this: For some reason, one of my active-x servers occasionally hangs (2-3 times daily). I see it in the task manager, but it doesn't go away. When clients try to access the system, their systems hang. All I do is end the task, and everything is fine. I just don't see what could possibly causing this, since it usually works fine.

Has anyone over experienced this? Any ideas on what could be the problem?

Any help would be greatly appreciated.

Thanks,
Yazster
 
Yazster,
Sounds like an intermittent bug in the server code, could be a problem with accessing locked files or records too. Make sure each com server has an approroiate error handling routine, and an error log. Examining the error log may point you in the right direction.
 
Thanks for the advice Middian.

I had error checking, but no error log, so I've added that, hoping to id the problem.

One point of concern I have is when a user executes a large query. We have about 150 clients, and we figure that no more than 10 would be using our system at the same time.

It seems that when this happens, other users are unable to login, and after a long wait, I'm forced to end the server task in the task manager. After that, users can log in without a problem.

I was under the impression (from articles I've read on the topic), that DCOM automatically kills "dead" objects. We've had an instance that was executed, and the task remained in the task manager, locking everyone out. It never went away and had to be manually removed.

Under my server properties, the threading model is THREAD PER OBJECT.

Am I missing something?



 
if you have your servers writen in VB that makes complete sense.....well what is happening does.

VB is a single threaded application. If the application is doing a intensive procedure nothing else can happen at that point.

I don't suggest using VB ActiveX Exe's for server components for just that reason. If you put your classes in DLLs and put them under component services or MTS (depending on your server operating system) then each instance can have its own thread allowing concurrent usage. (this is setting the instancing to either multi use or global multi use.) You can do the same with EXE's but then you'll have up to 150 processes running on the server which isn't ideal.

Now if you are not writing everything in VB kinda ignore what I said and think about creating additional threads to do the intensive procedures.
 
My servers are written in VB.

Seems strange though. I've tested the system with three concurrent users running fairly large queries, and the system seems to pull results for all three users relatively at the same time. The query time is extended a bit more than usual, but the results are returned at the same time. However, on some occasions, the system seems to "hog" all resources for 1 user running a large query, and everyone else is out of luck.

The connection method is identical for all queries. So I don't see why one query would lock everyone out and other queries would be fine.

Unfortunately, I'm working in an environment where I don't have access to MTS. I'm using a desktop PC as a server. It's a decent machine but I'm concerned that as the amount of users grow, the system will not support the demand.

DCOM seemed like a nice solution, and for the most part, it's added tremendous value to our system. Before the use of DCOM, all users were connecting directly to the databases. Everything worked fine, but the query time was a bit long. When we converted to DCOM, the increase in speed was much better than expected. If it weren't for this one problem, everything would be great.

Thanks for all the help!
 
I've created an external ActiveX server which makes the call to the DCOM server. At any point, the user can select the CANCEL button and the worker thread will be killed. This solves the "impression" that the server is hanging. From the user perspective, much improved.

Problem is, the DCOM server still continues to run, even though the calling thread has been set to nothing. When the query is complete, the system waits for a timeout period, and eventually kills itself.

Is there any way to have the ActiveX server on the DCOM machine aware that the calling application no longer exists? I've read many postings stating that the DCOM server eventually realizes that the client no longer exists (approx 6-7 minutes), and kills itself. This is the case for our application, AS LONG AS THE QUERY IS FINISHED. If the user requested a long query (say, 10 minutes), the 6 minute timeout period only begins after the 10 minute query is complete. And as I've mentioned earlier in the thread, when users are running large queries, no other users are able to gain access to the server.

Any help would be greatly appreciated.
Yazster
 
Yazster,
The DCOM server will exit if the reference count on it goes to zero. For this to work you have to be careful to call release for each advise. The scenario you are describing ( server exiting after few minutes, which I think is actually 2 minutes) is not meant to be normal operation. This feature of COM is meant for the case where client dies. Since server has no way of knowing if client is still alive, it has to assume the client is dead if there is no activity from the client (this activity can be a simple ping). You should not rely on this com feature in your program, but rather take care that the reference count is always correct.
 
AliAndAli - Actually
[/quote]
feature of COM is meant for the case where client dies
[/quote]

is not for when the client dies it is for speeding up the creation of the object (Just in Time Activation). The default time to live is 3 minutes. COM can use UPD as a transport medium but it normally uses IP which is a connection base protocol that if the client does die the server will detect it.

I do agree that you need to (if coding in C) make sure and reduce the reference count each.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top