0

I have been successfully using NHibernate, but now I am trying to move to Fluent NHibernate. I have created all of my mapping files and set up my session manager to use a Fluent Configuration. I then run my application and it runs successfully, but no data is returned.
There are no errors or any indication that there is a problem, but nothing runs.

when using NHibernate, if I don't set my hbm xml files as an embedded resource, this same thing happens. This makes me wonder what I have to set my Map classes to. Right now, they are just set to Compile, and they are compiled into the dll, which I can see by disassembling it.

Does anyone have any thoughts as to what may be happening here?

Thanks

private ISessionFactory GetSessionFactory()
        {
            return Fluently.Configure()
                .Database(
                    IfxOdbcConfiguration
                        .Informix1000
                        .ConnectionString("Provider=Ifxoledbc.2;Password=mypass;Persist Security Info=True;User ID=myuser;Data Source=mysource")
                        .Dialect<InformixDialect1000>()
                        .ProxyFactoryFactory<ProxyFactoryFactory>()
                        .Driver<OleDbDriver>()
                        .ShowSql()
                    )
                    .Mappings(
                        x => x.FluentMappings.AddFromAssembly(System.Reflection.Assembly.GetExecutingAssembly())
                        //.ExportTo("C:\\mappings")
                    )

                .BuildSessionFactory();
        }
6
  • Are proper SQL statements being executed against the database? What does the logging tell you? Commented May 21, 2010 at 13:28
  • I am not seeing any sql being executed. I have showsql set in my config, but there are no statements showing in my console. Commented May 21, 2010 at 13:32
  • Please post the code for your session manager's configuration. Commented May 21, 2010 at 13:37
  • When you say "no data is being returned", what are you actually executing that you expect data to be returned from? Commented May 21, 2010 at 13:42
  • 1
    I think I found part of the problem - I didn't have the scope of the mapping classes set to public. I added that in and now I am at least getting an error message. Commented May 21, 2010 at 14:06

2 Answers 2

1

Does the executing assembly contain the fluent mapping classes? I would try:

.Mappings(x => x.FluentMappings.AddFromAssemblyOf<MappedType>())

Where MappedType is a class that has a fluent mapping.

Sign up to request clarification or add additional context in comments.

Comments

0

They should just be set to compile, that's fine. Nothing special needed here. The problem is most likely in your fluent configuration rather than the mapping.

1 Comment

How can I figure out where the problem is if I am not receiving any error messages?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.