mr_ped Messages: 790 Registered: November 2005 Location: Czech Republic - Praha
replying just from memory, without checking anything, so I may be wrong...
IIRC "SQL" is macro hiding the default SqlSession instance, so it's probably not supposed to be used in multi-thread source, you should use the underlaying SqlSession instances themselves. But if that example is doing it, then it's probably ok, and the SQL definition accounts for it? But I don't think so.
Only thing for you to decide is whether 'default' SQL session is really 'global' (single one in the process), or you have an option to have SQL per-thread. By SQL in this paragraph I mean 'SQL default session object'.
Note that even if you opt for single global SQL, multithreading is still a go. You can either open other session in thread, or you can even use that single global SQL, but need to mutex it.