function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Rishav Dutta 12Rishav Dutta 12 

When does the Salesforce ID gets created? After Database Save or Database Commit?

This is more of a generic question. Actually main ask is when does record id gets streamed through Streaming API? After Database Save or after Database Commit? Can there be a scenario, where id gets created, id gets saved in DB, then some exception in SFDC and it gets rolled back and database commit doesn't happen.
Raj VakatiRaj Vakati
Record ids are generated on Save to database but the changes are limited only to the transaction so you can anytime rollback.

Commit; Commit is used to permanently save any transaaction into database and once strored, everyone knows, that can not be rolled back.