-->
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.  [ 3 posts ] 
Author Message
 Post subject: Programatically setting Hibernate Search properties
PostPosted: Tue Oct 06, 2009 10:27 pm 
Newbie

Joined: Thu Aug 27, 2009 2:57 pm
Posts: 4
Using Spring 2.5, Tomcat 6.0.18, Hibernate Search Annotations. (version 3.1.x)

I am trying to programatically set some Hibernate Search properties. (Reason is to be able to use a single build process to build my war for both master and slave nodes).
For example, depending on the local ip address of the node, I would initialize the directory provider to either the slave or master directory provider.
I am using Spring 2.5 and was originally declaring my Hibernate sessionFactory as a bean of type AnnotationSessionFactoryBean.
Now I am trying to set the properties programatically by extending AnnotationSessionFactoryBean and overriding the setHibernateProperties method. All of this gets executed when I start the app, however the DirectoryProvider initialization process does not seem to run as normal.

I'm wondering if I am violating some order by setting the properties programatically when the sessionFactory is initialized.
I realize this is probably a little confusing but can provide more information if anyone has any knowledge in this area that they can share.


Top
 Profile  
 
 Post subject: Re: Programatically setting Hibernate Search properties
PostPosted: Wed Oct 07, 2009 12:28 pm 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
Some code would be helpful here ;-)


Top
 Profile  
 
 Post subject: Re: Programatically setting Hibernate Search properties
PostPosted: Thu Oct 08, 2009 10:40 am 
Newbie

Joined: Thu Aug 27, 2009 2:57 pm
Posts: 4
I actually got this to work. Was a configuration problem on my behalf.
By simply extending AnnotationSessionFactoryBean, I am setting hibernateProperties programatically rather than via applicationContext.xml

Thanks


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.