I've been reading the code, looking through other posts, and I was wondering if someone could clarify how / when variables tied to nodereferences are saved. They seem to save right at the the end, after all rules are evaluated. So, if I had two or three triggered rules that needed to updated a nodereferenced node, it would be best then to load that nodereferenced node once and then just update that variable with the other triggered rules (don't reload the nodereferenced node for each triggered rule).
In a sense, the variable space for nodereferences seems to be a sort of object cache (in the case of type node) that allows you to apply changes to that variable for the current running Drupal process. When all rules are done, the variables get actually saved to the db. Is that right? I don't see this in the doc anyplace.
Thanks for any help. Oh, Drupal 6.

Comments
Ganz korrekt
You're completely right about the node saving – all the saving of nodes (and other objects, I think) are postponed until all rules have been executed. This holds for nodes loaded directly as well as nodes loaded by node references.
In case you want to save a node while executing rules, there's an action "Save node" available (where I think you need to check the box to force immediate saving). As far as I know, this still won't save it directly, but only at the end of the rule being executed. Thus, any rules depending on the node being saved should/could be grouped in separate rules in a rule set.
This is a tricky subject. Usually you don't really care when nodes are saved – and having them saved only once is really good from a performance point of view – but when dealing with new nodes you sometimes need the NID. There are some more details about this in episode 9 of a Rules for Drupal 6 screencast I recorded some time ago. I hope it may be of help.
Good luck!
//Johan Falk
**
Learn Drupal with Nodeone! Drupal 7 introduction | The Views module | Learn Page manager! | Drupal configuration learning curve | Rules for Drupal 6 | Theming Drupal 6 | 49 Drupal 6 modules you should know
It might be good to add this
It might be good to add this to the doc or faq for rules. Something like:
Updating node referenced nodes
When loading and updating node referenced nodes, you must consider that each load action assigns that referenced node to its own variable object which will be saved when all rules are finished executing. If you want to update the same referenced node with multiple rules, you should only load the referenced node once and re-use its variable in your subsequent rules. If you load it more than once, your interim changes will be overwritten by the last instance of the variable to be saved.