CppDB 0.0.2 Released
1/3/11, by artyom ;
Posted in:
Storage;
5 comments
New Features:
- Performance optimizations in connection opening when using pool.
- Added advanced MySQL options support, patch from Krzysztof (kyku)
Bugs:
- Fixed crash on process shutdown when connections pool is used. The crash was caused by incorrect order of unloading the driver and closing shared object.
- Added missing copy constructor.
- Fixed error reporting in PostgreSQL backend when statement preparation fails.
Comments
Could you please add following snippet to cppdb::statement? I'm (re)using prepared statements for a longer period of time where it is not actual clear whether the statement is prepared already. Instead of catching the exceptions from ref_ptr (Attempt to access an empty object) I would prefer having this kind of query:
// class statement {
// public:
// [...]
// [...]
// };
You do not have to keep a statement object with you all the time.
So don't keep them, this is what cppdb does for you automatically.
In any case I can add following functions:
Similarly to thous of cppdb::result
Inserting the mentioned methods would be great.
Reusing the statement from cppdb internals cache is not a solution for me. I'm using cppdb for my own ORM framework, where e.g. the INSERT statement fir type Customer should be created once and rebuilding this query would be really bad regarding performance. Or can I access the cached version via a key (int) which could be stored instead the whole statement for every type statically?
I can add them,
I see, you mean creating original prepared statement content.
They key is not int. But the statement (text) itself.
So you can't you'll have to use your own cache,
@Stefan,
Take a version from SVN- revision 1815
Add Comment:
You must enable JavaScript in order to post comments.