[hibernate-dev] Multitenancy Per Schema Fails With NPE

Steve Ebersole steve at hibernate.org
Mon Apr 27 06:59:09 EDT 2015


You are trying to use auto schema validation.  That is not yet supported
for multi-tenancy.  None of the auto schema tools are.  If you need to run
any of the schema tools, you will need to do so manually.

On Mon, Apr 27, 2015 at 12:35 AM, amit shah <amits.84 at gmail.com> wrote:

> I did log a blocker issue
> <https://hibernate.atlassian.net/browse/HHH-9740>on jira but to get a
> quick response I posted the issue here again.
> I do not see any traction on the jira issue, neither did stackoverflow or
> the IRC chat help out.
> Any help would be appreciated.
>
> Thanks !
>
> On Wed, Apr 22, 2015 at 7:18 PM, Steve Ebersole <steve at hibernate.org>
> wrote:
>
>> 1) This is a list for discussing the development of Hibernate itself, not
>> for discussing usage of Hibernate.  Please use the forums, StackOverflow,
>> or #hibernate IRC for user questions.
>>
>> 2) If this really leads to a NPE in *Hibernate* (not your code) trying to
>> open a connection, then that would be a bug.  If that is the case, please
>> open a Jira, and be sure to include (a) a test case and (b) the full stack
>> trace for the NPE.
>> On Apr 22, 2015 7:07 AM, "amit shah" <amits.84 at gmail.com> wrote:
>>
>>> I'm using schema based multi-tenancy providing implementations for both
>>> MultiTenantConnectionProvider & CurrentTenantIdentifierResolver. Trying
>>> to
>>> get a hibernate session for a single tenant fails with an NPE.
>>>
>>> Looking into the source code, it seems that JDBCServicesImpl initializes
>>> the connectionProvider to null in the else block
>>>
>>>         private JdbcConnectionAccess buildJdbcConnectionAccess(Map
>>> configValues) {
>>>                 final MultiTenancyStrategy multiTenancyStrategy =
>>> MultiTenancyStrategy.determineMultiTenancyStrategy( configValues );
>>>
>>>                 if ( MultiTenancyStrategy.NONE == multiTenancyStrategy )
>>> {
>>>                         connectionProvider = serviceRegistry.getService(
>>> ConnectionProvider.class );
>>>                         return new
>>> ConnectionProviderJdbcConnectionAccess( connectionProvider );
>>>                 }
>>>                 else {
>>>                         connectionProvider = null;
>>>                         final MultiTenantConnectionProvider
>>> multiTenantConnectionProvider =
>>> serviceRegistry.getService( MultiTenantConnectionProvider.class );
>>>                         return new
>>> MultiTenantConnectionProviderJdbcConnectionAccess(
>>> multiTenantConnectionProvider );
>>>                 }
>>>         }
>>>
>>> Please find the test case attached to the mail. I have also logged an
>>> issue
>>> <https://hibernate.atlassian.net/browse/HHH-9740>since it's blocking. Is
>>> there something basic that I am missing.
>>>
>>> Thanks,
>>> Amit.
>>>
>>> _______________________________________________
>>> hibernate-dev mailing list
>>> hibernate-dev at lists.jboss.org
>>> https://lists.jboss.org/mailman/listinfo/hibernate-dev
>>>
>>
>


More information about the hibernate-dev mailing list