-->
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: Multi-Tenancy with automatic schema creation (hbm2ddl)
PostPosted: Tue Mar 26, 2013 8:21 am 
Newbie

Joined: Tue Feb 19, 2008 6:48 am
Posts: 17
Hello everyone.

I'm trying to configure my Spring Session Factory with hibernate 4 multi-tenancy option, however i'm stuck is this error on the schema automatic creation:

Code:
ERROR: org.hibernate.tool.hbm2ddl.SchemaExport - HHH000231: Schema export unsuccessful
java.lang.NullPointerException
   at org.hibernate.tool.hbm2ddl.SuppliedConnectionProviderConnectionHelper.prepare(SuppliedConnectionProviderConnectionHelper.java:51)
   at org.hibernate.tool.hbm2ddl.DatabaseExporter.<init>(DatabaseExporter.java:52)
   at org.hibernate.tool.hbm2ddl.SchemaExport.execute(SchemaExport.java:367)
   at org.hibernate.tool.hbm2ddl.SchemaExport.create(SchemaExport.java:304)
   at org.hibernate.tool.hbm2ddl.SchemaExport.create(SchemaExport.java:293)
   at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:498)


This is my configuration:

Code:
   <bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean" depends-on="dataSourceHolder">
      <property name="dataSource" ref="dataSource1"/>
      <property name="hibernateProperties">
         <props>
             <prop key="hibernate.dialect">org.hibernate.dialect.HSQLDialect</prop>
             <prop key="hibernate.hbm2ddl.auto">create-drop</prop>
            <prop key="hibernate.show_sql">true</prop>
            <prop key="hibernate.cache.provider_class">org.hibernate.cache.HashtableCacheProvider</prop>
            
            <prop key="hibernate.multiTenancy">SCHEMA</prop>
            <prop key="hibernate.multi_tenant_connection_provider">org.springframework.webflow.samples.booking.SampleMultiTenantConnectionProvider</prop>
            <prop key="hibernate.tenant_identifier_resolver">org.springframework.webflow.samples.booking.SampleCurrentTenantIdentifierResolver</prop>
         </props>
      </property>
   </bean>
      
   <bean id="dataSource1" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
      <property name="driverClassName" value="org.hsqldb.jdbcDriver" />
      <property name="url" value="jdbc:hsqldb:mem:booking1" />
      <property name="username" value="sa" />
      <property name="password" value="" />
   </bean>   
   <bean id="dataSource2" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
      <property name="driverClassName" value="org.hsqldb.jdbcDriver" />
      <property name="url" value="jdbc:hsqldb:mem:booking2" />
      <property name="username" value="sa" />
      <property name="password" value="" />
   </bean>


Does anyone knows if the hbm2ddl.auto option can be used with multi-tenancy hibernate option?

Thanks in advance!

Best regards

João Simas


Top
 Profile  
 
 Post subject: Re: Multi-Tenancy with automatic schema creation (hbm2ddl)
PostPosted: Tue Apr 16, 2013 9:40 am 
Newbie

Joined: Tue Oct 14, 2008 3:08 pm
Posts: 8
Location: Brasil
This may be related:

https://hibernate.atlassian.net/browse/HHH-7389

_________________
Bruno Medeiros


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.