I have a Spring + Hibernate web app running with a Multi-Tenancy DATABASE strategy. My understanding is that each tenant gets its own database that is entirely independent of the other tenants' databases. However, I've noticed that the generated IDs for any given table "bleed" into other databases. That is, if the latest row in a table for customer 1 has ID 100, and a row is added to customer 2's corresponding table, customer 2's ID will be 101.
Is this the expected behavior, or have I misconfigured something? The annotations on my models are:
Code:
@GeneratedValue( generator = "increment" )
@GenericGenerator( name = "increment", strategy = "increment" )
I would use GenerationType.AUTO but then I get errors on classes that extend other classes.