Replying to myself here. I've found a solution, the in memory DB gets
destroyed as the session is getting closed before I hit the
saveOrUpdate. So I'm assuming I'll have to use the same session to do
SchemaExport as I do for the test.

On Mar 2, 3:37 pm, Nic Pillinger <[email protected]> wrote:
> hi, just trying to get some integration tests setup to test mappings
> but having big problems with usingsqlitein memory. basically when it
> gets to the first part of the test it complains that the table doesn't
> exist.
>
> in order to track down the problem i've just built a sample app from
> the latest fluent nhibernate code and its doing the same thing. I have
> Test and TestMap classes in the same assembly, the code appears to do
> a drop/create with the correct table but on saveorupdate it complains
> that table Test does not exist.
>
> changing it to a file instead ofInMemorymakes it work.
>
> any help appreciated!
>
> thanks
> Nic
>
> class Program
>     {
>         static void Main(string[] args)
>         {
>             var sessionFactory = CreateSessionFactory();
>
>             using (var session = sessionFactory.OpenSession())
>             {
>                 var t = new Test() {Name = "blah"};
>                 session.SaveOrUpdate(t);
>             }
>
>         }
>
>         private static ISessionFactory CreateSessionFactory()
>         {
>             return Fluently.Configure()
>                 .Database(SQLiteConfiguration.Standard.InMemory
> ().ShowSql())
>                 .Mappings(m =>
>                     m.FluentMappings.AddFromAssemblyOf<Program>())
>                 .ExposeConfiguration(BuildSchema)
>                 .BuildSessionFactory();
>         }
>
>         private static void BuildSchema(Configuration config)
>         {
>             // this NHibernate tool takes a configuration (with
> mapping info in)
>             // and exports a database schema from it
>             new SchemaExport(config)
>                 .Create(true, true);
>         }
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Fluent NHibernate" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/fluent-nhibernate?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to