Richard Corfield (@RichardSoftware) profile picture

Software Engineer / Technical Architect working in the UK. on and around the Salesforce platform. Degree and interest in control and information engineering

Yorkshire, UK
Joined March 2023
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
Here's the Bean Counter. You _really_ don't want to know what's in Util.sleep() ;-)
1
23
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
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
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
The client is reconstructing event order from timestamps.
56
Yet locks held by DML do not seem to be affected. A test which performed an UPDATE then slept did result in locking exceptions as expected. Note that this code exhibits the race condition. My Node/Postgres demos didn't race all the time, but Apex is easy to make race conditions.
1
58
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.
2
1
7
524
I'll be doing an internal seminar on Salesforce concurrency. I have a pattern I call "Blind Write" after the "Blind" function on stage lighting desks. It allows the operator to set specific values without seeing the object (call it LightingState__c). But can I use that term here?
1
44
This is how I'm creating data. Quite simple. I could get nasty in a future iteration and add covariance or apply a transformation matrix to the results.
1
28
Now that's quite neat. I don't know whether it's used a decision boundary or some other means, but it does show things like false positive and false negative and allows me to adjust cost ratios.
1
1
31
I've limited it now to considering only the frequency band (formatted as a string to stop it treating it as a number, eg "7MHz") and hour of day. Its results are getting worse though. I wonder if it's just that I have so much variation from other variables.
1
14
I'm exploring Salesforce Einstein Discovery using data I understand (shortwave radio propagation using WSPR data). I know that the data varies by frequency and time of day. Getting Einstein to find this is taking some coercion.
1
1
59
Interesting to see generative AI summarisation creeping into everyday life. This example from Amazon.
1
32
I'm also using at using Refresh Tokens to support unattended access situations. The fairly new Named Credentials offer a big improvement on Remote Site Settings here. For example we can add authentication by certificate to the Refresh call to our server very easily.
1
2
150
My work on Session ID in Salesforce is coming on. This sample code (github.com/certinia/mdapi-oa…) uses an external server to handle a Web Flow. It's easier for the admin that way, offers the control they want and avoids key management problems with the JWT Bearer Solution.
3
6
1
22
2,096
That didn't work :-( So basically if you have a VF page open for more than the session timeout value then its calls back to the server will cease to function. Next idea - a reloadable iFrame tunnel? Though that would of course reduce system security.
1
13
I wonder how accurate that model is. We can see that if you pass 0 for the time things do run _very_ fast, modelled as "priority" here. What happens to those that don't pass a priority. Do they get a default time? With this simulation the "priority" jobs can starve the others.
1
31
Replying to @andyinthecloud
@andyinthecloud I've had a go at simulating the Queueable queue in Javascript so I can simulate our software behaviour running over it under various load conditions. My model is quite crude. I've assumed it will pull specified time jobs ahead of jobs that don't pass time
2
1
49