PDA

View Full Version : Possible bug with Spring.Data.NHibernate12 version 1.1.1?



mmwaikar
04-23-2008, 03:58 PM
Hi,

I have a below unit test -


[Test]
public void CanFindPriorityOfAJob() {

using (new SessionScope(_dao.SessionFactory, true)) {
Job job = _dao.FindById(1000001);
Assert.IsNotNull(job, "job cannot be null");
Assert.IsNotNull(job.JobPriority, "job priority cannot be null");
Assert.IsTrue(job.JobPriority.Id == 3, "priority id value must match");
}
}

When I run it using the Spring version 1.1.0.2 (and NHibernate 1.2.0), this test succeeds, but when I run the same test using version 1.1.1 (with NHibernate 1.2.1), it gives me the following error - System.NotImplementedException : you need to override this method to resolve an IInterceptor instance

Please let me know.

Mark Pollack
04-23-2008, 09:14 PM
Hi,

This is a bug introduced by fixing SPRNET-785 (http://jira.springframework.org/browse/SPRNET-785). A quick look suggests that the fix is to have the impl of ResolveEntityInterceptor() in SessionScopeSettings return null, but I'll look into it more.

Right now as a workaround, you will need to use another (longer) constructor for sessionscope, namely



new SessionScope(_dao.SessionFactory, null, true, FlushMode.Never, true) {

}


Thanks for reporting this. There is another bug that needs to be fixed in 1.1.1 so we'll be making a 1.1.2 this week (or next monday) and this will be in there.

Cheers,
Mark

Mark Pollack
04-24-2008, 09:56 PM
Hi,

I've made the fix. If you can pick up the latest daily build (i just kicked one off so wait a bit) and give it a while, that would be greatly appreciated.

Cheers,
Mark

mmwaikar
04-25-2008, 03:00 PM
Hi Mark,

First, I took the Spring.NET-20080423-2223 nightly snapshot build, but the test failed with this one. Then I took the Spring.NET-20080425-1026 build, and the test succeeds with this one.

Please check if this is the build I was supposed to test with.