I'm using spring boot JPA 2.1.18.
All my model classes derives from this base class:
@Getter
@Setter
@MappedSuperclass
@EntityListeners(AuditingEntityListener.class)
public abstract class DbEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
protected Long id;
....
}
Everything works fine, but I'm facing a strange behaviour with the ids used for the new rows in the db ( I'm using SqlServer):
As you casn see, suddenly the ids jumped forward by 10000 and I don't understand why (it's impossible that the java code reserves 10000 ids, because I don't have batch processes). Any suggestions?

This is because of an option in SQL Server called IDENTITY_CACHE, take a look at this page from Microsoft which explains a bit more
https://learn.microsoft.com/en-us/sql/t-sql/statements/alter-database-scoped-configuration-transact-sql?view=sql-server-ver15
To disable it, run the below under your database
Note that this can have a performance penalty