[hibernate-dev] Tuning ORM memory consumption [HHH-8682]

Sanne Grinovero sanne at hibernate.org
Thu Nov 14 10:24:07 EST 2013


On 14 November 2013 14:52, Steve Ebersole <steve at hibernate.org> wrote:
> Adding tenantIdentifier to persister is absolutely wrong.  Think of
> persisters as scoped to the SessionFactory while tenancy is per Session.

I get that, I'm not suggesting to add it to _the_ persister of that entity.
I'm proposing to create a new type which includes a pointer to the
Persister (the one shared across all tenants)
and a pointer to the tenantId.
Or as you might prefer, any other solution which "wraps up" multiple
frequently needed components in a reusable instance.

I'm not sure if the set of tenants can be enumerated (so that we would
create all combinations upfront), or if they should be cached
and created on demand. In this case it's probably not worth to make a
SessionFactory cache but there might be various
opportunities for reuse, for example when loading multiple instances
of the same type.

If this specific combination of data aggregation sounds too crazy, we
need to find other similar opportunities.

Sanne


More information about the hibernate-dev mailing list