I can't think of any obvious gotchas. If you've got an example that consistently fails, then it'll probably help to see the code. Probably best to create a JIRA and upload a zip there.
From: James Crowley Sent: Friday, April 23, 2010 1:33 PM To: [email protected] Subject: Re: [nhibernate-development] Re: [nhusers] Thread safety problem in QueryParameters.PrepareParameterTypes ? Hi Richard, Currently at 4971, one off the trunk revision. The sessions have different IDs across the two threads, so I figure that's out. Is there any other obvious gotcha's I should rule out first? I'm kinda mystified at the moment, but it's doing it really consistently... so hopefully will get there. James On 23 April 2010 13:19, Richard Brown (gmail) <[email protected]> wrote: Hi James, Can you confirm which version of the code you're looking at? (trunk? revision?) In addition, I would also have thought all the variables in that method are local to the session too ... is there any chance you've shared the session across more than one thread? It would be great if you could reproduce this in a test case, but I realise the difficulties of trying to create test cases for multi-threaded scenarios. Cheers, Richard From: James Crowley Sent: Friday, April 23, 2010 1:09 PM To: [email protected] ; [email protected] Subject: [nhusers] Thread safety problem in QueryParameters.PrepareParameterTypes ? Hi guys, Are you aware of a threading issue within QueryParameters.PrepareParameterTypes? I've got two threads (operating over different sessions) that, when run starting from the same execution point at the start of the PrepareParameterTypes method. All works fine when the other thread is frozen, but when both are run at the same time, there are issues with the parameter locations. It's something to do with here: while ((location < sqlParameters.Count) && (sqlParameters[location].ParameterPosition != null)) location++; in that this can actually result in location being equal to sqlParameters.Count (and later having an IndexOutOfRange exception being thrown). However, it's only happening because ParameterPosition is unexpectedly set. Still trying to figure out how, as all I can see are local variables right now. I'm still trying to pin this down exactly, but wanted to check if you were already aware of not? Thanks, James -- 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. -- --- James Crowley CEO, developerFusion - the global developer community - http://www.developerfusion.com/ CTO, TechEye - all the technology news unfit for print - http://www.techeye.net/ linkedin: http://linkedin.com/in/jamescrowley twitter: http://twitter.com/jamescrowley
