ISqlMapper.QueryForObject<T> sometimes returns null

142 views
Skip to first unread message

Ralph Möritz

unread,
Apr 25, 2012, 5:52:00 AM4/25/12
to mybatis...@googlegroups.com
Hi,

we're using v1.6.2 of the DataMapper & are currently experiencing an issue where QueryForObject<T> occasionally returns null without executing the query at all (we've verified this via logging on the db), returning null instead. I would expect ISqlMapper to throw if it encountered an error; so I'd like to ask: Under what circumstances would QueryForObject<T> return null?

TIA,
Ralph

Michael McCurrey

unread,
Apr 25, 2012, 10:25:43 AM4/25/12
to mybatis...@googlegroups.com
Are you using caching?

Ralph Möritz

unread,
Apr 25, 2012, 10:51:49 AM4/25/12
to mybatis...@googlegroups.com
No, there's no cache model defined.
--
Ralph Möritz
Cell: +27 726 164 485
Skype: ralmoritz

Michael McCurrey

unread,
Apr 25, 2012, 10:53:19 AM4/25/12
to mybatis...@googlegroups.com
are you using namespaces?   Is it possible that you can attach a failing sample.  I've never encountered that before

Ralph Möritz

unread,
May 2, 2012, 5:04:30 AM5/2/12
to mybatis...@googlegroups.com
Unfortunately the problem is intermittent & I'll get fired if I shared any code on a public forum. However, it seems the problem may in fact lie with the DB rolling back transactions and not with the DataMapper.

Chris B

unread,
May 2, 2012, 7:15:15 AM5/2/12
to mybatis...@googlegroups.com
This may seem unrelated but I've addressed strange issues like this sometimes by making sure that I'm using the latest database driver to talk to the database. Often times software ends up not updating their driver DLLs and I've seen a good range of strange behavior under load.

If for any reason you can't recompile with an updated driver, you can configure your .Net application to for it to use a different version in the app/web.config.
Reply all
Reply to author
Forward
0 new messages