Software Engineer / Technical Architect working in the UK. on and around the Salesforce platform. Degree and interest in control and information engineering
A question for anyone using queryWithBinds() on Salesforce.
Database.query() has to be used in cursor mode if a subquery has more than 200 records, otherwise you are left with a dangling cursor exception reading the subquery after statement completion.
...
Today I did 50 climbs to raise money for Yorkshire Cancer Research and Diabetes UK.
Total climb between 500m and 750m (as big as one of our local mountains). Time about 6 hours.
https://t.co/XtR8NkEwhL
@FishOfPrey@PhilW_SF Got to love your comment "Bad developer bad!"
I have in capital letters in mine "THIS MUST NEVER EVER BE USED IN PRODUCTION CODE!"
I found I could demo basic races without needing the delay given 10 threads.
Ouch! I'm writing demos to present on locking in Salesforce and thought I'd use a "publish immediately" platform event for locking.
Firing platform events breaks locks!!!!
Here the demo with logging inline, and again with logging delayed until end of execution.
@FishOfPrey@PhilW_SF Thanks a lot.
I didn't know if I could publish code I'd developed as part of my work, so glad you made some.
I was wondering whether to raise a case, but this way you've got direct knowledge of the problem.
@FishOfPrey@PhilW_SF My comment hints at another possible issue. Things were stopping dead in their tracks when I exceeded a field width on a text field in the platform event definition.
@FishOfPrey@PhilW_SF Here's the code as it finally stood. This is not production code! (It was quick demos of locking patterns for a seminar on locking). The original called publish() immediately rather than storing things up.
@PhilW_SF Drat - it was a typo when I was writing the log code. I thought I'd corrected it. Maybe that was an old screenshot. I'm using FOR UPDATE. Dunno where I got the ACCESS idea from.
@PhilW_SF My workaround has been to batch up events and fire them at the end of the transaction. I then reconstruct the order on the client from the timestamps.
@PhilW_SF So I use Platform Events in "Fire Immediately" mode. The allows me to stream debugging information to the front end.
What I'm seeing is that firing the event causes the FOR ACCESS lock to be dropped, but not a DML UPDATE lock.