-->
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: how can we integrate spring and hibernate ogm ?
PostPosted: Wed Sep 04, 2013 6:33 am 
Newbie

Joined: Wed Sep 04, 2013 6:29 am
Posts: 1
Please find below configuration
<bean id="sessionFactory"
class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
<property name="packagesToScan" value="com.example"></property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.transaction.factory_class">org.hibernate.engine.transaction.internal.jdbc.JdbcTransactionFactory</prop>
<prop key="hibernate.current_session_context_class">thread</prop>
<prop key="hibernate.ogm.datastore.provider">mongodb</prop>
<prop key="hibernate.ogm.datastore.grid_dialect">org.hibernate.ogm.dialect.mongodb.MongoDBDialect</prop>
<prop key="hibernate.ogm.mongodb.database">sravan</prop>
<prop key="hibernate.ogm.mongodb.host">127.0.0.1</prop>
<prop key="hibernate.ogm.mongodb.port">27017</prop>
</props>
</property>
</bean>
it is showing Connection cannot be null when 'hibernate.dialect' not set error. if i set hibernate.dialect to MongoDBDialect then it showing java.lang.InstantiationException: org.hibernate.ogm.dialect.mongodb.MongoDBDialect error.

Please help me.
Thanks in advance.


Top
 Profile  
 
 Post subject: Re: how can we integrate spring and hibernate ogm ?
PostPosted: Wed Sep 04, 2013 6:57 am 
Hibernate Team
Hibernate Team

Joined: Fri Sep 09, 2011 3:18 am
Posts: 295
Hi,
Spring is causing the error because no hibernate dialect has been set.
The dialects used by OGM is different form the dialect used by Hibernate because OGM works with NoSQL db. For this reason you cannot set the hibernate.dialect property to MongoDBDialect.

I'm not very familiar with Spring so this might be just a check that they are doing at startup.
You might try to set the variable to some valid dialect since it is using OGM underneath it is possible the it will work but, as far as I know, this kind of set up (Spring + OGM) has not been tested yet.

Anyway, any kind of feedback is very useful.
If you can also write a test case for this I will take a look at it


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.