-->
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: Set Index Base dir dynamically
PostPosted: Fri Mar 07, 2008 12:16 pm 
Newbie

Joined: Mon Aug 27, 2007 5:47 am
Posts: 7
I have implemented Hib search in our project. This project needs to be deployed in different environment.. i.e. production, development, testing etc..

I want to store the index in <tomcat_dir>/webapps/<app_name>/WEB-INF/index. This tomcat_dir is different in different environments. I want that value of "hibernate.search.default.indexBase" key be initialized dynamically at runtime.

How can i achieve this ? is there any way to set the index base dir programmatically at run-time ? because in hibernate configuration file i have to provide a static value of the dir path.

Thanks,
Bhavin


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 08, 2008 1:18 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Configuration conf = new Configuration().configure().setPropery(...,...).buildSessionFactory();

_________________
Emmanuel


Top
 Profile  
 
 Post subject: Re: Set Index Base dir dynamically
PostPosted: Tue Nov 03, 2009 6:39 pm 
Newbie

Joined: Tue Nov 03, 2009 3:36 pm
Posts: 1
Any hints for doing this when using JPA? I'm injecting the EntityManager thru the @PersistenceContext annotation rather than using the sessionFactory. My deployment will be via ear file so editing the persistence.xml to point to a different path for the indexes is not an optimum solution. I would prefer to read the info from an external properties file and make the setting on the fly.


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.