In a Spring 3 application, I\'m trying to implement multi-tenancy via Hibernate 4\'s native MultiTenantConnectionProvider and CurrentTenantIdentifierResolver. I see that the
As I explained in this article, Hibernate defines the CurrentTenantIdentifierResolver interface to help frameworks like Spring or Java EE to allow using the default Session instantiation mechanism (be it from an EntityManagerFactiry).
So, the CurrentTenantIdentifierResolver must be set via a configuration property which is exactly where you went wrong because you didn't supply the right fully-qualified class name. The CurrentTenantIdentifierResolver implementation being CurrentTenantIdentifierResolverImpl, the hibernate.tenant_identifier_resolver has to be:
com.afflatus.edu.thoth.context.CurrentTenantIdentifierResolverImpl
After you fix this, when the HibernateTransactionManager calls getSessionFactory().openSession(), Hibernate will use the CurrentTenantIdentifierResolverImpl to resolve the tenant identifier.