Reconsider closing of ServiceRegistry instances

Description

Really this is a question of sharing registries. Initially I designed registries with the thought of allowing them to be shared. What I mean is this:

1 2 3 4 5 BootstrapServiceRegistry bsr = ...; StandardServiceRegistry ssr1 = new StandardServiceRegistryBuilder( bsr ).build(); StandardServiceRegistry ssr2 = new StandardServiceRegistryBuilder( bsr ).build();

The bsr registry instance gets reused, shared, as the parent of 2 other registries. The implication is that closing either ssr1 or ssr2 cannot automatically close bsr.

If we instead say that registries are not intended to be shared, then closing a registry could automatically "cascade" closing its parent. And further closing the SessionFactory could close its registry.

Environment

None

Status

Assignee

Steve Ebersole

Reporter

Steve Ebersole

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Priority

Major