Fredrik Forssen - 21 - Jan 8, 2015

I’m having some strange problems with async OrmLite for Sql Server in the latest version and I was wondering if anyone else has seen something similiar. I have some code that works fine with 4.0.33, but when I update to 4.0.35 I get an exception “invalid attempt to call fieldcount when reader is closed”. This exception happens on a call to SingleAsync that is done in a transaction. Before this call there has been a handful of mixed SingleAsync, SelectAsync and ExistsAsync calls. All which have been awaited.

I’ve been trying to isolate the problem in a unit test, but I still haven’t managed to pin it down. I’ll keep trying to pin it down - but does anyone have any tips or ideas as to what might be the problem?

Fredrik Forssen:

A-ha! I think I managed to make a failing unit test. I’ll post an issue on the tracker.

Fredrik Forssen:

Great fix is now available on MyGet: