VB COM+ Hanging

Status
Not open for further replies.

cplayer

Well-known member
1,405
I have a VB COM+ app that is hanging. It appears as if it's running fine but it isn't picking up it's items from its private queue.

Specs I can divulge:

VB COM+ App using MSMQ
Server Application
Unattended Execution & Retained in Memory are checked.

The app basically monitors its queue until something arrives then it grabs it and does something with it. What it doesn't do after a random amount of time it just doesn't do anything. Sits there running and not checking its queue. If I restart it it picks up everything and works fine for a while again.
 

kleel

Ars Scholae Palatinae
1,022
I admit I had to dig out my only MSMQ reference for this one and I'm just groping in the dark here.

that out the way.... does your code use the receive method of a MSMQQueue object?

does it set a timeout?

or is it along the lines of :
dim msg as MSMQMessage
do while true
set msg = q.recieve()
loop

That will process all the messages in a queue until it's empty then wait until more messages are sent.

A more involved method would be to use events which fire as soon as MSMQ finds a message in the queue.

HTH

Kleel
note: referenced Ted Patterson's "Programming Distributed apps with COM & VB" - a very, very good COM book
 
What I did when I did this was to use a C++ service to sit and look at the queue, then when something happened it created and called the VB object in MTS (which then pulled its stuff off the queue and did stuff with it).

This actually worked pretty well for me, but the app was sort of geared to being run in this stateless mode.

A couple of gotchas with MTS (or COM+ as it is now, I suppose - These might be out of date, but I don't think so)

- make sure you create everything you possibly can with your objectcontect.creatobject, just using createobject or new will make things break

- look at what the mts timeout is. Make sure your app is happy being timed out, if it can be timed out. If not, make sure it doesn't have any sort of timeout in it.
 
Status
Not open for further replies.