-->
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.  [ 4 posts ] 
Author Message
 Post subject: "hibernate-configuration configSource" not working
PostPosted: Mon Aug 02, 2010 5:45 am 
Newbie

Joined: Mon Aug 02, 2010 5:31 am
Posts: 2
Hi,
I have a NT service that uses NHibernate. I have tried to move hibernate-configuration to a separate config file, just like this post describes:
https://forum.hibernate.org/viewtopic.php?f=25&t=1001876
but no luck, it doesn't work. Is this even possible under NHibernate when run under NT service?

My configs would be:
app.config
Code:
<hibernate-configuration configSource="hibernate.config"/>


hibernate.config
Code:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
    <session-factory>
      <property name="dialect">NHibernate.Dialect.Oracle10gDialectEx</property>
      <property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
      <property name="connection.driver_class">NHibernate.Driver.OracleClientDriver</property>
      <property name="connection.connection_string">Data Source=DATABASE;User ID=USER;Password=PASS;</property>
      <property name="show_sql">true</property>
      <property name='proxyfactory.factory_class'>NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle</property>
    </session-factory>
</hibernate-configuration>


Thank you for any ideas.

Zdeněk


Top
 Profile  
 
 Post subject: Re: "hibernate-configuration configSource" not working
PostPosted: Mon Aug 02, 2010 8:19 am 
Newbie

Joined: Mon Jul 26, 2010 2:25 am
Posts: 6
Hi,

Have you checked if your hibernate.config is present in the directory of the service?
The hibernate.config should have the Property 'Copy to Output Directory' set to 'Copy' or 'Copy if newer'

Regards


Top
 Profile  
 
 Post subject: Re: "hibernate-configuration configSource" not working
PostPosted: Mon Aug 02, 2010 11:02 am 
Newbie

Joined: Mon Aug 02, 2010 5:31 am
Posts: 2
Hi, thanks for your reply.

Yes, hibernate.config is in the directory of the service. I even tried copying it to System32 to no avail. I have checked if the file is being loaded using Filemon, and it indeed is read same as other external configs.

The difference between hibernate-configuration and other config sections is that hibernate-configuration uses a namespace (xmlns). Maybe this is preventing it from being used with configSource?

Can you confirm this is working for anyone? I'd hate spending so much time on this (and yours time too) if I don't even know if this can be done..

Thank you


Top
 Profile  
 
 Post subject: Re: "hibernate-configuration configSource" not working
PostPosted: Tue Aug 10, 2010 2:01 am 
Newbie

Joined: Mon Jul 26, 2010 2:25 am
Posts: 6
Hi,

I've changed my configuration to a separate config file as described in your link.
So far it works.


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