You need to sign in to do that
Don't have an account?

Static class in memory
Hi
I'm wondering if it is possible to write a class that once a single instance is created it will be stored in memory, or the only way to achieve persistence between different execution threads is through the database?
Many thanks
Kruvi
Probably sObject.
All Answers
APEX Classes will stay resident in memory for the duration of your execution. Once your execution has completed - it will shut down.
If there are variables or something that you want to stay resident - you'd have to go the sObject or Custom Settings route.
-Andy
Thank you Andy
I need to maintain a queue which is being filled by a trigger and dequeued by some other process that sends a callout.
What do you recommend, Custom settings or sObject?
Thanks a lot
Probably sObject.