-
Notifications
You must be signed in to change notification settings - Fork 43
Description
See here:
Lines 42 to 45 in 2c97da0
| public class SpannerServiceContributor implements ServiceContributor { | |
| private static final SpannerSchemaManagementTool SCHEMA_MANAGEMENT_TOOL = | |
| new SpannerSchemaManagementTool(); |
SpannerSchemaManagementTool is effectively a singleton, but it gets injected with information specific to the persistence unit. If it's reused across multiple persistence unit, it will only keep information about the last persistence unit to start, and schema management for the previous persistence units will not work correctly.
You can find more information on the kind of problems this leads to here: quarkusio/quarkus#24742
In order to solve this problem, SpannerServiceContributor should create one instance of SpannerSchemaManagementTool each time the service is initiated. That's what org.hibernate.tool.schema.internal.SchemaManagementToolInitiator, the default implementation, does.