Database.queryWithBinds() does not support cursor mode.
Can this handle subqueries larger than 200?
1
2
15
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.
...
1
1
36
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.
justgiving.com/team/richard-…
27
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.
20
Replying to @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.
1
1
19
Replying to @FishOfPrey @PhilW_SF
Link to video demonstration (too long for Twitter)
photos.app.goo.gl/6ZWiHvEyN3…
1
1
14
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.
4
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.
1
9
Replying to @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.
1
14
Replying to @RichardSoftware @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.
1
30
Replying to @RichardSoftware @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.
3
2
65
Replying to @RichardSoftware @PhilW_SF
I wanted to show on the UI what was happening. I've demoed this in Java and Node enough times (and even C back in my uni days) with simple programs running in terminals accessing a database. It makes sense to show our developers this on Salesforce, so how to present it front end?
1
2
41
Replying to @PhilW_SF
I'm writing a demo to explain to developers here how locking works. My demo runs a simple Bean Counter in multiple queueable threads. There are multiple implementations of the counter from crude to more advanced. All of the counters include a wait to increase the chance of races.
1
1
45








