mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-10-08 16:19:48 +00:00
`AbstractIdentityColumnMaxValueIncrementer` replaces its value cache and resets the cache index before it inserts into the sequence table. If an insert, the identity query, or the cleanup statement fails, the exception is propagated but the partially populated cache remains in place. The next call then serves values from that cache without accessing the database, so it may return `0` for slots that were never filled. This commit populates a local array and only exposes it once the entire range has been obtained and the cleanup statement has succeeded, so the next call after a failure refills the cache again. This aligns with the handling of a failed refill in `MySQLMaxValueIncrementer`. See gh-37322 Closes gh-37402 Signed-off-by: lejuho <52308082+lejuho@users.noreply.github.com>