Solved

Service App Shutting down

Posted on 2004-10-04
6
172 Views
Last Modified: 2010-04-05
I have created a service application using svCom and the code from Directory Monitor, using Delphi 6.  It monitors changes to a directory tree and updates a full text search index.  The directory monitoring seems to work ok. When the indexing fires off (based on a timer), the service shuts down - but only on some machines.

svCom allows me to run it in a debugger, but when I do that, it runs ok.  When I run it as a true service on my development machine, it's ok.  But when I run it on my server, it occasionally works, but most often shuts down.  No error messages, since it's a service app.

How do I debug this thing?  Is there anyone who is familiar enough with these components and is willing to debug my code?  I'm happy to send along all the source and the text indexing dll.
0
Comment
Question by:bjones8888
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 13

Expert Comment

by:BlackTigerX
ID: 12218010
use log files, trap the exceptions as (in the main procedures):

try
except
  on E:Exception do
    WriteToErrorLog('Error in procedure X:'+E.Message)
end

for your internal procedures (and critical code), just do something like (these populate back to the main procedures, which write the full error to the log file):

try
except
  on E:Exception do
    raise Exception.Create('Error in process Y:'+E.Message)
end

that way you will gather very detailed errors and where exactly it ocurred
0
 
LVL 12

Expert Comment

by:esoftbg
ID: 12218350
0
 
LVL 17

Expert Comment

by:Wim ten Brink
ID: 12218592
Just a wild guess... But I've been lucky at wild guesses. ;-)

I think it's a timer issue. I think the computers that crash the server respond to slow when the timer triggers. Perhaps it triggers too soon or not at all.

And of course, use lots and lots of logging. With services, WriteLn is your best friend.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 12

Accepted Solution

by:
Lee_Nover earned 500 total points
ID: 12219150
delphi's service implementation automaticaly logs exception in the Event log - can't remember if SvCom has this
I never liked SvCom anyway .. tried it once and had nothing but problems
instead of a normal timer use a threaded timer .. there are lots of those out there :) <- try this first :)
otherwise set the ExceptProc to your exception proc and handle the _unhandled_ exceptions there :)
0
 
LVL 12

Expert Comment

by:Ivanov_G
ID: 12221695
as Lee Nover said, Windows Services' events are written in Event Log

Start / Settings / Control Panel / Administrative Tools / Event Viewer
0
 

Author Comment

by:bjones8888
ID: 12385276
Lee -- Thanks for the tips.  The event log and the other types of timers led me to the solution.  In this particular case, I broke the service down to the smallest necessary parts (only the directory monitor and the timer) and had it call a second program for the index updates.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Delphi selector screen 2 97
CheckListBox usage 3 97
Delphi problems to abort a printjob 9 49
How to Get Images From Server to Client using App Tethering 1 57
A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question