Skip to main content
7 events
when toggle format what by license comment
Sep 2, 2013 at 20:14 comment added ipavlic You are right, that paragraph is not true and I was wrong. I've edited and corrected my mistake now. Yes, Apex and Java are very similar (it almost seems as if Salesforce translates Apex to Java in the background). With Java, one can also inspect the heap, choose garbage collection strategy, suggest garbage collection and use phantom, soft, weak or strong references - these all provide a way to control the heap (admittedly, indirectly).
Sep 2, 2013 at 19:59 history edited ipavlic CC BY-SA 3.0
corrected auto-insertion
Sep 2, 2013 at 12:21 comment added sfdcfox The last paragraph is confusing, then. "... it will automatically insert the related record ..." This was more a point of clarification. Also, Java and Apex Code have the same basic notion of heap, just one gives you control over heap size, one does not.
Sep 2, 2013 at 8:27 history edited ipavlic CC BY-SA 3.0
added a clarification for the insertion order
Sep 2, 2013 at 8:23 comment added ipavlic @sdfcfox I'm not sure I claimed that inserting the Contact first generates the Account. The fields provided in the foreign key reference (in this case Account) are used for finding the object and linking it to the object with a reference (in this case Contact). Those fields have to be either external IDs or indexed. Although one can check where objects point to, and unlike Java, there is no direct control over the heap - it's abstracted away from the user. I don't believe you can determine the exact point in time when the linking occurs, but I'd love to be corrected.
Sep 2, 2013 at 7:14 comment added sfdcfox Inserting cont first won't generate an account. You'll get an error. Heap isn't as abstract as you think. It's very easy for one to prove if X references the same heap memory as Y.
Jul 3, 2013 at 15:54 history answered ipavlic CC BY-SA 3.0