Sorry, I meant what the "solution" was :) When you find the issue, it is nice to submit a patch, but what is nicer is to explain what the patch is supposed to do. This will help to the commiter who is reviewing your page on determining what your aim was and validating your patch, therefore it will have a greater chance to be applied more quickly.
On the other hand, I personally don't think a test for this change is "ridiculous", as expected behaviors can be subjective but code is always objective, that's why a test is useful not only to verify but also to express expectations here. (and nearly in every where else) On Fri, Aug 14, 2009 at 11:09 AM, Stefan Steinegger < [email protected]> wrote: > > I explain the problem we encountered in the issue. The patch is > intended to fix it :-) > > I don't know how to write a sensible test for this. Of course I can > create two NativeSQLQuerySpecification instances with the same sql > string and different instances of querySpaces, and show that Equals > returns false. But this is ridiculous. It obviously returns false. > Because it is obviously implemented to return false if the querySpaces > are different instances. We still don't know if this is intended. At > the end I can only test that after performing a native sql query > thousands of times, the creation of the query could suddenly take a > lot of time. This is not something that could be tested in a unit > test. > > But is it worth the effort? Look at the code and you see that it is > obviously wrong: > > NativeSQLQuerySpecification.cs, Line 74: > CollectionHelper.CollectionEquals(querySpaces, that.querySpaces) && > querySpaces.Equals(that.querySpaces) && > > On 14 Aug., 09:57, Sidar Ok <[email protected]> wrote: > > Would you mind a sentence of explanation on what the problem was and what > > this patch is intended to achieve ? (As I don't see any tests there) > > > > On Fri, Aug 14, 2009 at 9:54 AM, Stefan Steinegger < > > > > > > > > [email protected]> wrote: > > > > > We found the problem, I posted a patch: > > > > >http://nhjira.koah.net/browse/NH-1931 > > > > > On 7 Aug., 10:15, Stefan Steinegger <[email protected]> > > > wrote: > > > > Currently we are doing long running tests on our system. After a > > > > couple or hours, the system suddenly hangs on a call to the NH > > > > session. I don't know if this is a NH problem, application problem or > > > > SQL server problem. > > > > > > Code looks like this: > > > > > > logger.Debug("A"); > > > > session.Flush() > > > > logger.Debug("B") > > > > > > query = session.CreateQuery("select id from X where BusinessId > > > > = :businessId"); > > > > query.SetGuid("businessId", businessId); > > > > > > logger.Debug("C") > > > > result = query.UniqueResult<long>(); > > > > logger.Debug("D") > > > > > > Against any expectation, the application hangs between log message B > > > > and C. > > > > > > - It takes a few minutes until 15 minutes (!) until the application > > > > proceeds. > > > > - Calls are coming in every 4 sec. (during the whole long running > > > > test) > > > > - After the first call hangs at this point, all subsequent calls are > > > > waiting at the same point, as if there was a lock. > > > > - CPU is on 50-60% during this time. The CPU is used by our server, > > > > not the DB. > > > > - Normally, CPU is very low during the test. > > > > - No other threads are doing anything special, except of the new > calls > > > > coming in. > > > > - It hangs always on this point, never somewhere else. > > > > > > I can't explain this at all. Any help to find this problem is highly > > > > appreciated. > > > > -- > > Sidar Ok > > > > http://www.sidarok.comhttp://www.twitter.com/sidarok > > > -- Sidar Ok http://www.sidarok.com http://www.twitter.com/sidarok --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "nhusers" 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/nhusers?hl=en -~----------~----~----~----~------~----~------~--~---
