From adnan at rihan.fr Sat Nov 1 07:35:45 2014 From: adnan at rihan.fr (Adnan RIHAN) Date: Sat Nov 1 07:36:07 2014 Subject: [odb-users] QOdbList with QSharedPointer Message-ID: Hi there, Does odb support ?QOdbList? (Change tracking equivalent, for Qt?s profile) with a shared pointer as template type? The doc doesn?t mention it, it only mentions for basic types (std::string, int, ...), and I have a compilation error: > /usr/local/include/odb/database.ixx:299:40: error: no type named 'pointer_type' in 'odb::object_traits >' > ? ? typedef typename object_traits::pointer_type object_pointer; > ? ? ? ? ? ? ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~ > /usr/local/include/odb/database.ixx:330:5: note: in instantiation of function template specialization 'odb::database::update, QOdbList>' requested here > ? ? update (cr); > ? ? ^ > /Users/Max13/Dev/System/LGC/Desktop/apps/LGC/src/Controllers/EntityManager/EntityManager.hpp:149:29: note: in instantiation of function template specialization 'odb::database::update, QOdbList>' requested here > ? ? ? ? ? ? ? ? this->m_db->update(data); > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ^ > /Users/Max13/Dev/System/LGC/Desktop/apps/LGC/src/Classification/ClassificationWidget.cpp:147:59: note: in instantiation of function template specialization 'EntityManager::update > >' requested here > ? ? ? ? if (!(persisted = MasterController::inst()->em()->update(this->m_catList))) { > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ^ Do I have to do this:?http://www.codesynthesis.com/products/odb/doc/manual.xhtml#6.5 Or did I just forgot to add a header or something ? Thank you -- Cordialement, Adnan RIHAN. Directeur-G?rant de Eolis-Software, soci?t? de services informatiques. GPG: 5675-62BA (https://keybase.io/max13/key.asc) -> Si vous n?utilisez pas GPG mais souhaitez quand m?me m?envoyer un e-mail chiffr?: (https://encrypt.to/0x567562BA). From boris at codesynthesis.com Thu Nov 6 02:08:43 2014 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu Nov 6 02:16:14 2014 Subject: [odb-users] QOdbList with QSharedPointer In-Reply-To: References: Message-ID: Hi Adnan, Adnan RIHAN writes: > if (!(persisted = MasterController::inst()->em()->update(this->m_catList))) { What you are trying to do is perform the database update operation on a container. This tells me that you have a pretty fundamental lack of understanding of how change-tracking containers work in ODB. So I would suggest that you re-read the relevant parts of the manual. Also, if updating containers individually is really what you are after, then the right mechanism to achieve this in ODB is object sections (Chapter 9). Boris From boris at codesynthesis.com Thu Nov 6 09:07:07 2014 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu Nov 6 09:14:38 2014 Subject: [odb-users] help In-Reply-To: <2014110111524566220917@gmail.com> References: <2014110111524566220917@gmail.com> Message-ID: Hi, In the future please use more descriptive subject line instead of the generic "Help", as described in posting guidelines: http://codesynthesis.com/support/posting-guidelines.xhtml andrew.shy.lee@gmail.com writes: > if (db == "mysql") > r.reset (new odb::mysql::database (argc, argv)); // bad_alloc I don't see why this constructor would throw bad_alloc. You may want to run your application under a debugger and see what's going on, i.e., what code in the stack trace actually throws the exception. One common cause of bad_alloc is calling a function that allocates something on the heap recursively until all the memory is exhausted. So you may want to check for that as well. Boris From boris at codesynthesis.com Thu Nov 6 09:20:51 2014 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu Nov 6 09:28:22 2014 Subject: [odb-users] Re: l report a bug , and l want to kown how to maping boost.date to the mysql database In-Reply-To: <23ecab8d.108ed.1497f3024cc.Coremail.jme22@126.com> References: <23ecab8d.108ed.1497f3024cc.Coremail.jme22@126.com> Message-ID: Hi, ??? writes: > l want to know how to manage the Chinese character display garbled. > the problem is at attachments? Please describe your problem in plain text without any Word document attachments and re-send it to the odb-users mailing list. Also, please read and follow posting guidelines: http://codesynthesis.com/support/posting-guidelines.xhtml Boris From axel50397 at gmail.com Fri Nov 7 05:41:45 2014 From: axel50397 at gmail.com (Adnan RIHAN) Date: Fri Nov 7 05:42:12 2014 Subject: [odb-users] QOdbList with QSharedPointer In-Reply-To: References: Message-ID: Hi Boris, On 6 novembre 2014 at 08:16:16, Boris Kolpackov (boris@codesynthesis.com(mailto:boris@codesynthesis.com)) wrote: > What you are trying to do is perform the database update operation on > a container. This tells me that you have a pretty fundamental lack of > understanding of how change-tracking containers work in ODB. I must say that yes, I tried to perform an operation on a container. I understood that it?s only on ?objects?. But I?m loading a list of objects in a container, so it?s also what I need to do. > Also, if updating containers individually is really what you are > after, then the right mechanism to achieve this in ODB is object > sections (Chapter 9). I?ll read that part, thanks. I didn?t get the use of section, clearly, but now I will. -- Cordialement, Adnan RIHAN. Directeur-G?rant de Eolis-Software, soci?t? de services informatiques. GPG: 5675-62BA (https://keybase.io/max13/key.asc) -> Si vous n?utilisez pas GPG mais souhaitez quand m?me m?envoyer un e-mail chiffr?: (https://encrypt.to/0x567562BA). From axel50397 at gmail.com Thu Nov 13 06:38:49 2014 From: axel50397 at gmail.com (Adnan RIHAN) Date: Thu Nov 13 06:39:15 2014 Subject: [odb-users] Trace sqlite statements with bound parameters Message-ID: Hi there, Long time no see ;) I need to trace sqlite statement with bound parameters, as explained here:?http://www.codesynthesis.com/products/odb/doc/manual.xhtml#3.13 I?ve copy pasted the pgsql_tracer ans renamed every ?pgsql? to ?sqlite? and fixed compilation problems. Then I see that ?odb::sqlite::statement? has a ?text()? method which outputs the query with (?), and I don?t see which method I could use to get the values. How to do that please? -- Cordialement, Adnan RIHAN. Directeur-G?rant de Eolis-Software, soci?t? de services informatiques. GPG: 5675-62BA (https://keybase.io/max13/key.asc) -> Si vous n'utilisez pas GPG mais souhaitez quand m?me m?envoyer un e-mail chiffr?: (https://encrypt.to/0x567562BA). From boris at codesynthesis.com Thu Nov 13 09:06:41 2014 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu Nov 13 09:14:06 2014 Subject: [odb-users] Trace sqlite statements with bound parameters In-Reply-To: References: Message-ID: Hi Adnan, Adnan RIHAN writes: > I?ve copy pasted the pgsql_tracer ans renamed every ?pgsql? to ?sqlite? > and fixed compilation problems. Then I see that ?odb::sqlite::statement? > has a ?text()? method which outputs the query with (?), and I don?t > see which method I could use to get the values. http://www.codesynthesis.com/pipermail/odb-users/2013-November/001615.html Boris From axel50397 at gmail.com Thu Nov 13 15:34:50 2014 From: axel50397 at gmail.com (Adnan RIHAN) Date: Thu Nov 13 15:35:16 2014 Subject: [odb-users] Trace sqlite statements with bound parameters In-Reply-To: References: Message-ID: On 13 novembre 2014 at 15:14:06, Boris Kolpackov (boris@codesynthesis.com(mailto:boris@codesynthesis.com)) wrote: > http://www.codesynthesis.com/pipermail/odb-users/2013-November/001615.html I?ve seen this post earlier, but as it concerned an old version, I thought it could have been implemented in libodb-sqlite directly. Here is my code: > sqlite3 *handle = this->m_db.dynamicCast()->connection()->handle(); > sqlite3_trace(handle, sqlite_tracer::print, 0); And I have a compilation issue: > Undefined symbols for architecture x86_64: > ? "_sqlite3_trace", referenced from: > EntityManager::EntityManager(QSharedPointer, QObject*) in MasterController.o So I assume that maybe I need to link with sqlite?s lib to work? If I do, do I need to compile sqlite from sqlite.org?then link to an eventual output lib? -- Cordialement, Adnan RIHAN. Directeur-G?rant de Eolis-Software, soci?t? de services informatiques. GPG: 5675-62BA (https://keybase.io/max13/key.asc) -> Si vous n'utilisez pas GPG mais souhaitez quand m?me m?envoyer un e-mail chiffr?: (https://encrypt.to/0x567562BA). From harriev9 at gmail.com Thu Nov 13 16:11:27 2014 From: harriev9 at gmail.com (Harrie9) Date: Thu Nov 13 16:11:36 2014 Subject: [odb-users] Problems with iterating results Message-ID: <1415913087.3466.2.camel@localhost.localdomain> Hello, When I compile: #include #include // std::auto_ptr #include #include #include #include #include "relation.h" #include "relation-odb.hxx" using namespace std; using namespace odb::core; int main (int argc, char* argv[]) { try { auto_ptr db (new odb::pgsql::database (argc, argv)); unsigned long relation_id; // Create a few persistent person objects. { relation john ("Jhon", "Deer", "Hevel", "12", "City", "04556342","xx@yy"); transaction t (db->begin ()); // Make objects persistent and save their ids for later use. relation_id = db->persist (john); t.commit (); } // Show a selection of the persisted data typedef odb::query query; typedef odb::result result; // Show action { transaction t (db->begin ()); unsigned int minid; result r (db->query (query::id > 10)); for (result::iterator i (r.begin ()); i != r.end; ++i) { cout << "Relation: , " << i->get_first() << "!" << endl; } t.commit (); } } catch (const odb::exception& e) { cerr << e.what () << endl; return 1; } } Then i get an error: main.cpp: In function ?int main(int, char**)?: main.cpp:54:48: error: no match for ?operator!=? (operand types are ?odb::result::iterator {aka odb::result_iterator}? and ??) for (result::iterator i (r.begin ()); i != r.end; ++i) ^ main.cpp:54:48: note: candidates are: In file included from /usr/include/c++/4.8.3/bits/stl_algobase.h:64:0, from /usr/include/c++/4.8.3/vector:60, from main.cpp:2: /usr/include/c++/4.8.3/bits/stl_pair.h:227:5: note: template bool std::operator!=(const std::pair<_T1, _T2>&, const std::pair<_T1, _T2>&) operator!=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) What can be the cause of this? From axel50397 at gmail.com Fri Nov 14 03:52:32 2014 From: axel50397 at gmail.com (Adnan RIHAN) Date: Fri Nov 14 03:52:59 2014 Subject: [odb-users] Trace sqlite statements with bound parameters In-Reply-To: References: Message-ID: On 13 novembre 2014 at 21:35:07, Adnan RIHAN (axel50397@gmail.com(mailto:axel50397@gmail.com)) wrote: > So I assume that maybe I need to link with sqlite?s lib to work? That?s what I did, and it worked. Thanks ! -- Cordialement, Adnan RIHAN. Directeur-G?rant de Eolis-Software, soci?t? de services informatiques. GPG: 5675-62BA (https://keybase.io/max13/key.asc) -> Si vous n?utilisez pas GPG mais souhaitez quand m?me m?envoyer un e-mail chiffr?: (https://encrypt.to/0x567562BA). From grasmanek94 at gmail.com Fri Nov 14 03:25:39 2014 From: grasmanek94 at gmail.com (Rafal Gm) Date: Fri Nov 14 04:55:33 2014 Subject: [odb-users] How do I make a lookup (database->load(std::string_identifier)) case insensetive? Message-ID: Hello! I have a class for my users, but one user found a bug when joining with the same nickname but other case: User and user. Now my application detects this user has no account, while he should because "User" exists. if my class is as follow: #pragma db object class user { public: const std::string& nickname() const {return nickname_;} private: friend class odb::access; #pragma db unique id index std::string nickname_; public: user() {} user(std::string inickname) : nickname_("") {} }; how do I make the load("nicKnAmE"); case insensetive? From boris at codesynthesis.com Fri Nov 14 05:55:18 2014 From: boris at codesynthesis.com (Boris Kolpackov) Date: Fri Nov 14 06:03:08 2014 Subject: [odb-users] Problems with iterating results In-Reply-To: <1415913087.3466.2.camel@localhost.localdomain> References: <1415913087.3466.2.camel@localhost.localdomain> Message-ID: Hi, Harrie9 writes: > for (result::iterator i (r.begin ()); i != r.end; ++i) Should be 'r.end ()' not just 'r.end'. Boris From boris at codesynthesis.com Fri Nov 14 06:00:55 2014 From: boris at codesynthesis.com (Boris Kolpackov) Date: Fri Nov 14 06:08:45 2014 Subject: [odb-users] How do I make a lookup (database->load(std::string_identifier)) case insensetive? In-Reply-To: References: Message-ID: Hi Rafal, Rafal Gm writes: > how do I make the load("nicKnAmE"); case insensetive? You will need to use query() and come up with a way to compare the strings ignoring case, which depends on the database that you use. Just google for the way to do it in your database, there are usually a number of solutions on stackoverflow. Boris From grasmanek94 at gmail.com Fri Nov 14 06:16:26 2014 From: grasmanek94 at gmail.com (Rafal Gm) Date: Fri Nov 14 07:06:24 2014 Subject: [odb-users] How do I make a lookup (database->load(std::string_identifier)) case insensetive? In-Reply-To: References: Message-ID: alright, in that case I will just make the index id name alway ::tolower and add a DisplayName column :) 2014-11-14 12:00 GMT+01:00 Boris Kolpackov : > Hi Rafal, > > Rafal Gm writes: > > > how do I make the load("nicKnAmE"); case insensetive? > > You will need to use query() and come up with a way to compare the > strings ignoring case, which depends on the database that you use. > Just google for the way to do it in your database, there are usually > a number of solutions on stackoverflow. > > Boris > From harriev9 at gmail.com Fri Nov 14 13:11:13 2014 From: harriev9 at gmail.com (Harrie9) Date: Fri Nov 14 13:11:23 2014 Subject: [odb-users] Problems with iterating results In-Reply-To: References: <1415913087.3466.2.camel@localhost.localdomain> Message-ID: <1415988673.1846.1.camel@localhost.localdomain> Boris, Thank you. Indeed the () where missing. Regards, Harrie On Fri, 2014-11-14 at 12:55 +0200, Boris Kolpackov wrote: > Hi, > > Harrie9 writes: > > > for (result::iterator i (r.begin ()); i != r.end; ++i) > > Should be 'r.end ()' not just 'r.end'. > > Boris From David.Sarrut at creatis.insa-lyon.fr Wed Nov 19 14:15:17 2014 From: David.Sarrut at creatis.insa-lyon.fr (David Sarrut) Date: Wed Nov 19 14:15:45 2014 Subject: [odb-users] Issue on OSX 10.10 (Yosemite) Message-ID: Hello, Following Adnan post (September), I also encounter the issue "unable to extract profile paths", related to the gcc embeded into odb-2.3.0-i686-macosx archive. This gcc also seg fault on OSX 10.10. I dont want to install specific gcc and compile everything from scratch (too cumbersome for the users). Is a workaround or a new version available ? thanks you, David -------------- Hi Adnan, Adnan RIHAN writes: > I?ve downloaded the pre-built, as before I update to 10.10 > > [...] > > It segfaults with odb's included g++ [...] Ok, this is interesting. We build both ODB and GCC on a really old MacOS X version so that it works everywhere. Until now this worked quite well. So I will have to look into this. Can you tell me what was the version of MacOS before you upgraded (and where ODB worked fine)? > I don?t know if it?s useful, but I tried that line specifying my > Xcode?s g++ executable, and I got other errors 'g++' that ships with XCode is actually Clang. This won't work with ODB. So the two options are: 1. Wait for me to figure out and hopefully fix the pre-built package. I won't be able to look into this until the end of the week (I am currently travelling from CppCon). 2. Build GCC and ODB from source yourself. As was recently reported by several users, this is actually quite easy. Here are the instructions from Bruce Cresanta: http://www.codesynthesis.com/pipermail/odb-users/2014-September/002055.html Just to expand on building from source, make sure you are using GCC 4.8.X and not 4.9.X (vanilla ODB 2.3.0 is not compatible with GCC 4.9; this is fixed for the next release and there are patches but I don't think it is worth the trouble patching 2.3.0 in most cases). Let's say you want to install ODB to /opt/odb-2.3.0. First, download and build GCC (we install it to /opt/gcc-4.8.3): ./configure --prefix=/opt/gcc-4.8.3 --enable-plugin make sudo make install At this point check that the GCC compiler is functional by trying to compile a test program: /opt/gcc-4.8.3/bin/g++ -c hello.cpp Then download and build the ODB compiler: ./configure CXX=/opt/gcc-4.8.3/bin/g++ make sudo make install Of course you can change the installation directories to something else (e.g., /usr/local). Let us know how it goes. Boris -- David Sarrut, Phd Directeur de recherche CNRS CREATIS, UMR CNRS 5220, Inserm U 1044 Centre de lutte contre le cancer L?on B?rard 28 rue La?nnec, 69373 Lyon cedex 08 Tel : 04 78 78 51 51 / 06 74 72 05 42 http://www.creatis.insa-lyon.fr/~dsarrut _________________________________ "2 + 2 = 5, for extremely large values of 2" _________________________________ From axel50397 at gmail.com Wed Nov 19 15:21:41 2014 From: axel50397 at gmail.com (Adnan RIHAN) Date: Wed Nov 19 15:22:08 2014 Subject: [odb-users] Issue on OSX 10.10 (Yosemite) In-Reply-To: References: Message-ID: On 19 novembre 2014 at 21:16:58, David Sarrut (david.sarrut@creatis.insa-lyon.fr(mailto:david.sarrut@creatis.insa-lyon.fr)) wrote: > Yes with pleasure ! You mean brew for gcc or odb ? Homebrew (http://brew.sh), a package manager for OSX. You copy the attached files to /usr/local/Library/Formula, then you can execute: > % brew install odb It will install (locally, not globally on your system) gcc, then use it to compile odb. -- Cordialement, Adnan RIHAN. Directeur-G?rant de Eolis-Software, soci?t? de services informatiques. GPG: 5675-62BA (https://keybase.io/max13/key.asc) -> Si vous n'utilisez pas GPG mais souhaitez quand m?me m?envoyer un e-mail chiffr?: (https://encrypt.to/0x567562BA). -------------- next part -------------- A non-text attachment was scrubbed... Name: libcutl.rb Type: application/octet-stream Size: 711 bytes Desc: not available Url : http://codesynthesis.com/pipermail/odb-users/attachments/20141119/7b87852f/libcutl.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: odb.rb Type: application/octet-stream Size: 2399 bytes Desc: not available Url : http://codesynthesis.com/pipermail/odb-users/attachments/20141119/7b87852f/odb.obj From David.Sarrut at creatis.insa-lyon.fr Wed Nov 19 15:41:44 2014 From: David.Sarrut at creatis.insa-lyon.fr (David Sarrut) Date: Wed Nov 19 15:42:11 2014 Subject: [odb-users] Issue on OSX 10.10 (Yosemite) In-Reply-To: References: Message-ID: it works like a charm, thanks a lot Adnan ! David On Wed, Nov 19, 2014 at 9:21 PM, Adnan RIHAN wrote: > On 19 novembre 2014 at 21:16:58, David Sarrut ( > david.sarrut@creatis.insa-lyon.fr(mailto:david.sarrut@creatis.insa-lyon.fr)) > wrote: > > > Yes with pleasure ! You mean brew for gcc or odb ? > > Homebrew (http://brew.sh), a package manager for OSX. > You copy the attached files to /usr/local/Library/Formula, then you can > execute: > > % brew install odb > > It will install (locally, not globally on your system) gcc, then use it to > compile odb. > -- > Cordialement, Adnan RIHAN. > Directeur-G?rant de Eolis-Software, soci?t? de services informatiques. > > GPG: 5675-62BA (https://keybase.io/max13/key.asc) > -> Si vous n'utilisez pas GPG mais souhaitez quand m?me m?envoyer un > e-mail chiffr?: (https://encrypt.to/0x567562BA). > -- David Sarrut, Phd Directeur de recherche CNRS CREATIS, UMR CNRS 5220, Inserm U 1044 Centre de lutte contre le cancer L?on B?rard 28 rue La?nnec, 69373 Lyon cedex 08 Tel : 04 78 78 51 51 / 06 74 72 05 42 http://www.creatis.insa-lyon.fr/~dsarrut _________________________________ "2 + 2 = 5, for extremely large values of 2" _________________________________ From boris at codesynthesis.com Fri Nov 21 02:54:05 2014 From: boris at codesynthesis.com (Boris Kolpackov) Date: Fri Nov 21 03:01:53 2014 Subject: [odb-users] Issue on OSX 10.10 (Yosemite) In-Reply-To: References: Message-ID: Hi David, I will also try to address the Yosemite issue for the next release. Boris From axel50397 at gmail.com Sat Nov 22 18:46:19 2014 From: axel50397 at gmail.com (Adnan RIHAN) Date: Sun Nov 23 10:58:59 2014 Subject: [odb-users] std::map Message-ID: Hi there, I?m trying to store a Map of another entity as key, and a quantity as value, in an Entity. I?m on a Cashier app. I have an invoice, which contains an QMap, quantity> (quantity as uint). Invoice.hpp: > private: > ? ? QMap, uint> ? ?cart; > [...] > #pragma db member(Invoice::cart) table("invoice_carts") \ > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?id_column("invoice_id") \ > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?key_column("product_id") \ > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?key_type("UNSIGNED INT") \ > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?value_column("quantity?) When compiling, I have these errors: > In file included from /Users/Max13/Dev/System/LGC/Desktop/apps/LGC/src/Models/Invoice/Invoice-odb.cxx:7: > In file included from /Users/Max13/Dev/System/LGC/Desktop/apps/LGC/src/Models/Invoice/Invoice-odb.hxx:22: > In file included from /usr/local/include/odb/qt/basic/sqlite/qstring-traits.hxx:16: > /usr/local/include/odb/sqlite/traits.hxx:216:13: error: cannot convert 'Product' to 'image_type' (aka 'long long') without a conversion operator > ? ? ? ? i = image_type (v); > ? ? ? ? ? ? ^~~~~~~~~~~~~ > /usr/local/include/odb/sqlite/traits.hxx:172:20: note: in instantiation of member function 'odb::sqlite::default_value_traits::set_image' requested here > ? ? ? ? ? vtraits::set_image (i, is_null, wtraits::get_ref (v)); > ? ? ? ? ? ? ? ? ? ?^ > /Users/Max13/Dev/System/LGC/Desktop/apps/LGC/src/Models/Invoice/Invoice-odb.cxx:144:33: note: in instantiation of member function 'odb::sqlite::wrapped_value_traits, 0, true>::set_image' requested here > ? ? ? ? ? sqlite::id_integer >::set_image ( > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ^ > In file included from /Users/Max13/Dev/System/LGC/Desktop/apps/LGC/src/Models/Invoice/Invoice-odb.cxx:7: > In file included from /Users/Max13/Dev/System/LGC/Desktop/apps/LGC/src/Models/Invoice/Invoice-odb.hxx:22: > In file included from /usr/local/include/odb/qt/basic/sqlite/qstring-traits.hxx:16: > /usr/local/include/odb/sqlite/traits.hxx:207:15: error: no matching conversion for functional-style cast from 'const image_type' (aka 'const long long') to 'Product' > ? ? ? ? ? v = T (i); > ? ? ? ? ? ? ? ^~~~ > /usr/local/include/odb/sqlite/traits.hxx:163:20: note: in instantiation of member function 'odb::sqlite::default_value_traits::set_value' requested here > ? ? ? ? ? vtraits::set_value (wtraits::set_ref (v), i, is_null); > ? ? ? ? ? ? ? ? ? ?^ > /Users/Max13/Dev/System/LGC/Desktop/apps/LGC/src/Models/Invoice/Invoice-odb.cxx:181:33: note: in instantiation of member function 'odb::sqlite::wrapped_value_traits, 0, true>::set_value' requested here > ? ? ? ? ? sqlite::id_integer >::set_value ( > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ^ > /Users/Max13/Dev/System/LGC/Desktop/apps/LGC/src/Models/Invoice/../Product/Product.hpp:22:7: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'const image_type' (aka 'const long long') to 'const Product' for 1st argument > class Product : public BaseModel > ? ? ? ^ > /Users/Max13/Dev/System/LGC/Desktop/apps/LGC/src/Models/Invoice/../Product/Product.hpp:44:9: note: candidate constructor not viable: no known conversion from 'const image_type' (aka 'const long long') to 'QObject *' for 1st argument > ? ? ? ? Product(QObject *parent = 0); > ? ? ? ? ^ > /Users/Max13/Dev/System/LGC/Desktop/apps/LGC/src/Models/Invoice/../Product/Product.hpp:45:9: note: candidate constructor not viable: requires at least 2 arguments, but 1 was provided > ? ? ? ? Product( > ? ? ? ? ^ > 2 errors generated. What I understand, is that the key is a long long (object_id) and I?m trying to obtain the actual object having for id the object_id. So, my question is: Is it supported? Or am I missing something? My idea, if it?s not supported, is to create a class having 3 properties: id, object, quantity, and store it in Invoices as a set. I prefer including that as a map. Thanks for your help. -- Cordialement, Adnan RIHAN. Directeur-G?rant de Eolis-Software, soci?t? de services informatiques. GPG: 5675-62BA (https://keybase.io/max13/key.asc) -> Si vous n'utilisez pas GPG mais souhaitez quand m?me m?envoyer un e-mail chiffr?: (https://encrypt.to/0x567562BA). From axel50397 at gmail.com Fri Nov 21 08:04:59 2014 From: axel50397 at gmail.com (Adnan RIHAN) Date: Sun Nov 23 13:54:25 2014 Subject: [odb-users] Issue on OSX 10.10 (Yosemite) In-Reply-To: References: Message-ID: Hi David, On 21 novembre 2014 at 14:02:49, David Sarrut (david.sarrut@gmail.com(mailto:david.sarrut@gmail.com)) wrote: > in the meantime, brew packages work smoothly. I?ve made other brew packages (libodb, libodb-sqlite, libodb-qt), do you need one of them so you can also check them on 10.10 ? -- Cordialement, Adnan RIHAN. Directeur-G?rant de Eolis-Software, soci?t? de services informatiques. GPG: 5675-62BA (https://keybase.io/max13/key.asc) -> Si vous n'utilisez pas GPG mais souhaitez quand m?me m?envoyer un e-mail chiffr?: (https://encrypt.to/0x567562BA). From David.Sarrut at creatis.insa-lyon.fr Fri Nov 21 08:13:35 2014 From: David.Sarrut at creatis.insa-lyon.fr (David Sarrut) Date: Sun Nov 23 14:50:35 2014 Subject: [odb-users] Issue on OSX 10.10 (Yosemite) In-Reply-To: References: Message-ID: yes why not. However, it is not clear for me how to check : do I need to remove previously installed libodb/libodb-sqlite versions first ? (I do not use odb-qt ) On Fri, Nov 21, 2014 at 2:04 PM, Adnan RIHAN wrote: > Hi David, > > On 21 novembre 2014 at 14:02:49, David Sarrut (david.sarrut@gmail.com > (mailto:david.sarrut@gmail.com)) wrote: > > > in the meantime, brew packages work smoothly. > > I?ve made other brew packages (libodb, libodb-sqlite, libodb-qt), do you > need one of them so you can also check them on 10.10 ? > -- > Cordialement, Adnan RIHAN. > Directeur-G?rant de Eolis-Software, soci?t? de services informatiques. > > GPG: 5675-62BA (https://keybase.io/max13/key.asc) > -> Si vous n'utilisez pas GPG mais souhaitez quand m?me m?envoyer un > e-mail chiffr?: (https://encrypt.to/0x567562BA). > -- David Sarrut, Phd Directeur de recherche CNRS CREATIS, UMR CNRS 5220, Inserm U 1044 Centre de lutte contre le cancer L?on B?rard 28 rue La?nnec, 69373 Lyon cedex 08 Tel : 04 78 78 51 51 / 06 74 72 05 42 http://www.creatis.insa-lyon.fr/~dsarrut _________________________________ "2 + 2 = 5, for extremely large values of 2" _________________________________ From david.sarrut at gmail.com Fri Nov 21 08:02:28 2014 From: david.sarrut at gmail.com (David Sarrut) Date: Sun Nov 23 23:32:08 2014 Subject: [odb-users] Issue on OSX 10.10 (Yosemite) In-Reply-To: References: Message-ID: thanks you again. in the meantime, brew packages work smoothly. thanks, David On Fri, Nov 21, 2014 at 8:54 AM, Boris Kolpackov wrote: > Hi David, > > I will also try to address the Yosemite issue for the next release. > > Boris > From ajl17 at case.edu Sun Nov 23 15:40:24 2014 From: ajl17 at case.edu (Alexander Lonsberry) Date: Sun Nov 23 23:32:08 2014 Subject: [odb-users] Failed odb-tests at "callback" Message-ID: To whom it may concern, I cannot get past the "callback" test when I run "make check" *My Machine*: Windows 7 running MSYS with 64bit MinGW (tdm64-gcc-4.8.1-3). *Database* PostgreSQL Version 9.3.5 64bit *ODB C++* odb-2.3.0, libodb-2.3.0, libodb-pgsql-2.3.1, odb-tests-2.3.0 I run configure and make without a problem, however I then run make check and get an error. I have attached a text file of the output. How do I go about fixing this error? -Thank you, Alex -------------- next part -------------- A non-text attachment was scrubbed... Name: TestFailedOutput Type: application/octet-stream Size: 5683 bytes Desc: not available Url : http://codesynthesis.com/pipermail/odb-users/attachments/20141123/a7fb642f/TestFailedOutput.obj From boris at codesynthesis.com Mon Nov 24 04:52:12 2014 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Nov 24 05:00:20 2014 Subject: [odb-users] Failed odb-tests at "callback" In-Reply-To: References: Message-ID: Hi Alexander, Alexander Lonsberry writes: > I cannot get past the "callback" test when I run "make check" > > *My Machine*: > Windows 7 running MSYS with 64bit MinGW (tdm64-gcc-4.8.1-3). > > *Database* > PostgreSQL Version 9.3.5 64bit > > *ODB C++* > odb-2.3.0, libodb-2.3.0, libodb-pgsql-2.3.1, odb-tests-2.3.0 > > I run configure and make without a problem, however I then run make check > and get an error. I have attached a text file of the output. Thanks for the information and the output. I am pretty sure this has to do with differences in newlines. Try to re-configure the tests with these DIFFFLAGS: ./configure ... DIFFFLAGS=-ubB This is how we run ODB tests on MinGW and everything works fine. Boris From boris at codesynthesis.com Mon Nov 24 05:07:54 2014 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Nov 24 05:16:00 2014 Subject: [odb-users] std::map In-Reply-To: References: Message-ID: Hi Adnan, Adnan RIHAN writes: > > QMap, uint> cart; This is not yet supported. I've added an item to the TODO list. Interestingly, wrapping the pointer into a composite value seems to work: #pragma db value struct ProductKey { QSharedPointer p; }; inline bool operator< (const ProductKey& x, const ProductKey& y) {return x.p < y.p;} QMap cart; Changing map to set should also work. Boris From picserez at gmail.com Mon Nov 24 06:07:33 2014 From: picserez at gmail.com (Erez Pics) Date: Tue Nov 25 00:14:41 2014 Subject: [odb-users] Include of SQLite files and ODB compiler Message-ID: Hi Boris, [Switched to plain text client, hope it helps] As you know we are using ODB and are very happy with it. Following our last correspondence we changed to use explicit SQLite objects instead of regular ODB ones, for example : odb::sqlite::database object instead of odb::database odb::sqlite::connection object instead of odb::connection This means that we need to change the include accordingly and so forth. The ODB compiler does not like these includes : In file included from r:\libodb-sqlite-2.3.0/odb/sqlite/details/export.hxx:10:0, from r:\libodb-sqlite-2.3.0/odb/sqlite/traits.hxx:30, from r:\libodb-sqlite-2.3.0/odb/sqlite/query.hxx:21, from r:\libodb-sqlite-2.3.0/odb/sqlite/database.hxx:22, r:\libodb-sqlite-2.3.0/odb/sqlite/details/config.hxx:12:4: error: #error libodb-sqlite header included in odb-compiled header I used ifndef to make the ODB compiler ignore these includes: #ifndef ODB_COMPILER #include #include #include #endif // ODB_COMPILER Which indeed fixed the error and cause another one, because we are passing odb::sqlite::database object in our code, it does not know the sqlite namespace: error: 'sqlite' is not a member of 'odb' How would you recommend to resolve this problem ? * Create fake odb::sqlite namespace just for ODB compiler ? * Revert to use ODB general objects ? * Other solution ? Thank you very much, Erez. From boris at codesynthesis.com Tue Nov 25 02:06:47 2014 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue Nov 25 02:14:54 2014 Subject: [odb-users] Include of SQLite files and ODB compiler In-Reply-To: References: Message-ID: Hi Erez, Erez Pics writes: > [Switched to plain text client, hope it helps] Yes, much, much, better. Thank you. > I used ifndef to make the ODB compiler ignore these includes: > #ifndef ODB_COMPILER > #include > #include > #include > #endif // ODB_COMPILER > > Which indeed fixed the error and cause another one, because we are > passing odb::sqlite::database object in our code, it does not know the > sqlite namespace: > error: 'sqlite' is not a member of 'odb' > > How would you recommend to resolve this problem ? While you cannot include most libodb-sqlite headers into headers that you compile with the ODB compiler, there is an exception: forward.hxx which forward-declares odb::sqlite::database besides other things. So the way I would suggest you structure your header/source is as follows: // header // #include class object { ... void do_it (odb::sqlite::database&); }; // source // #include void object::do_it (odb::sqlite::database& db) { db.persist (*this); } The idea here is to only use/pass references/pointers to database in the header for which a forward-declaration is sufficient. In the source file, howevere, you include and can call database operations, etc. Boris From axel50397 at gmail.com Tue Nov 25 03:38:11 2014 From: axel50397 at gmail.com (Adnan RIHAN) Date: Tue Nov 25 03:38:32 2014 Subject: [odb-users] Issue on OSX 10.10 (Yosemite) In-Reply-To: References: Message-ID: Hi David, On 25 novembre 2014 at 09:09:00, David Sarrut (david.sarrut@creatis.insa-lyon.fr) wrote: I installed the brew packages. The only thing I did, in addition to brew install, is?brew link --overwrite libodb, probably because of previously installed version. If you?ve previously installed libodb via brew packages, next packages requiring an already installed one don?t reinstall them. So to be sure, what you can do is: brew reinstall [ ...] it compiles without problem. However, I had trouble at run time. A seg fault occur after I open a db: db_ = new odb::sqlite::database(filename); odb::connection_ptr c(db_->connection()); c->execute("PRAGMA foreign_keys=ON;"); This is strange because I have standard compilation options. When you compile libodb yourself (BTW, can you provide me your configure and compilation command line, and the compiler you?re using please) do you have the same issues? If I comment the two last lines, no seg fault, but this error :? Assertion failed: (dynamic_cast (&b.implementation ()) != 0), function current, file transaction.cxx, line 23. Concerning runtime errors, I?ll let codesynthesis answer that ;) Did you run the tests or examples to check if it?s from the compilation options or from your code? --? Cordialement, Adnan RIHAN. Directeur-G?rant de?Eolis-Software,?soci?t? de services informatiques. GPG:?5675-62BA (https://keybase.io/max13/key.asc) ->?Si vous?n'utilisez?pas GPG mais?souhaitez quand m?me m?envoyer un?e-mail chiffr?: (https://encrypt.to/0x567562BA). From axel50397 at gmail.com Tue Nov 25 18:25:35 2014 From: axel50397 at gmail.com (Adnan RIHAN) Date: Tue Nov 25 18:26:04 2014 Subject: [odb-users] std::map In-Reply-To: References: Message-ID: Hi Boris On 24 novembre 2014 at 11:16:00, Boris Kolpackov (boris@codesynthesis.com(mailto:boris@codesynthesis.com)) wrote: > #pragma db value > struct ProductKey > { > QSharedPointer p; > }; I tried this, the file was correctly compiled by ODB, but I needed to make some changes. As I needed many methods in the struct, I?ve decided to create a class, my class structure is like this: - An Invoice has a Set of QSharedPointer. - A Cart has 1 struct CartId, 1 quantity (int). - A struct CartId is 1 QWeakPointer, 1 QSharedPointer. - An Offer has 1 QSharedPointer, 1 price (int). - A Product has many properties. I want to make a composite key for struct CartId, and I think I?ve followed the doc, but I now have an odb compilation issue: > apps/LGC/src/Models/Invoice/Invoice.hpp:107:0: warning: ignoring #pragma dbb member [-Wunknown-pragmas] > ?# ? pragma ?dbb ?member(Invoice::m_cart) ? ? ? ? not_null > ?^ > apps/LGC/src/Models/Invoice/../Cart/Cart.hpp:81:45: error: name 'CartId' in db pragma column does not refer to a data member > apps/LGC/src/Models/Invoice/../Cart/Cart.hpp:82:40: error: unable to resolve type name 'CartId::m_invoice' in db pragma value > apps/LGC/src/Models/Invoice/../Cart/Cart.hpp:83:38: error: unable to resolve type name 'CartId::m_offer' in db pragma value Here is my Cart.hpp (odb section, at the end of the file): > # ifdef ? ? ODB_COMPILER > # ? pragma ?db ?value(CartId) ? ? ? ? ? ? ? column("") > # ? pragma ?db ?value(CartId::m_invoice) ? ?column("invoice_id") > # ? pragma ?db ?value(CartId::m_offer) ? ? ?column("offer_id") >? > # ? pragma ?db ?model ? ? ? ? ? ? ? ? ? ? ? version(1, 1, open) > # ? pragma ?db ?object(Cart) ? ? ? ? ? ? ? ?table("invoice_carts") > # ? pragma ?db ?member(Cart::m_data) ? ? ? ?id ?auto > # ? pragma ?db ?member(Cart::m_quantity) ? ?not_null ? ?default(1) > # ? pragma ?db ?member(Cart::isDirty) ? ? ? transient > # endif And for reference, my Invoice.hpp (because it also failed, but not anymore): > # ifdef ? ? ODB_COMPILER > # ? pragma ?db ?model ? ? ? ? ? ? ? ? ? ? ? ? ? version(1, 1, open) > # ? pragma ?db ?object(Invoice) ? ? ? ? ? ? ? ? table("invoices") > # ? pragma ?db ?member(Invoice::m_id) ? ? ? ? ? id ?auto > # ? pragma ?db ?member(Invoice::m_cart) ? ? ? ? not_null ? ?// QSet > > # ? pragma ?db ?member(Invoice::m_customer) ? ? not_null ? ?column("customer_id") ? default(1) > # ? pragma ?db ?member(Invoice::m_discount) ? ? not_null ? ?default(0) > # ? pragma ?db ?member(Invoice::m_comment) ? ? ?null > # ? pragma ?db ?member(Invoice::m_barcode) ? ? ?not_null > # ? pragma ?db ?member(Invoice::m_createdAt) ? ?not_null ? ?column("created_at") > # ? pragma ?db ?member(Invoice::m_updatedAt) ? ?null ? ? ? ?column("updated_at") > # ? pragma ?db ?member(Invoice::m_deletedAt) ? ?null ? ? ? ?column("deleted_at") > # ? pragma ?db ?member(Invoice::isDirty) ? ? ? ?transient > # endif In your previous email, you wrote: "Interestingly, wrapping the pointer into a composite value seems to work?, could the error come from the fact that I?m making a composite of 2 unsupported data (objects). Do I need to wrap the pointer into 2 distinct composite values, then in my struct CartId I would have 2 other structs? -- Cordialement, Adnan RIHAN. Directeur-G?rant de Eolis-Software, soci?t? de services informatiques. GPG: 5675-62BA (https://keybase.io/max13/key.asc) -> Si vous n'utilisez pas GPG mais souhaitez quand m?me m?envoyer un e-mail chiffr?: (https://encrypt.to/0x567562BA). From picserez at gmail.com Tue Nov 25 04:58:21 2014 From: picserez at gmail.com (Erez Pics) Date: Wed Nov 26 03:43:24 2014 Subject: [odb-users] Include of SQLite files and ODB compiler In-Reply-To: References: Message-ID: Hi Boris, I am so impressed, prompt, accurate and full solution every time, Boris's magic at work :-) Indeed it solved, currently I am simply using ifndef which works like a charm : #ifndef ODB_COMPILER #include #include #include #else #include #endif // ODB_COMPILER This raises an interesting question, I am using SQLite database and link to the ODB SQLite lib, however I can use regular ODB objects in most cases that do not require specific SQLite functionality, most general ODB objects have a similar interface to their SQLite counterparts and seem to work the same. Does switching to use explicit ODB::SQLite objects translates to any performance or other advantage VS general ODB objects ? [for example odb::query to odb::sqlite::query and so forth] Thank you very much, Erez. On Tue, Nov 25, 2014 at 9:06 AM, Boris Kolpackov wrote: > Hi Erez, > > Erez Pics writes: > >> [Switched to plain text client, hope it helps] > > Yes, much, much, better. Thank you. > > >> I used ifndef to make the ODB compiler ignore these includes: >> #ifndef ODB_COMPILER >> #include >> #include >> #include >> #endif // ODB_COMPILER >> >> Which indeed fixed the error and cause another one, because we are >> passing odb::sqlite::database object in our code, it does not know the >> sqlite namespace: >> error: 'sqlite' is not a member of 'odb' >> >> How would you recommend to resolve this problem ? > > While you cannot include most libodb-sqlite headers into headers that > you compile with the ODB compiler, there is an exception: forward.hxx > which forward-declares odb::sqlite::database besides other things. So > the way I would suggest you structure your header/source is as follows: > > // header > // > #include > > class object > { > ... > > void do_it (odb::sqlite::database&); > }; > > // source > // > #include > > void object::do_it (odb::sqlite::database& db) > { > db.persist (*this); > } > > The idea here is to only use/pass references/pointers to database in > the header for which a forward-declaration is sufficient. In the source > file, howevere, you include and can call > database operations, etc. > > Boris From boris at codesynthesis.com Wed Nov 26 04:37:12 2014 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed Nov 26 04:45:19 2014 Subject: [odb-users] Issue on OSX 10.10 (Yosemite) In-Reply-To: References: Message-ID: Hi Adnan, Adnan RIHAN writes: > Concerning runtime errors, I?ll let codesynthesis answer that ;) I am not really interested in exploring all the possible ways one can screw themselves up on MacOS (it seems a couple of new ways are added with each new version). There are multiple compilers, multiple incompatible C++ runtimes (libc++ and libstdc++), XCode vs command line tools vs brew-built GCC. And if that's not bad enough for you, throw in the Qt/QtCreator mess. The only configuration that I am interested in is the simplest one: 1. Get the pre-built ODB compiler from the download page. Temporarily, for Yosemite, use the Brew package, *BUT*, just for the ODB compiler. 2. Build all the ODB runtimes using exactly the same compiler and exactly the same options as you are building your application. Specifically, don't use the Brew packages unless you build you rapplication with Brew as well. If this doesn't work for you, let me know. Otherwise, you are on your own. Boris From boris at codesynthesis.com Wed Nov 26 04:39:47 2014 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed Nov 26 04:47:52 2014 Subject: [odb-users] Include of SQLite files and ODB compiler In-Reply-To: References: Message-ID: Hi Erez, Erez Pics writes: > Does switching to use explicit ODB::SQLite objects translates to any > performance or other advantage VS general ODB objects ? If you are not using dynamic multi-database support (and I believe you are not), then, no, using odb::database vs odb::sqlite::database is exactly the same in all aspects. Boris From David.Sarrut at creatis.insa-lyon.fr Wed Nov 26 10:47:14 2014 From: David.Sarrut at creatis.insa-lyon.fr (David Sarrut) Date: Wed Nov 26 10:47:42 2014 Subject: [odb-users] Issue on OSX 10.10 (Yosemite) In-Reply-To: References: Message-ID: Hello, I tried to restart from scratch, and I reinstalled odb + libodb + libodb-sqlite with brew. Now, I get error during linking (I suppose it worked previously because of several dependencies) : Undefined symbols for architecture x86_64: "odb::sqlite::query_base::append(std::__1::basic_string, std::__1::allocator > const&)", referenced from: odb::sqlite::query_column, std::__1::allocator >, (odb::sqlite::database_type_id)2>::like(odb::sqlite::val_bind, std::__1::allocator > >) const in libsydStudyDatabase.a(sydStudyDatabase.cxx.o) any idea ? Maybe a simple path to set ? David PS: Boris : it is not clear for me what you suggested. Do you suggest I install odb executable with brew, but the lib odb and libodb-sqlite by recompiling source from the package from the web site : http://www.codesynthesis.com/download/odb/2.3/libodb-2.3.0.tar.gz ? On Wed, Nov 26, 2014 at 10:37 AM, Boris Kolpackov wrote: > Hi Adnan, > > Adnan RIHAN writes: > > > Concerning runtime errors, I?ll let codesynthesis answer that ;) > > I am not really interested in exploring all the possible ways one > can screw themselves up on MacOS (it seems a couple of new ways are > added with each new version). There are multiple compilers, multiple > incompatible C++ runtimes (libc++ and libstdc++), XCode vs command > line tools vs brew-built GCC. And if that's not bad enough for you, > throw in the Qt/QtCreator mess. > > The only configuration that I am interested in is the simplest one: > > 1. Get the pre-built ODB compiler from the download page. Temporarily, > for Yosemite, use the Brew package, *BUT*, just for the ODB compiler. > > 2. Build all the ODB runtimes using exactly the same compiler and exactly > the same options as you are building your application. Specifically, > don't use the Brew packages unless you build you rapplication with > Brew as well. > > If this doesn't work for you, let me know. Otherwise, you are on your > own. > > Boris > > -- David Sarrut, Phd Directeur de recherche CNRS CREATIS, UMR CNRS 5220, Inserm U 1044 Centre de lutte contre le cancer L?on B?rard 28 rue La?nnec, 69373 Lyon cedex 08 Tel : 04 78 78 51 51 / 06 74 72 05 42 http://www.creatis.insa-lyon.fr/~dsarrut _________________________________ "2 + 2 = 5, for extremely large values of 2" _________________________________ From axel50397 at gmail.com Wed Nov 26 12:05:39 2014 From: axel50397 at gmail.com (Adnan RIHAN) Date: Wed Nov 26 12:06:03 2014 Subject: [odb-users] Issue on OSX 10.10 (Yosemite) In-Reply-To: References: Message-ID: Hi David, On 26 novembre 2014 at 16:47:34, David Sarrut (david.sarrut@creatis.insa-lyon.fr(mailto:david.sarrut@creatis.insa-lyon.fr)) wrote: > PS: Boris : it is not clear for me what you suggested. Do you suggest I install odb executable with brew, but the lib odb and libodb-sqlite by recompiling source from the package from the web site : http://www.codesynthesis.com/download/odb/2.3/libodb-2.3.0.tar.gz ?? Few weeks ago, I had many compilation/linking issues concerning odb/libodb* with and without brew packages. I had to reinstall 10.9 because apparently there was a problem with the combination ?odb/libodb + brew + Yosemite?. Now on Mavericks, I don?t have linking issues anymore. So yes, he?s advising you to install odb from brew package (because it works and takes care of installing gcc and dependencies to compile odb) but I?m still on some tests for libodb* . You should uninstall libodb from brew (brew uninstall libodb libodb-sqlite) and reintall them from scratch by hand. If you have linking issues, it would be another problem. BTW, just for me, are you using clang or gcc to compile your app and libodb? If you don?t know, tell me about your IDE. -- Cordialement, Adnan RIHAN. Directeur-G?rant de Eolis-Software, soci?t? de services informatiques. GPG: 5675-62BA (https://keybase.io/max13/key.asc) -> Si vous n'utilisez pas GPG mais souhaitez quand m?me m?envoyer un e-mail chiffr?: (https://encrypt.to/0x567562BA). From David.Sarrut at creatis.insa-lyon.fr Wed Nov 26 15:40:26 2014 From: David.Sarrut at creatis.insa-lyon.fr (David Sarrut) Date: Wed Nov 26 15:40:54 2014 Subject: [odb-users] Issue on OSX 10.10 (Yosemite) In-Reply-To: References: Message-ID: ok I removed all libodb* and install odb with brew. However now, I cannot compile libodb and libodb-sqlite because it require gcc (and only clang is installed, and it complains about "thread support not available"). Should I install gcc to compile libodb (which version ?) ? If yes, should I also need to use gcc to compile my app ? Boris : does a new binary package is planned for OSX/Yosemite ? David PS: my IDE ? heu ... plain old emacs of course ! Since about 20 years ... something else exist ;) ? (just kidding, dont troll) On Wed, Nov 26, 2014 at 6:05 PM, Adnan RIHAN wrote: > Hi David, > > On 26 novembre 2014 at 16:47:34, David Sarrut ( > david.sarrut@creatis.insa-lyon.fr(mailto:david.sarrut@creatis.insa-lyon.fr)) > wrote: > > > PS: Boris : it is not clear for me what you suggested. Do you suggest I > install odb executable with brew, but the lib odb and libodb-sqlite by > recompiling source from the package from the web site : > http://www.codesynthesis.com/download/odb/2.3/libodb-2.3.0.tar.gz ? > > Few weeks ago, I had many compilation/linking issues concerning > odb/libodb* with and without brew packages. I had to reinstall 10.9 because > apparently there was a problem with the combination ?odb/libodb + brew + > Yosemite?. Now on Mavericks, I don?t have linking issues anymore. > > So yes, he?s advising you to install odb from brew package (because it > works and takes care of installing gcc and dependencies to compile odb) but > I?m still on some tests for libodb* . You should uninstall libodb from brew > (brew uninstall libodb libodb-sqlite) and reintall them from scratch by > hand. If you have linking issues, it would be another problem. > > BTW, just for me, are you using clang or gcc to compile your app and > libodb? If you don?t know, tell me about your IDE. > -- > Cordialement, Adnan RIHAN. > Directeur-G?rant de Eolis-Software, soci?t? de services informatiques. > > GPG: 5675-62BA (https://keybase.io/max13/key.asc) > -> Si vous n'utilisez pas GPG mais souhaitez quand m?me m?envoyer un > e-mail chiffr?: (https://encrypt.to/0x567562BA). > -- David Sarrut, Phd Directeur de recherche CNRS CREATIS, UMR CNRS 5220, Inserm U 1044 Centre de lutte contre le cancer L?on B?rard 28 rue La?nnec, 69373 Lyon cedex 08 Tel : 04 78 78 51 51 / 06 74 72 05 42 http://www.creatis.insa-lyon.fr/~dsarrut _________________________________ "2 + 2 = 5, for extremely large values of 2" _________________________________ From axel50397 at gmail.com Wed Nov 26 15:59:58 2014 From: axel50397 at gmail.com (Adnan RIHAN) Date: Wed Nov 26 16:00:23 2014 Subject: [odb-users] Issue on OSX 10.10 (Yosemite) In-Reply-To: References: Message-ID: a-lyon.fr(mailto:david.sarrut=40creatis.insa-lyon.fr)) wrote: > However now, I cannot compile libodb and libodb-sqlite because it requi= re gcc (and only clang is installed, and it complains about =22thread sup= port not available=E2=80=9D). Should I install gcc to compile libodb (whi= ch version =3F) =3F If yes, should I also need to use gcc to compile my a= pp =3F=C2=A0 Strange that you can=E2=80=99t compile libodb* anymore... On Maverick I c= an compile them with clang. What is the ./configure command line you=E2=80= =99re trying for libodb=3F (I=E2=80=99ll try to check on a VM) A=46AIK, you can compile libodb* with GCC or clang, but you must compile = your app with the same compiler. So if you=E2=80=99re compiling libodb wi= th clang, your app will have to be compiled with clang too. > PS: my IDE =3F heu ... plain old emacs of course =21 Since about 20 yea= rs ... something else exist ;) =3F=C2=A0 Didn=E2=80=99t know something else existed. -- =20 Cordialement, Adnan RIHAN. Directeur-G=C3=A9rant de Eolis-Software, soci=C3=A9t=C3=A9 de services in= formatiques. =20 GPG: 5675-62BA (https://keybase.io/max13/key.asc) -> Si vous n'utilisez pas GPG mais souhaitez quand m=C3=AAme m=E2=80=99en= voyer un e-mail chiffr=C3=A9: (https://encrypt.to/0x567562BA). -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 101 bytes Desc: Message signed with OpenPGP using AMPGpg Url : http://codesynthesis.com/pipermail/odb-users/attachments/20141126/71bbd9e5/signature.pgp From axel50397 at gmail.com Wed Nov 26 16:14:16 2014 From: axel50397 at gmail.com (Adnan RIHAN) Date: Wed Nov 26 16:14:48 2014 Subject: [odb-users] Issue on OSX 10.10 (Yosemite) In-Reply-To: References: Message-ID: [Shitty OpenGPG is shitty, some punctuation may have been replaced] On 26 novembre 2014 at 21:40:46, David Sarrut (david.sarrut@creatis.insa-lyon.fr(mailto:david.sarrut@creatis.insa-lyon.fr)) wrote:? > However now, I cannot compile libodb and libodb-sqlite because it require gcc (and only clang is installed, and it complains about ? thread support not available ?). Should I install gcc to compile libodb (which version ?) ? If yes, should I also need to use gcc to compile my app ? Strange that you can't compile libodb* anymore... On Maverick I can compile them with clang. What is the ./configure command line you're trying for libodb? (I'll try to check on a VM)? A=46AIK, you can compile libodb* with GCC or clang, but you must compile your app with the same compiler. So if you're compiling libodb with clang, your app will have to be compiled with clang too.? > PS: my IDE ? heu ... plain old emacs of course ! Since about 20 years ... something else exist ;) ? Didn't know something else existed.? --? Cordialement, Adnan RIHAN.? Directeur-G?rant de Eolis-Software, soci?t? de services informatiques. GPG: 5675-62BA (https://keybase.io/max13/key.asc)? -> Si vous n'utilisez pas GPG mais souhaitez quand m?me m'envoyer un e-mail chiffr?: (https://encrypt.to/0x567562BA). From axel50397 at gmail.com Wed Nov 26 16:24:50 2014 From: axel50397 at gmail.com (Adnan RIHAN) Date: Wed Nov 26 16:25:13 2014 Subject: [odb-users] Issue on OSX 10.10 (Yosemite) In-Reply-To: References: Message-ID: On 26 novembre 2014 at 22:20:02, David Sarrut (david.sarrut@creatis.insa-lyon.fr(mailto:david.sarrut@creatis.insa-lyon.fr)) wrote: > I google a bit : it may be related to xcode ... (with a mess I should have done with some previous gcc installation). I will reinstall xcode and let you know? Don?t forget to install the CLT: xcode-select --install I don?t know if brew?s GCC could have messed up something, as it?s isolated in /usr/local/Cellar/... Then the files are symlinked in usual paths. Did you remove gcc and dependencies form brew? (brew list) -- Cordialement, Adnan RIHAN. Directeur-G?rant de Eolis-Software, soci?t? de services informatiques. GPG: 5675-62BA (https://keybase.io/max13/key.asc) -> Si vous n'utilisez pas GPG mais souhaitez quand m?me m?envoyer un e-mail chiffr?: (https://encrypt.to/0x567562BA). From boris at codesynthesis.com Thu Nov 27 05:23:20 2014 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu Nov 27 05:31:26 2014 Subject: [odb-users] Issue on OSX 10.10 (Yosemite) In-Reply-To: References: Message-ID: Hi David, David Sarrut writes: > Boris : it is not clear for me what you suggested. Do you suggest I > install odb executable with brew, but the lib odb and libodb-sqlite by > recompiling source from the package from the web site : > http://www.codesynthesis.com/download/odb/2.3/libodb-2.3.0.tar.gz ? Yes, here is a step-by-step guide on the second part (building runtimes): http://codesynthesis.com/pipermail/odb-users/2014-October/002156.html [Also remember to use clang++, not g++, to build your application]. Also, just for reference (if someone else is reading this), this is how to do the same but using libstdc++ runtime instead of the default (for clang) libc++ (this seem to be currently necessary if you are building your application from QtCreator): http://codesynthesis.com/pipermail/odb-users/2014-October/002166.html > Boris : does a new binary package is planned for OSX/Yosemite ? Yes, I was hoping not to have to build it for 2.3.0 and just do it for the upcoming 2.4.0 release. But if the Brew approach doesn't work, I might have to bite the bullet. Let me know if the above doesn't work. Boris From boris at codesynthesis.com Thu Nov 27 06:46:38 2014 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu Nov 27 06:54:44 2014 Subject: [odb-users] std::map In-Reply-To: References: Message-ID: Hi Adnan, Adnan RIHAN writes: > - An Invoice has a Set of QSharedPointer. > - A Cart has 1 struct CartId, 1 quantity (int). > - A struct CartId is 1 QWeakPointer, 1 QSharedPointer. > - An Offer has 1 QSharedPointer, 1 price (int). > - A Product has many properties. Uh, read this three times and I still can't wrap my head around it. What happened to keeping things simple? > > # ? pragma ?db ?value(CartId) ? ? ? ? ? ? ? column("") > > # ? pragma ?db ?value(CartId::m_invoice) ? ?column("invoice_id") > > # ? pragma ?db ?value(CartId::m_offer) ? ? ?column("offer_id") These are all invalid. The column pragma cannot be specified on the composite value. What you probably want is this: #pragma db member(CartId::m_invoice) column("invoice_id") #pragma db member(CartId::m_offer) column("offer_id") #pragma db member(CartId::m_cardId) column("") Boris From axel50397 at gmail.com Thu Nov 27 07:21:21 2014 From: axel50397 at gmail.com (Adnan RIHAN) Date: Thu Nov 27 07:21:45 2014 Subject: [odb-users] std::map In-Reply-To: References: Message-ID: Hello, On 27 novembre 2014 at 12:54:43, Boris Kolpackov (boris@codesynthesis.com(mailto:boris@codesynthesis.com)) wrote: > Uh, read this three times and I still can't wrap my head around it. > What happened to keeping things simple? Me happened ;) I?ve attached a representation of my classes to help you understand. My ?cart? has 3 fields: invoice_id, offer_id, quantity Using a map seems to be a better option for me, because it ?guarantees? me uniqueness of the keys. But a workaround was needed because of the key (I needed a shared pointer as key), no big deal here. I tried the ?QSet? approach because my current table models can handle an entity (introspection is used for the headers) but not a map. If you have other approach or structures, advices are welcome (you and from others) -- Cordialement, Adnan RIHAN. Directeur-G?rant de Eolis-Software, soci?t? de services informatiques. GPG: 5675-62BA (https://keybase.io/max13/key.asc) -> Si vous n'utilisez pas GPG mais souhaitez quand m?me m?envoyer un e-mail chiffr?: (https://encrypt.to/0x567562BA). -------------- next part -------------- class Product { [...] }; class Offer { Product m_product; uint m_price; [...] }; // --- struct CartId { QWeakPointer i; QSharedPointer o; }; class Cart { CartId m_id; uint m_quantity; [...] }; class Invoice { QSet > m_cart; [...] }; From David.Sarrut at creatis.insa-lyon.fr Thu Nov 27 07:21:59 2014 From: David.Sarrut at creatis.insa-lyon.fr (David Sarrut) Date: Thu Nov 27 07:22:26 2014 Subject: [odb-users] Issue on OSX 10.10 (Yosemite) In-Reply-To: References: Message-ID: Hello Adnan and Boris, thanks for all your help. On my side, I tried to restart all from a fresh system (reinstall xcode, clean brew etc). I install odb with brew, and libodb + libodb-sqlite by compiling (clang). No problem. However, my app (compiled with clang also) seg fault with : ydDump(41632,0x7fff7710f300) malloc: *** mach_vm_map(size=3557673734211198976) failed (error code=3) *** error: can't allocate region *** set a breakpoint in malloc_error_break to debug libc++abi.dylib: terminating with uncaught exception of type std::bad_alloc: std::bad_alloc Abort trap: 6 which is probably related to the confusion between libc++ / libstdc++ (of odb brew ?). So I give up and wait the 2.4.0 ;) thanks anyway ! David On Thu, Nov 27, 2014 at 11:23 AM, Boris Kolpackov wrote: > Hi David, > > David Sarrut writes: > > > Boris : it is not clear for me what you suggested. Do you suggest I > > install odb executable with brew, but the lib odb and libodb-sqlite by > > recompiling source from the package from the web site : > > http://www.codesynthesis.com/download/odb/2.3/libodb-2.3.0.tar.gz ? > > Yes, here is a step-by-step guide on the second part (building runtimes): > > http://codesynthesis.com/pipermail/odb-users/2014-October/002156.html > > [Also remember to use clang++, not g++, to build your application]. > > Also, just for reference (if someone else is reading this), this is > how to do the same but using libstdc++ runtime instead of the > default (for clang) libc++ (this seem to be currently necessary > if you are building your application from QtCreator): > > http://codesynthesis.com/pipermail/odb-users/2014-October/002166.html > > > > Boris : does a new binary package is planned for OSX/Yosemite ? > > Yes, I was hoping not to have to build it for 2.3.0 and just do it > for the upcoming 2.4.0 release. But if the Brew approach doesn't > work, I might have to bite the bullet. Let me know if the above > doesn't work. > > Boris > -- David Sarrut, Phd Directeur de recherche CNRS CREATIS, UMR CNRS 5220, Inserm U 1044 Centre de lutte contre le cancer L?on B?rard 28 rue La?nnec, 69373 Lyon cedex 08 Tel : 04 78 78 51 51 / 06 74 72 05 42 http://www.creatis.insa-lyon.fr/~dsarrut _________________________________ "2 + 2 = 5, for extremely large values of 2" _________________________________ From axel50397 at gmail.com Thu Nov 27 07:28:41 2014 From: axel50397 at gmail.com (Adnan RIHAN) Date: Thu Nov 27 07:29:05 2014 Subject: [odb-users] Issue on OSX 10.10 (Yosemite) In-Reply-To: References: Message-ID: Hi, On 27 novembre 2014 at 13:22:51, David Sarrut (david.sarrut@creatis.insa-lyon.fr(mailto:david.sarrut@creatis.insa-lyon.fr)) wrote: > libc++abi.dylib: terminating with uncaught exception of type > std::bad_alloc: std::bad_alloc > Abort trap: 6 > > which is probably related to the confusion between libc++ / libstdc++ (of > odb brew ?). Don?t give up ! This is one of the errors I had ! And yes, it?s because of the confusion between libc++ and libstdc++. Personnaly, I was able to compile (on maverick) libodb/libodb-sqlite using libstdc++, and it works now. Just add these flags when configuring libodb*: > CC=clang CXX="clang++ -stdlib=libstdc++" LDFLAGS=-L/usr/lib LIBS=-lstdc++ And keep us updated ;) -- Cordialement, Adnan RIHAN. Directeur-G?rant de Eolis-Software, soci?t? de services informatiques. GPG: 5675-62BA (https://keybase.io/max13/key.asc) -> Si vous n?utilisez pas GPG mais souhaitez quand m?me m?envoyer un e-mail chiffr?: (https://encrypt.to/0x567562BA). From boris at codesynthesis.com Thu Nov 27 08:16:18 2014 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu Nov 27 08:24:24 2014 Subject: [odb-users] Issue on OSX 10.10 (Yosemite) In-Reply-To: References: Message-ID: Hi David, David Sarrut writes: > I install odb with brew, and libodb + libodb-sqlite by compiling (clang). > No problem. > > However, my app (compiled with clang also) seg fault with : > ydDump(41632,0x7fff7710f300) malloc: *** > mach_vm_map(size=3557673734211198976) failed (error code=3) > *** error: can't allocate region > *** set a breakpoint in malloc_error_break to debug > libc++abi.dylib: terminating with uncaught exception of type > std::bad_alloc: std::bad_alloc > Abort trap: 6 > > which is probably related to the confusion between libc++ / libstdc++ (of > odb brew ?). ODB installed from Brew should not affect how you build the runtimes and your application. Just think about it: you run the ODB compiler, it produces C++ code which you compile with Clang. The GCC used by ODB underneath and Clang that you use to build runtimes and your code are completely isolated. They cannot somehow influence each other via generated C++ source code. But it seems you still somehow end up using different runtimes. Run otool -L on your application and see if you see both libc++.dylib and libstdc++.dylib. If you do, that's the problem. Next build sizeof_funds.cxx mentioned in the step-by-step instructions, make sure that it runs, and verify with otool -L that it only links to libc++.dylib. Next run 'otool -L' on libodb.dylib and libodb-sqlite.dylib. Which runtimes to they link? One final thing: make sure you don't have some old (from Brew?) versions of libodb.dylib and libodb-sqlite.dylib installed somewhere (e.g., /usr/local/lib). Boris From picserez at gmail.com Thu Nov 27 08:31:27 2014 From: picserez at gmail.com (Erez Pics) Date: Thu Nov 27 08:37:33 2014 Subject: [odb-users] Timeout and Concurrency issues Message-ID: Hi Boris, We are using ODB for SQLite on both Mac and Windows, we recently changed our objects to work more concurrently using a write several behind caches each dedicated to DB entity group, this in turn increases the load on the database. On windows things seem to work fine but on Mac we get many timeout exceptions and objects are not persisted properly, as a first step following your example we caught a recoverable exception, added a short delay and tried again, on first look it seems to help. We will be happy to hear your opinion on these questions: 1) We know ODB objects are thread safe, maybe we did not compile the Mac libraries properly for multi thread support, to be sure, what are the compilation directives we need to use for multi threaded support on ODB libreries for mac and windows ? 2) Should we consider using more then one connection for better multi threaded performance ? [maybe consider connection pool or another object practice use?] 3) Other suggestions, advises and best practices on ODB SQLite, thread safe and concurrency ? Thank you very much for you kind help, Erez. From boris at codesynthesis.com Thu Nov 27 08:36:13 2014 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu Nov 27 08:44:19 2014 Subject: [odb-users] Timeout and Concurrency issues In-Reply-To: References: Message-ID: Hi Erez, Erez Pics writes: > On windows things seem to work fine but on Mac we get many timeout > exceptions [...] My guess would be the SQLite library you are using on MacOS is built without multi-threading support (which is the case for the default SQLite library that comes with the system). Quoting the INSTALL file from libodb-sqlite: "If you plan to access an SQLite database from multiple threads, then you will need SQLite version 3.5.0 or later built with the unlock notify feature (SQLITE_ENABLE_UNLOCK_NOTIFY) enabled." So you need to build a private copy of SQLite with SQLITE_ENABLE_UNLOCK_NOTIFY: ./configure CFLAGS="-O3 -DSQLITE_ENABLE_UNLOCK_NOTIFY=1" Then use it to re-build libodb-sqlite and your application. Boris From David.Sarrut at creatis.insa-lyon.fr Thu Nov 27 13:06:40 2014 From: David.Sarrut at creatis.insa-lyon.fr (David Sarrut) Date: Thu Nov 27 13:07:08 2014 Subject: [odb-users] Issue on OSX 10.10 (Yosemite) In-Reply-To: References: Message-ID: So, finally : I compile libodb and libodb-sqlite with clang and not gcc. I was confused by a /usr/local/bin/c++ (gcc) used instead of /usr/bin/c++ (clang), because my PATH provide /usr/local/bin before /usr/bin. Now compilations of libodb and libodb-sqlite are fine. Tests (from odb examples) run fine. Otool show links with libc++ (and no libstdc++ except for the odb compiler installed with brew). My app (linked with odb), still has issue at run time, but it should not be related with odb. So in short for users of odb with OSX Yosemite : - be sure to not mix several compilers (clang is default and should work) - install odb compiler with brew thanks to Adnan package - compile/install libodb and libodb-sqlite (or others) from sources, with default cpp compiler (clang) thank you ! David On Thu, Nov 27, 2014 at 2:16 PM, Boris Kolpackov wrote: > Hi David, > > David Sarrut writes: > > > I install odb with brew, and libodb + libodb-sqlite by compiling (clang). > > No problem. > > > > However, my app (compiled with clang also) seg fault with : > > ydDump(41632,0x7fff7710f300) malloc: *** > > mach_vm_map(size=3557673734211198976) failed (error code=3) > > *** error: can't allocate region > > *** set a breakpoint in malloc_error_break to debug > > libc++abi.dylib: terminating with uncaught exception of type > > std::bad_alloc: std::bad_alloc > > Abort trap: 6 > > > > which is probably related to the confusion between libc++ / libstdc++ (of > > odb brew ?). > > ODB installed from Brew should not affect how you build the runtimes > and your application. Just think about it: you run the ODB compiler, > it produces C++ code which you compile with Clang. The GCC used by > ODB underneath and Clang that you use to build runtimes and your > code are completely isolated. They cannot somehow influence each > other via generated C++ source code. > > But it seems you still somehow end up using different runtimes. Run > otool -L on your application and see if you see both libc++.dylib > and libstdc++.dylib. If you do, that's the problem. > > Next build sizeof_funds.cxx mentioned in the step-by-step instructions, > make sure that it runs, and verify with otool -L that it only links > to libc++.dylib. > > Next run 'otool -L' on libodb.dylib and libodb-sqlite.dylib. Which > runtimes to they link? > > One final thing: make sure you don't have some old (from Brew?) > versions of libodb.dylib and libodb-sqlite.dylib installed somewhere > (e.g., /usr/local/lib). > > Boris > -- David Sarrut, Phd Directeur de recherche CNRS CREATIS, UMR CNRS 5220, Inserm U 1044 Centre de lutte contre le cancer L?on B?rard 28 rue La?nnec, 69373 Lyon cedex 08 Tel : 04 78 78 51 51 / 06 74 72 05 42 http://www.creatis.insa-lyon.fr/~dsarrut _________________________________ "2 + 2 = 5, for extremely large values of 2" _________________________________ From picserez at gmail.com Thu Nov 27 09:23:15 2014 From: picserez at gmail.com (Erez Pics) Date: Fri Nov 28 00:20:38 2014 Subject: [odb-users] Timeout and Concurrency issues In-Reply-To: References: Message-ID: Hi Boris, Thank you very much, we will test and rebuild as you suggest. I remember your comment regarding poor concurrent model on SQLite engine, should we consider using more then one connection for better multi threaded performance ? [or consider connection pool or another object practice use?] I will be happy to hear any other suggestions, advises and best practices on ODB SQLite, thread safe and concurrency ? Thank you very VERY much for you kind help, Erez. On Thu, Nov 27, 2014 at 3:36 PM, Boris Kolpackov wrote: > Hi Erez, > > Erez Pics writes: > >> On windows things seem to work fine but on Mac we get many timeout >> exceptions [...] > > My guess would be the SQLite library you are using on MacOS is built > without multi-threading support (which is the case for the default > SQLite library that comes with the system). Quoting the INSTALL file > from libodb-sqlite: > > "If you plan to access an SQLite database from multiple threads, then > you will need SQLite version 3.5.0 or later built with the unlock > notify feature (SQLITE_ENABLE_UNLOCK_NOTIFY) enabled." > > So you need to build a private copy of SQLite with > SQLITE_ENABLE_UNLOCK_NOTIFY: > > ./configure CFLAGS="-O3 -DSQLITE_ENABLE_UNLOCK_NOTIFY=1" > > Then use it to re-build libodb-sqlite and your application. > > Boris From boris at codesynthesis.com Fri Nov 28 03:01:54 2014 From: boris at codesynthesis.com (Boris Kolpackov) Date: Fri Nov 28 03:10:00 2014 Subject: [odb-users] Timeout and Concurrency issues In-Reply-To: References: Message-ID: Hi Erez, Erez Pics writes: > I remember your comment regarding poor concurrent model on SQLite engine, > should we consider using more then one connection for better multi > threaded performance ? [or consider connection pool or another object > practice use?] ODB already does all of this for you. If you try to access the database from multiple threads simultaneously, then ODB will create and use several connections. When each thread is done with its transaction, the connection is placed into a connection pool where it can be reused by another thread. You can read about all this in Section 18.3, "SQLite Connection and Connection Factory". > I will be happy to hear any other suggestions, advises and best > practices on ODB SQLite, thread safe and concurrency ? SQLite multi-threaded concurrency is quite poor, especially if your workload is write-heavy. ODB already does everything there is to do to make it perform as well as possible, so the first thing is to see whether it is actually fast enough for your application. If it is not, then the only thing to do is to try to make your transactions as short as possible. It is common to find code that is executed inside a transaction (like object creation) that doesn't need to be there. Here is a typical example: transaction t (db.begin ()); object o ("Test", "Data"); db.persist (p); log << "auto-assigned object id " << o.id (); t.commit (); Which should be: object o ("Test", "Data"); transaction t (db.begin ()); db.persist (p); t.commit (); log << "auto-assigned object id " << o.id (); Finally, if you are getting a lot of deadlock exceptions, one thing that you can do is start write transactions as such right away with the odb::sqlite::database::begin_immediate() call. Boris