mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-09-25 11:32:07 +00:00
* Throw exception on duplicate Database registration (#3838) DatabaseFactory.create() with register(true) previously returned the existing Database instance when another instance was already registered under the same name (added in #3759). This silently caused two independently created Database instances (e.g. with different DataSourceConfig.url values) to collide/share state, since the second "instance" was actually the first one in disguise. Change this to throw an IllegalStateException instead, forcing callers to either use a unique DatabaseConfig name or setRegister(false) when the Database is not intended to be registered/looked up by name. * Also handle deregistration on shutdown --------- Co-authored-by: robin.bygrave <robin.bygrave@eroad.com>