• adam smith 112
  • NEWBIE
  • -1 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
Hi All,

We've setup a reasonably straightforward Apex Class that's running via a Lightning Component. Happy to share the code, eventually, but we seem to have narrowed down the specific scope of our problem... and we're stumped.

When we run our code and attach a debug/trace... It works correctly. All logic performs desirably.

When we run our code without a debug/trace... It performs incorrectly. We're not hitting errors, but our hypothesis is that collections that should have had, say, 3 items in them (when the code works properly, and/or when we attach a debug log/trace) may only contain 1 when we don't do the debug.

Does the problem we're describing above sound familiar to anyone? Our suspicion is that the debug logs / traces are either slowing down the code execution (in a way that's desirable for our code...) or holding onto simple collection variables in a way that they normally wouldn't.

Nothing makes sense, but it is repeatable. 

We're dealing with ~100 lines of Apex, 3 DML statements, and all code is properly bulkified. No callouts. Nothing asynchronous. Just vanilla.

When we run it with Debugs, it works fine; when we run it without debugs, it works incorrectly.

Any thoughts?