-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Hibernate 4 Muli tenancy Query
PostPosted: Tue Feb 04, 2014 7:19 am 
Newbie

Joined: Tue Feb 04, 2014 7:17 am
Posts: 4
I am using Hibernate 4.2 & EJB 3.0. I following the strategy outlined in https://docs.jboss.org/hibernate/core/4.2/devguide/en-US/html/ch16.html

Separate Schema approach.
I have added the following in my persistance.xml file

Code:
<property name="hibernate.multi_tenant_connection_provider"         value="com.lombardrisk.util.multitenancy.MultiTenantProvider" />

<property name="hibernate.tenant_identifier_resolver"
value="com.lombardrisk.util.multitenancy.SchemaResolver" />

<property name="hibernate.multiTenancy" value="SCHEMA" />


But for some reason it appears those 3 properties are completely ignored. I have tired commenting the properties - hibernate.multi_tenant_connection_provider & hibernate.tenant_identifier_resolver

(I was hoping to see an exception - since as per the documentation - It is an error to attempt to open a session without a tenant identifier using this strategy. Additionally, a org.hibernate.service.jdbc.connections.spi.MultiTenantConnectionProvider must be specified.)

http://stackoverflow.com/questions/19348477/multitenancy-with-hibernate-4-0-with-separate-schema-approach

The above link also points to the same problem - but does not explain how the problem was solved. Would appreciate if some one can point me to the right direction.

Note: I have also tried removing the classes MultiTenantProvider & SchemaResolver from my ear file and deployed the App in Jboss - but still there is no exception and the app always uses the default schema - so it looks like - those 3 properties are completely ignored in my persistance.xml

regards
D


Top
 Profile  
 
 Post subject: Re: Hibernate 4 Muli tenancy Query
PostPosted: Thu Feb 06, 2014 12:46 pm 
Newbie

Joined: Tue Feb 04, 2014 7:17 am
Posts: 4
Hi Ignore this query - apparently - Jboss 5 was using Hibernate 3 - where multi-tenancy is not supported.
I tried loading Hibernate 4+ along with my EAR but Jboss's Hibernate got loaded instead - so I have switched to Jboss 6 - which comes with Hibernate 4.2


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.