0

My application uses Nhibernate and Fluent Hibernate Mapping. In the Live Production no persister for Exception is coming while saving the entity in the datbase. The Application uses multiple database and ISession is used to set the databases context before giving call to database tables. how can i reproduce the persister for exception at my local enviroment?

Asghar
  • 1
  • 1
    Do you want a NHibernate persister for a XYZException class? Or are you getting a `NHibernate.MappingException: No persister for: XYZClass`? – rae1 Dec 05 '13 at 17:56
  • Getting an NHibernate.MappingException: No persister for: XYZClass when saving a entity. – Asghar Dec 06 '13 at 07:28

1 Answers1

0

If you are saying this works locally on your dev machine BUT does not work on your live server then this sounds like a classic web/app.config misconfiguartion.

Check that your config contains the correct mapping assembly.

<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
    <session-factory>
        ....
        <mapping assembly="Domain.Model" />
    </session-factory>
</hibernate-configuration>

Double check then check again the configuration is correct.

Rippo
  • 22,117
  • 14
  • 78
  • 117
  • This exception comes when any Scheduled Job (which runs the WCF service) is executed and while saving the data in the databases. Is it possible that the NHibernate.ISession is being changed to different database connection. Since the Application have multiple databases and due to the change in connection the persister for exception is coming? If the above scenerio is possible then how could i resolve it? – Asghar Dec 06 '13 at 16:56