Doh! That's bad news, - What is the preferred way to go, shall i simply use the trunk checkout of nh and go with it or is there high chance that other thinks are broken in the development version?
- How could i find out by which code part the error was fixed? - Will my testcase get integrated to the repository? Thanks nico. On Aug 16, 9:51 am, Hadi Eskandari <[email protected]> wrote: > Okay, I could reproduce the problem using release NH 2.1 but trying to > debug it using current version of NH (built from trunk) there's no > exception anymore and the test is passed. I'm not sure which change > set is related to this issue though. > > On Aug 14, 1:10 pm, nicco80 <[email protected]> wrote: > > > I posted an exception earlier to the nhusers group > > (http://groups.google.com/group/nhusers/browse_thread/thread/e9159d0de... > > ). > > It turned out that the problem is with the JetDriver, so i created a > > testcase as proposed by Tuna Toksoz. > > > The test fails with a NullReferenceException here (full code > > below): > > s.Delete("from Foo foo where foo.ModuleId = :Id", m.ModuleId, > > NHibernate.NHibernateUtil.Int32); > > > Two small modifications are needed to start it over with the > > JetTests.db initialized correctly: > > - Add this line just after the entities are added to the configuration > > in the JetTestBase class > > AddEntities(); > > //--> new: > > configuration.AddFile(Path.Combine("Entities","Foo.hbm.xml")); > > factory = configuration.BuildSessionFactory(); > > [...] > > > So the mappings are loaded correctly from the hbm.xml (make sure to > > set the 'always copy' flag of the file in the JetDriver.Tests project) > > > - Add the ANTLR3.DLL to the project references > > > Please Help! > > Many thanks Nico > > > If you want i can commit this to svn, however i don't have privileges > > yet. > > Here comes the test fixture: > > > using System; > > using System.Collections.Generic; > > using System.Text; > > using NUnit.Framework; > > using NHibernate.JetDriver.Tests.Entities; > > > namespace NHibernate.JetDriver.Tests > > { > > [TestFixture] > > public class JetHqlDeleteFixture : JetTestBase > > { > > public JetHqlDeleteFixture() > > : base(true) //auto create the tables... > > { > > } > > > [Test] > > public void HQLDelete() > > { > > object savedId; > > using (ISession s = SessionFactory.OpenSession()) > > using (ITransaction t = s.BeginTransaction()) > > { > > savedId = s.Save(new Foo > > { > > ModuleId = -1, > > Module = "bar" > > }); > > t.Commit(); > > } > > > using (ISession s = SessionFactory.OpenSession()) > > using (ITransaction t = s.BeginTransaction()) > > { > > var m = s.Get<Foo>(savedId); > > m.Module = "bar2"; > > t.Commit(); > > } > > > //delete using a HQL statement > > using (ISession s = SessionFactory.OpenSession()) > > using (ITransaction t = s.BeginTransaction()) > > { > > var m = s.Get<Foo>(savedId); > > > s.Delete("from Foo foo where foo.ModuleId = :Id", > > m.ModuleId, > > NHibernate.NHibernateUtil.Int32); > > > t.Commit(); > > } > > > using (ISession s = SessionFactory.OpenSession()) > > using (ITransaction t = s.BeginTransaction()) > > { > > s.CreateQuery("delete from Foo").ExecuteUpdate(); > > t.Commit(); > > } > > } > > } > > > } --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "NHibernate Contrib - Development Group" 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.ar/group/nhcdevs?hl=en -~----------~----~----~----~------~----~------~--~---
