Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6937789
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:24:34+00:00 2026-05-27T12:24:34+00:00

We’ve created a Datasnap service (with Delphi XE), using Bob Swart’s white paper as

  • 0

We’ve created a Datasnap service (with Delphi XE), using Bob Swart’s white paper as a guide. It works fine, and we’ve deployed it to our test server.

Now a problem occurs, when we have executed a large number of requests (through JMeter), some sort of memory corruption occurs. Some requests succeed, some fail with an access violation. In the end, it has become so corrupt, that every request to our OWN (not the DSAdmin) methods responds with an access violation.

However, I can’t get my hands on a stacktrace to get more info, because the exception is already catched in the processing of the request.

If I test heavily with the VCL version of this application, it remains working correctly.

Has anyone any clue what this could be, or experienced the same problem, or can you help me get the stack trace from a caught exception (in someone else’s code, which I can’t edit)?

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T12:24:35+00:00Added an answer on May 27, 2026 at 12:24 pm

    To log both caught and uncaught exceptions using JEDI JCL, you should install the JEDI JCL.

    Then try some code like this code taken from jcl\examples\windows\debug\framestrack\FramesTrackDemoMain.pas:

    You should compile with full Debug information on in both the Compiler and Linker options in your delphi project options, for this to work.

    Note that you don’t have to call LogException, it’s called automatically one you’ve added the exception notifier callback (JclAddExceptNotifier). don’t forget to also call JclRemoveExceptNotifier, when the form or data module you are adding it from is destroyed, as shown here:

    procedure TForm1.LogException(ExceptObj: TObject; ExceptAddr: Pointer; IsOS: Boolean);
    var
      TmpS: string;
      ModInfo: TJclLocationInfo;
      I: Integer;
      ExceptionHandled: Boolean;
      HandlerLocation: Pointer;
      ExceptFrame: TJclExceptFrame;
    
    begin
      TmpS := 'Exception ' + ExceptObj.ClassName;
      if ExceptObj is Exception then
        TmpS := TmpS + ': ' + Exception(ExceptObj).Message;
      if IsOS then
        TmpS := TmpS + ' (OS Exception)';
      mmLog.Lines.Add(TmpS);
      ModInfo := GetLocationInfo(ExceptAddr);
      mmLog.Lines.Add(Format(
        '  Exception occured at $%p (Module "%s", Procedure "%s", Unit "%s", Line %d)',
        [ModInfo.Address,
         ModInfo.UnitName,
         ModInfo.ProcedureName,
         ModInfo.SourceName,
         ModInfo.LineNumber]));
      if stExceptFrame in JclStackTrackingOptions then
      begin
        mmLog.Lines.Add('  Except frame-dump:');
        I := 0;
        ExceptionHandled := False;
        while (chkShowAllFrames.Checked or not ExceptionHandled) and
          (I < JclLastExceptFrameList.Count) do
        begin
          ExceptFrame := JclLastExceptFrameList.Items[I];
          ExceptionHandled := ExceptFrame.HandlerInfo(ExceptObj, HandlerLocation);
          if (ExceptFrame.FrameKind = efkFinally) or
              (ExceptFrame.FrameKind = efkUnknown) or
              not ExceptionHandled then
            HandlerLocation := ExceptFrame.CodeLocation;
          ModInfo := GetLocationInfo(HandlerLocation);
          TmpS := Format(
            '    Frame at $%p (type: %s',
            [ExceptFrame.ExcFrame,
             GetEnumName(TypeInfo(TExceptFrameKind), Ord(ExceptFrame.FrameKind))]);
          if ExceptionHandled then
            TmpS := TmpS + ', handles exception)'
          else
            TmpS := TmpS + ')';
          mmLog.Lines.Add(TmpS);
          if ExceptionHandled then
            mmLog.Lines.Add(Format(
              '      Handler at $%p',
              [HandlerLocation]))
          else
            mmLog.Lines.Add(Format(
              '      Code at $%p',
              [HandlerLocation]));
          mmLog.Lines.Add(Format(
            '      Module "%s", Procedure "%s", Unit "%s", Line %d',
            [ModInfo.UnitName,
             ModInfo.ProcedureName,
             ModInfo.SourceName,
             ModInfo.LineNumber]));
          Inc(I);
        end;
      end;
      mmLog.Lines.Add('');
    end;
    
    
    procedure TForm1.FormCreate(Sender: TObject);
    begin
      JclAddExceptNotifier(Form1.LogException);
    end;
    
    procedure TForm1.FormDestroy(Sender: TObject);
    begin
      JclRemoveExceptNotifier(Form1.LogException);
    end;
    

    This is the usual initialization code:

    initialization
    
      JclStackTrackingOptions := JclStackTrackingOptions + [stExceptFrame];
      JclStartExceptionTracking;
    

    Here’s the JCL FramesTrackExample.dproj demo running:

    enter image description here

    For your purposes, change the code that adds a line to TMemo.Lines, to write to a log file on disk instead. If you already have a logging system, that’s great, and if not, then consider Log4D.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We're building an app, our first using Rails 3, and we're having to build
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am reading a book about Javascript and jQuery and using one of the
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have thousands of HTML files to process using Groovy/Java and I need to
I am using Paperclip to handle profile photo uploads in my app. They upload

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.