mirror of
https://github.com/google/nomulus.git
synced 2025-07-30 22:46:26 +02:00
We can handle it the same way that we handle UpdateAutoTimestamp, where we simply populate it in SQL if it doesn't exist. This has the following benefits: 1. The converter is unnecessary code 2. We get non-null column definitions for free (overridden in EppResource to allow null creation times so that legacy *History objects can contain null in that field 3. More importantly, this allows us for proper SQL->DS replay. If the field is filled out using a converter (as before this PR) then the field is only actually filled out on transaction commit (rather than when the write occurs within the transaction). This means that when we serialize the Transaction object during the transaction (the data that gets replayed to Datastore), we are crucially missing the creation time. If the creation time is written on commit, we have to start a new transaction to write the Transaction object, and it's an absolute necessity that the record of the transaction be included in the transaction itself so as to avoid situations where the transaction succeeds but the record fails. If the field is filled out in a @PrePersist method, crucially that occurs on the object write itself (before transaction commit). |
||
---|---|---|
.. | ||
gradle/dependency-locks | ||
src | ||
build.gradle | ||
Dockerfile |