|
libcmdbm 0.2.0
MyBatis-like SQL mapping library for C99
|
Data Structures | |
| struct | CMDBM_Session |
| A session: the object statements are run through. More... | |
Every statement runs through a session. A session borrows the connection of a datasource the first time it is asked for one and keeps it until it is closed, so several calls - and a transaction spanning them - see the same connection.
A session belongs to the thread which created it: it is not synchronized, and threads take one session each.
All five statement methods take the same three arguments: which datasource to run against, which statement of its mappers to run, and the parameters. The parameter object is read, and written when a statement has a selectKey or an OUT parameter, but never taken over - the caller destroys it. Everything a session returns is the caller's, to be released with CMUTIL_JsonDestroy.