Multi-Tenancy with Spring + Hibernate: “SessionFactory configured for multi-tenancy, but no tenant identifier specified”

前端 未结 6 1533
一个人的身影
一个人的身影 2020-12-13 20:58

In a Spring 3 application, I\'m trying to implement multi-tenancy via Hibernate 4\'s native MultiTenantConnectionProvider and CurrentTenantIdentifierResolver. I see that the

6条回答
  •  粉色の甜心
    2020-12-13 21:38

    Even though this might be an older topic, and the answer might be already taken care of. What I noticed is the following:

    In your define the class CurrentTenantIdentifierResolverImpl:

    public class CurrentTenantIdentifierResolverImpl implements CurrentTenantIdentifierResolver
    

    But in your config you reference MultiTenantIdentifierResolverImpl:

    com.afflatus.edu.thoth.context.MultiTenantIdentifierResolverImpl
    

    Just pointing this out because I did the same mistake today, after that it all worked like a charm.

提交回复
热议问题