Code 1: "I need this now" → Java commits it immediately
Code 2: "Store this when convenient" → Java might delay it for performance
Java tries to be efficient by delaying the actual write operation.
It's a tradeoff between performance optimization and immediate persistence → Java chooses performance by default, which is why you sometimes need to explicitly force the persistence.