Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Service App Shutting down

Posted on 2004-10-04
6
Medium Priority
?
175 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
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 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 12

Accepted Solution

by:
Lee_Nover earned 1500 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Loops Section Overview
Suggested Courses

877 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