views:

695

answers:

1

I have come across an issue with NHibernate.Search, where it all of a sudden stopped working, it cannot create files nor read the index-files at all.

NHibernate seems to load it correctly:

2009-01-20 17:37:17,751 [1] DEBUG NHibernate.Impl.SessionFactoryImpl   - 
  instantiating session factory with properties: {use_reflection_optimizer=True,
  hibernate.search.analyzer=Lucene.Net.Analysis.SimpleAnalyzer, Lucene.Net, 
  hibernate.search.default.directory_provider=NHibernate.Search.Store.FSDirectoryProvider, 
  NHibernate.Search, dialect=NHibernate.Dialect.PostgreSQL82Dialect, 
  connection.driver_class=NHibernate.Driver.NpgsqlDriver, 
  hibernate.search.default.indexBase.create=true, 
  hibernate.search.default.indexBase=c:\temp\Lucene, 
  connection.provider=NHibernate.Connection.DriverConnectionProvider, 
  connection.connection_string_name=Dev}

But after that, nothing seems to work. No files are created, and c:\temp\Lucene is never created either. I have checked the permissions and I can't seem to find anything wrong with it.

This has become a dead end to me, and have no clue on how to proceed in my debugging. Any feedback is very much appreciated.

Okay, updates:

I have figured out that FullTextIndexEventListener.Initialize(NHibernate.Cfg.Configuration cfg) is never invoked.

I assumed that when adding the listener to NHibernate configuration would trigger it (since it implements NHibernate.Event.IInitializable), but when checking the source for NHibernate this doesn't seem to be the case?

Odd thing is, that it works on my collegues dev-machine without this manual invokation. And we run the same source aswell as the same libraries.

+1  A: 

Okay, figured out that somehow, my machine has been speeding up the initialization-phase between ActiveRecord and NHibernate, meaning that since I register the EventListeners to NHibernate On_ApplicationStart(), NHibernate has already initialized, therefor never calling Initialize() in the listener.

On my collegues computer, NHibernate hasn't yet initialized when it registers the eventlisteners, therefor invoking Initialize.

This is somewhat a flaw in the ActiveRecord design, since I need to initialize AR before I can register something into NHibernate. Sort of like a catch 22.

Hopefully someone will find this info useful.

jishi