MassIndexer not compatible with ORM multitenancy

Description

Environment

None

Activity

Show:
Yoseph Stephen
January 29, 2015, 2:32 AM

Below are simple testcase:

It shows the following logs:

I can assure it calls my implementation of CurrentTenantIdentifierResolver, to get the "public" tenant ID (because it runs on different thread, my CurrentTenantIdentifierResolver could not get the previous tenant ID, so it returns "public" as default). It should not call the CurrentTenantIdentifierResolver, since the session I'm passing to FullTextSession has already had an tenantIdentifier (see the logs).

Yoseph Stephen
January 29, 2015, 7:44 AM

Using InheritableThreadLocal as informed by darioc in https://forum.hibernate.org/viewtopic.php?f=9&t=1023896 does make the indexer running properly, BUT it creates another problem, since the tenantIdentifier can be switched on concurrent http request.

Yoseph Stephen
January 29, 2015, 7:51 AM

It happens both in 4x version and 5x version. Tested on: 4.5.3.Final and 5.0.1.Final

Davide D'Alto
January 30, 2015, 5:07 PM
Yoseph Stephen
January 30, 2015, 11:50 PM

Thank youuu

Assignee

Davide D'Alto

Reporter

Sanne Grinovero

Labels

None

Suitable for new contributors

None

Pull Request

None

Feedback Requested

None

Components

Fix versions

Priority

Major
Configure