There will be a single grid dialect instance living in a standard service registry, while multiple session factories can be created from that. So I believe the contract SessionFactoryLifecycleAwareDialect is potentially dangerous because it allows to hold a dialect constant stated based on the initialization from one factory, which may be incorrect. In practice it's probably not a problem, but we should avoid the mixture of different scopes. |