how long does the session lives and value stays al...
# ask-stanley-ai
t
how long does the session lives and value stays alive if we using runtime session set, in case of an MR script
c
AI generated answer (using internal Slack threads):
In the context of a Map/Reduce (MR) script in NetSuite, the runtime session set (
runtime.Session.set()
) is used to store data temporarily during the execution of the script. However, the session data does not persist across different stages of the MR script. This means that the session data gets reset at the beginning of each stage (i.e.,
getInputData
,
map
,
reduce
,
summarize
). As for the lifespan of the session, it is tied to the execution of the MR script. The MR script has a maximum execution time of 60 minutes before it has to yield to other processes. This means that the session data can live up to 60 minutes, provided that the MR script is still running and has not moved to a new stage. However, it's important to note that the order of processing in the
map
and
reduce
stages is not guaranteed, which can affect the use of session data if the data needs to be processed in a specific order. If you need to store and update a global object throughout the execution of the MR script, you might need to consider other approaches, such as using a Scheduled script to hold the data in memory, or storing the data in a custom record or a file. But these approaches come with their own limitations and considerations. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.804398537
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.796732306
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.785324931
Please provide your feedback on this answer.
Thank you for your feedback