From tiagomacarios at gmail.com Fri Jul 1 00:24:52 2016 From: tiagomacarios at gmail.com (Tiago Macarios) Date: Fri Jul 1 00:25:04 2016 Subject: [odb-users] ODB + SQLite savepoints Message-ID: Hi, Looking at the documentation I don't see anything that mentions the ability to use SQLite savepoints with ODB (maybe I missed something?). Is there such functionality? https://www.sqlite.org/lang_savepoint.html Tiago From dieter.govaerts at bricsys.com Fri Jul 1 02:59:02 2016 From: dieter.govaerts at bricsys.com (Dieter Govaerts) Date: Fri Jul 1 02:59:10 2016 Subject: [odb-users] ODB + SQLite savepoints In-Reply-To: References: Message-ID: <1467356342.275213648@apps.rackspace.com> Hi Tiago, > Looking at the documentation I don't see anything that mentions the ability > to use SQLite savepoints with ODB (maybe I missed something?). Is there > such functionality? It's easy to write something yourself. This is what I use: class Savepoint { public: Savepoint(odb::database& db) : m_db(db), m_name(newName()), m_released(false) { std::stringstream ss; ss << "SAVEPOINT '" << m_name << "'"; db.execute(ss.str()); } ~Savepoint() { release(); } void release() { if (m_released) return; std::stringstream ss; ss << "RELEASE SAVEPOINT '" << m_name << "'"; m_db.execute(ss.str()); m_released = true; } void rollbackTo() { if (m_released) return; std::stringstream ss; ss << "ROLLBACK TO SAVEPOINT '" << m_name << "'"; m_db.execute(ss.str()); } class Guard { public: Guard(Savepoint& sp) : m_sp(sp), m_dismissed(false) {} ~Guard() { if (!m_dismissed) m_sp.rollbackTo(); } void dismiss() { m_dismissed = true; } private: Savepoint& m_sp; bool m_dismissed; }; private: static std::string newName() { static boost::uuids::random_generator rand_gen; return boost::uuids::to_string(rand_gen()); } private: odb::database& m_db; std::string m_name; bool m_released; }; You can implement the newName() function in any way you like. I used boost uuids for unique names. Dieter From boris at codesynthesis.com Fri Jul 1 06:40:05 2016 From: boris at codesynthesis.com (Boris Kolpackov) Date: Fri Jul 1 06:39:55 2016 Subject: [odb-users] Using ODB from DLL on Windows XP In-Reply-To: References: Message-ID: Hi Leo, Leo Ashkinaziy writes: > I pretty much pasted libodb/odb/details/win32/dll.cxx into our DllMain() > and that worked for the DLL. For the ConsoleApp I call process_start() and > thread_start() in the start of main() and thread_end() and process_end() at > the end. I'm assuming that's the correct thing to do? Yes, provided ConsoleApp doesn't load DynLib.dll. The situation you want to avoid is whan an executable that loads DynLib.dll also links to the (static) ODB libraries. Then you will end up with multiple copies of process-wide data structures and nothing good will come out of that. Boris From boris at codesynthesis.com Fri Jul 1 06:47:33 2016 From: boris at codesynthesis.com (Boris Kolpackov) Date: Fri Jul 1 06:47:22 2016 Subject: [odb-users] How to change the join type of relations in a view In-Reply-To: <1467204656624.64348@noornet.net> References: <201606281600.u5SG03ts011351@codesynthesis.com> <1467204656624.64348@noornet.net> Message-ID: Hi Ali, adanesh@noornet.net writes: > How to change the join type of relations in a view. I want to use 'inner' > instead of 'left'. This feature has been added in 2.4.0 and the manual explains how to use it. Boris From boris at codesynthesis.com Fri Jul 1 06:49:39 2016 From: boris at codesynthesis.com (Boris Kolpackov) Date: Fri Jul 1 06:49:28 2016 Subject: [odb-users] How to create an index for 'value' field in the relation table In-Reply-To: <1467204940461.26741@noornet.net> References: <201606281600.u5SG03ts011351@codesynthesis.com> <1467204940461.26741@noornet.net> Message-ID: Hi Ali, adanesh@noornet.net writes: > How to create an index for 'value' field in the relation table? Defining custom indexes on container values is not yet supported but is on our TODO list. For now you will have to execute a custom CREATE INDEX statement. Boris From boris at codesynthesis.com Fri Jul 1 07:00:08 2016 From: boris at codesynthesis.com (Boris Kolpackov) Date: Fri Jul 1 06:59:57 2016 Subject: [odb-users] ODB + SQLite savepoints In-Reply-To: <1467356342.275213648@apps.rackspace.com> References: <1467356342.275213648@apps.rackspace.com> Message-ID: Hi Dieter, Thanks for sharing your code, much appreciated. Does anyone else use/need SQLite savepoints and would like to see them supported natively in ODB? Boris From Leo_Ashkinaziy at symantec.com Fri Jul 1 11:03:15 2016 From: Leo_Ashkinaziy at symantec.com (Leo Ashkinaziy) Date: Fri Jul 1 11:03:30 2016 Subject: [odb-users] Using ODB from DLL on Windows XP In-Reply-To: References: , Message-ID: <24052C1B00C6ABD0.D720439B-0A5F-4D76-B331-245EB1D16762@mail.outlook.com> Yeah, that doesn't happen. Thank you so much for your help! -- Leo On Fri, Jul 1, 2016 at 3:40 AM -0700, "Boris Kolpackov" > wrote: Hi Leo, Leo Ashkinaziy writes: > I pretty much pasted libodb/odb/details/win32/dll.cxx into our DllMain() > and that worked for the DLL. For the ConsoleApp I call process_start() and > thread_start() in the start of main() and thread_end() and process_end() at > the end. I'm assuming that's the correct thing to do? Yes, provided ConsoleApp doesn't load DynLib.dll. The situation you want to avoid is whan an executable that loads DynLib.dll also links to the (static) ODB libraries. Then you will end up with multiple copies of process-wide data structures and nothing good will come out of that. Boris From josesilvamonard at gmail.com Fri Jul 1 16:03:13 2016 From: josesilvamonard at gmail.com (=?UTF-8?Q?Jos=C3=A9_Silva_Monard?=) Date: Sat Jul 2 03:45:44 2016 Subject: [odb-users] =?utf-8?q?invalid_use_of_incomplete_type_=E2=80=98st?= =?utf-8?q?ruct_odb=3A=3Aquery=5Fselector=5Fimpl=3Capp=5Fversion=2C?= =?utf-8?b?IChvZGI6OmRhdGFiYXNlX2lkKTV1LCAob2RiOjpjbGFzc19raW5kKTJ1?= =?utf-8?b?PuKAmQ==?= Message-ID: Hi, I'm trying to run a custom query (native view) and I am having some troubles. I have this structure: #pragma db view query("SELECT last_installed_id " \ "FROM app_version") struct app_version { #pragma db type("INTEGER") unsigned long last_installed_id; }; To use it, I tried something like this : typedef odb::result result; result r((*db).query(true)); But I got a compiler error: ..... /usr/local/include/odb/query.hxx: In instantiation of ?struct odb::query_selector?: /usr/local/include/odb/database.hxx:275:5: required by substitution of ?template odb::result odb::database::query(const odb::query&, bool) [with T = app_version]? /home/user/AppVersion/main.cpp:28:38: required from here /usr/local/include/odb/query.hxx:104:10: error: invalid use of incomplete type ?struct odb::query_selector_impl? struct query_selector: query_selector_impl::kind> ^ /usr/local/include/odb/query.hxx:84:10: note: declaration of ?struct odb::query_selector_impl? struct query_selector_impl; ..... I have tried with: (*db).query_value(), (*db).query("last_installed_id <> 0"). But the error persists. I am including following headers: #include #include #include* *#include I know there are similar questions here but this is a different case, because I did not run the odb compiler, I do not need to. I just want the ODB libraries to read data from a table. Actually this is the only query that I have. Hope you help me. Regards. From boris at codesynthesis.com Sat Jul 2 06:20:09 2016 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sat Jul 2 06:24:21 2016 Subject: [odb-users] .zip attachments are no longer accepted Message-ID: Hi, Code Synthesis mail servers (which are hosting this mailing lists) no longer accept .zip attachments. Here is the relevant fragment from the updated Subscription and Posting Guidelines[1]: 7. Preferably no attachments, strictly no .zip. If sending sample source code, test inputs, etc., unless it is fairly small (say, less than 20KB), prefer to upload the archive on the Web somewhere and put the URL into your post. If it is really small, just attach it to the email, uncompressed. Whether attaching or uploading, make sure that you do not include generated source code, object files, libraries, or executables in your archive. If you have to attach the archive to the email, use archive formats for which open-source decompression tools are widely available, such as .tar.gz, .tar.bz2, and .tar.xz. In particular, do not use .rar. While .zip also satisfies this criteria and is the only format supported by Windows out of the box, most malware these days is sent as .zip archives. As a result, our mail servers (and those of many other organizations) simply reject any mail that contains .zip attachments. So if you are only able to create a .zip archive, then you will have to upload it. [1] http://codesynthesis.com/support/posting-guidelines.xhtml Boris From boris at codesynthesis.com Sat Jul 2 06:32:23 2016 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sat Jul 2 06:32:11 2016 Subject: [odb-users] invalid use of =?utf-8?Q?i?= =?utf-8?Q?ncomplete_type_=E2=80=98struct_odb=3A=3Aquery=5Fselector=5Fimpl?= =?utf-8?B?PGFwcF92ZXJzaW9uLCAob2RiOjpkYXRhYmFzZV9pZCk1dSwgKG9kYjo6Y2xh?= =?utf-8?B?c3Nfa2luZCkydT7igJk=?= In-Reply-To: References: Message-ID: Hi, Jos? Silva Monard writes: > I'm trying to run a custom query (native view) [...] > > [...] I did not run the odb compiler, I do not need to. Yes, you do. If you want to use views, you will need to compile the headers where they are defined with the ODB compiler and include the resulting generated code into your application. If you only want to use the ODB runtime, without the ODB compiler to perform the query, then you will have to manually create the statement object, bind input/output buffers, execute the statement, and handle the result -- tedious stuff that is done for you by the generated code. Boris From adanesh at noornet.net Sun Jul 3 08:49:39 2016 From: adanesh at noornet.net (=?utf-8?B?2LnZhNuMINiv2KfZhti0?=) Date: Sun Jul 3 08:49:51 2016 Subject: [odb-users] How to change the join type of relations in a view In-Reply-To: References: <201606281600.u5SG03ts011351@codesynthesis.com> <1467204656624.64348@noornet.net>, Message-ID: <1467550179271.40852@noornet.net> Hi Boris, I had read the manual before, but I hadn't found the answer. I read it again, but I didn't find the answer! If you meant Section '10.1 Object Views' (page 149), I did it and it only chnaged the first join type to 'inner', but there are two join types and I want to change both of them. Part of the generated query in '*-odb.cxx' file is like this: ... r += "FROM \"TagIndex\""; r += " INNER JOIN \"SubjectIndex_tags\" ON"; r += "\"SubjectIndex_tags\".\"value\"=\"TagIndex\".\"id\""; r += " LEFT JOIN \"SubjectIndex\" ON"; r += "\"SubjectIndex_tags\".\"object_id\"=\"SubjectIndex\".\"id\""; For full detail of my question, please refer to my first post. If I'm wrong, please tell me which page of the manual explains how to change it. Thanks, Ali ________________________________________ From: Boris Kolpackov Sent: Friday, July 1, 2016 3:17 PM To: ??? ???? Cc: odb-users@codesynthesis.com Subject: Re: [odb-users] How to change the join type of relations in a view Hi Ali, adanesh@noornet.net writes: > How to change the join type of relations in a view. I want to use 'inner' > instead of 'left'. This feature has been added in 2.4.0 and the manual explains how to use it. Boris From josesilvamonard at gmail.com Sun Jul 3 23:20:14 2016 From: josesilvamonard at gmail.com (=?UTF-8?Q?Jos=C3=A9_Silva_Monard?=) Date: Mon Jul 4 05:31:57 2016 Subject: =?UTF-8?B?UmU6IFtvZGItdXNlcnNdIGludmFsaWQgdXNlIG9mIGluY29tcGxldGUgdHlwZSDigJhzdA==?= =?UTF-8?B?cnVjdCBvZGI6OnF1ZXJ5X3NlbGVjdG9yX2ltcGw8YXBwX3ZlcnNpb24sIChvZGI6OmRhdGFiYXNlX2lk?= =?UTF-8?B?KTV1LCAob2RiOjpjbGFzc19raW5kKTJ1PuKAmQ==?= In-Reply-To: References: Message-ID: I've compiled the header (which contains only the structure) with the ODB compiler. Now it's working fine. Thank you very much for your response. From boris at codesynthesis.com Tue Jul 5 06:49:31 2016 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue Jul 5 06:49:19 2016 Subject: [odb-users] How to change the join type of relations in a view In-Reply-To: <1467550179271.40852@noornet.net> References: <201606281600.u5SG03ts011351@codesynthesis.com> <1467204656624.64348@noornet.net> <1467550179271.40852@noornet.net> Message-ID: Hi Ali, adanesh@noornet.net writes: > r += "FROM \"TagIndex\""; > > r += " INNER JOIN \"SubjectIndex_tags\" ON"; > r += "\"SubjectIndex_tags\".\"value\"=\"TagIndex\".\"id\""; > > r += " LEFT JOIN \"SubjectIndex\" ON"; > r += "\"SubjectIndex_tags\".\"object_id\"=\"SubjectIndex\".\"id\""; Object relationships are always translated to LEFT JOIN, there is no way to change that and I believe there should be no need either. Can you show a situation where changing it to INNER JOIN will make a difference? Boris From adanesh at noornet.net Tue Jul 5 08:02:27 2016 From: adanesh at noornet.net (=?utf-8?B?2LnZhNuMINiv2KfZhti0?=) Date: Tue Jul 5 08:02:44 2016 Subject: [odb-users] How to change the join type of relations in a view In-Reply-To: References: <201606281600.u5SG03ts011351@codesynthesis.com> <1467204656624.64348@noornet.net> <1467550179271.40852@noornet.net>, Message-ID: <1467720146923.89867@noornet.net> Hi Boris, The join type has effects on the opimization of queries. --- https://www.sqlite.org/optoverview.html Section "6.1 Order of tables in a join" says: Inner joins can be freely reordered. However a left outer join is neither commutative nor associative and hence will not be reordered. Inner joins to the left and right of the outer join might be reordered if the optimizer thinks that is advantageous but the outer joins are always evaluated in the order in which they occur. --- In my case, there is a big difference in perforamnce when I use inner join instead of left join. Using inner join has one limitation, because we can't have null pointers in the list of related objects; but in my case, this feature isn't needed. Best regrards, Ali ________________________________________ From: Boris Kolpackov Sent: Tuesday, July 5, 2016 3:19 PM To: ??? ???? Cc: odb-users@codesynthesis.com Subject: Re: [odb-users] How to change the join type of relations in a view Hi Ali, adanesh@noornet.net writes: > r += "FROM \"TagIndex\""; > > r += " INNER JOIN \"SubjectIndex_tags\" ON"; > r += "\"SubjectIndex_tags\".\"value\"=\"TagIndex\".\"id\""; > > r += " LEFT JOIN \"SubjectIndex\" ON"; > r += "\"SubjectIndex_tags\".\"object_id\"=\"SubjectIndex\".\"id\""; Object relationships are always translated to LEFT JOIN, there is no way to change that and I believe there should be no need either. Can you show a situation where changing it to INNER JOIN will make a difference? Boris From macromarship at gmail.com Wed Jul 6 03:45:06 2016 From: macromarship at gmail.com (Scott Zhang) Date: Wed Jul 6 03:45:18 2016 Subject: [odb-users] ODB or mysql crash issue Message-ID: I am using ODB2.3 or ODB 2.4 on our server application which now handles about 300+ connections at same time. The server is a 4 CPUS 8G memory Centos 6.4. The mysql cpu load is about 25%. Now we get a problem is periodly we get db connection crash which calls 'abort" so our program crashed following. the gdb's bt dump is : #0 0x00000038d8232625 in raise () from /lib64/libc.so.6 #1 0x00000038d8233e05 in abort () from /lib64/libc.so.6 #2 0x00000038d8270537 in __libc_message () from /lib64/libc.so.6 #3 0x00000038d8275e66 in malloc_printerr () from /lib64/libc.so.6 #4 0x00000038d8279cdf in _int_malloc () from /lib64/libc.so.6 #5 0x00000038d827a751 in malloc () from /lib64/libc.so.6 #6 0x00007f5e07d4ed72 in my_malloc (size=240, my_flags=16) at my_malloc.c:37 #7 0x00007f5e07d7b1cf in vio_new (sd=688, type=VIO_TYPE_SOCKET, flags=3) at vio.c:152 #8 0x00007f5e07d78760 in mysql_real_connect (mysql=0x7f5ddc20a5c0, host=0x7f5e07d7d180 "localhost", user=0x22a0c98 "root", passwd=0x22a0b78 "smarthome", db=0x22a0b18 "jim_monitor2", port=0, unix_socket=0x7f5e07d7d0f4 "/var/lib/mysql/mysql.sock", client_flag=2) at client.c:2000 #9 0x00007f5e0959990b in odb::mysql::connection::connection (this=0x7f5ddc20a540, db=...) at connection.cxx:44 #10 0x00007f5e0959a0b9 in odb::mysql::connection_pool_factory::pooled_connection::pooled_connection (this=0x7f5ddc20a540, db=) at connection-factory.cxx:293 #11 0x00007f5e0959a133 in odb::mysql::connection_pool_factory::create (this=0x7f5ddcb75580) at connection-factory.cxx:165 #12 0x00007f5e0959ad94 in odb::mysql::connection_pool_factory::connect (this=0x7f5ddcb75580) at connection-factory.cxx:220 #13 0x00007f5e0959b7c3 in odb::mysql::database::connection_ (this=) at database.cxx:243 #14 0x00007f5e095a73aa in connection (this=0x7f5ddc19b880) at ../../odb/mysql/database.ixx:18 So no idea why this issue comes up. I guess maybe caused by stack corruption. Any suggestion to prevent this from happening? Thanks. Scott From boris at codesynthesis.com Thu Jul 7 08:03:01 2016 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu Jul 7 08:03:03 2016 Subject: [odb-users] ODB or mysql crash issue In-Reply-To: References: Message-ID: Hi Scott, Scott Zhang writes: > Now we get a problem is periodly we get db connection crash which calls > 'abort" so our program crashed following. > the gdb's bt dump is : > > #0 0x00000038d8232625 in raise () from /lib64/libc.so.6 > #1 0x00000038d8233e05 in abort () from /lib64/libc.so.6 > #2 0x00000038d8270537 in __libc_message () from /lib64/libc.so.6 > #3 0x00000038d8275e66 in malloc_printerr () from /lib64/libc.so.6 > #4 0x00000038d8279cdf in _int_malloc () from /lib64/libc.so.6 > #5 0x00000038d827a751 in malloc () from /lib64/libc.so.6 > #6 0x00007f5e07d4ed72 in my_malloc (size=240, my_flags=16) at my_malloc.c:37 > > [...] >From the stack trace it looks like malloc() is trying to print some diagnostics (malloc_printerr()) which itself leads to some kind of error. Some ideas: 1. Could it be that writing to STDERR leads to an abort()? E.g., it is a daemon with nothing attached to STDERR. 2. Could it be that you are running out of memory and even the diagnostics printing can't be done? 3. It could be that the heap is corrupt though I would expect malloc() to still succeed in printing the diagnostics. Could you load the debug symbols for libc.so.6 (not sure how this is done on CentOS), so that we get more information? Boris From ellav at checkpoint.com Mon Jul 4 10:47:05 2016 From: ellav at checkpoint.com (Ella Vishnevsky) Date: Thu Jul 7 08:05:49 2016 Subject: [odb-users] Creating libodb-2.4.a file Message-ID: <4E3D0839F36EF04D988AECF0CA558E15012C579CCC@DAG-EX10.ad.checkpoint.com> Hey, I've downloaded the latest odb folders and trying build the project. When running (on libodb-2.4.0\libodb-2.4.0\odb) : ./ configure Make I get libodb.a and libodb.so but libodb-2.4.so (and no libodb-2.4.a) Is there a reason? I tried running ./configure --enable-shared=false, but then libodb-2.4 is not created. Can someone please advise? From boris at codesynthesis.com Thu Jul 7 09:58:21 2016 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu Jul 7 09:58:32 2016 Subject: [odb-users] Creating libodb-2.4.a file In-Reply-To: <4E3D0839F36EF04D988AECF0CA558E15012C579CCC@DAG-EX10.ad.checkpoint.com> References: <4E3D0839F36EF04D988AECF0CA558E15012C579CCC@DAG-EX10.ad.checkpoint.com> Message-ID: Hi Ella, Ella Vishnevsky writes: > I get libodb.a and libodb.so but libodb-2.4.so (and no libodb-2.4.a) > Is there a reason? There is no need to embed the version information into the static library since when linked, everything is "copied" directly into your executable. But you are free to rename libodb.a to libodb-2.4.a, if you prefer. Boris From adanesh at noornet.net Sat Jul 9 01:42:57 2016 From: adanesh at noornet.net (=?utf-8?B?2LnZhNuMINiv2KfZhti0?=) Date: Sat Jul 9 01:43:42 2016 Subject: [odb-users] How to change the join type of relations in a view In-Reply-To: <1467720146923.89867@noornet.net> References: <201606281600.u5SG03ts011351@codesynthesis.com> <1467204656624.64348@noornet.net> <1467550179271.40852@noornet.net>, , <1467720146923.89867@noornet.net> Message-ID: <1468042977597.48680@noornet.net> Hi Boris, Could you give me any answers. Am I right? Do you have any plan to support it? Is there any workaround? Thanks, Ali ________________________________________ From: ??? ???? Sent: Tuesday, July 5, 2016 4:32 PM To: odb-users@codesynthesis.com Subject: Re: [odb-users] How to change the join type of relations in a view Hi Boris, The join type has effects on the opimization of queries. --- https://www.sqlite.org/optoverview.html Section "6.1 Order of tables in a join" says: Inner joins can be freely reordered. However a left outer join is neither commutative nor associative and hence will not be reordered. Inner joins to the left and right of the outer join might be reordered if the optimizer thinks that is advantageous but the outer joins are always evaluated in the order in which they occur. --- In my case, there is a big difference in perforamnce when I use inner join instead of left join. Using inner join has one limitation, because we can't have null pointers in the list of related objects; but in my case, this feature isn't needed. Best regrards, Ali ________________________________________ From: Boris Kolpackov Sent: Tuesday, July 5, 2016 3:19 PM To: ??? ???? Cc: odb-users@codesynthesis.com Subject: Re: [odb-users] How to change the join type of relations in a view Hi Ali, adanesh@noornet.net writes: > r += "FROM \"TagIndex\""; > > r += " INNER JOIN \"SubjectIndex_tags\" ON"; > r += "\"SubjectIndex_tags\".\"value\"=\"TagIndex\".\"id\""; > > r += " LEFT JOIN \"SubjectIndex\" ON"; > r += "\"SubjectIndex_tags\".\"object_id\"=\"SubjectIndex\".\"id\""; Object relationships are always translated to LEFT JOIN, there is no way to change that and I believe there should be no need either. Can you show a situation where changing it to INNER JOIN will make a difference? Boris From boris at codesynthesis.com Mon Jul 11 10:56:27 2016 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Jul 11 10:56:36 2016 Subject: [odb-users] How to change the join type of relations in a view In-Reply-To: <1468042977597.48680@noornet.net> References: <201606281600.u5SG03ts011351@codesynthesis.com> <1467204656624.64348@noornet.net> <1467550179271.40852@noornet.net> <1467720146923.89867@noornet.net> <1468042977597.48680@noornet.net> Message-ID: Hi Ali, I am still thinking. Conceptually, LEFT JOIN is all we need for object relationships. Practically, however, this is a different story, as you have shown. One idea I had is to add an option that will make the ODB compiler use INNER JOIN for NOT NULL object relationships (and probably containers). I still need to think some more on whether this is actually semantically equivalent so any analysis for/against is welcome. Boris From finjulhich at gmail.com Tue Jul 12 03:54:30 2016 From: finjulhich at gmail.com (MM) Date: Tue Jul 12 03:55:08 2016 Subject: [odb-users] Re: odb and gcc 6.0 In-Reply-To: References: Message-ID: On 12 February 2016 at 15:01, Boris Kolpackov wrote: > Hi Dave, > > Dave Johansen writes: > >> I just built several of the examples with sqlite and they ran just fine, so >> I'm guessing that they must have resolved that issue in Fedora and things >> appear to be working. > > Ok, that's good news. I am glad I didn't waste too much time chasing this. > > Boris > Just a little note that, while building odb with g++ (GCC) 6.1.1 20160621 (Red Hat 6.1.1-3) in c++11 mode, I got auto_ptr deprecated warnings... Perhaps there'll be work to change those occurrences, or perhaps that's already been done and I am missing to add another flag, I just thought to mention it. Rds, MM From macromarship at gmail.com Tue Jul 12 09:27:04 2016 From: macromarship at gmail.com (Scott Zhang) Date: Tue Jul 12 09:27:41 2016 Subject: [odb-users] ODB or mysql crash issue In-Reply-To: References: Message-ID: Thanks Boris for replying. The problem I found is with the log library I used " https://github.com/gabime/spdlog", looks use it down performance and introduce heap corruption. Not sure why, after I remove it, code works fine. Server runs for over 1 day without any crash issue. On Thu, Jul 7, 2016 at 8:03 PM, Boris Kolpackov wrote: > Hi Scott, > > Scott Zhang writes: > > > Now we get a problem is periodly we get db connection crash which calls > > 'abort" so our program crashed following. > > the gdb's bt dump is : > > > > #0 0x00000038d8232625 in raise () from /lib64/libc.so.6 > > #1 0x00000038d8233e05 in abort () from /lib64/libc.so.6 > > #2 0x00000038d8270537 in __libc_message () from /lib64/libc.so.6 > > #3 0x00000038d8275e66 in malloc_printerr () from /lib64/libc.so.6 > > #4 0x00000038d8279cdf in _int_malloc () from /lib64/libc.so.6 > > #5 0x00000038d827a751 in malloc () from /lib64/libc.so.6 > > #6 0x00007f5e07d4ed72 in my_malloc (size=240, my_flags=16) at > my_malloc.c:37 > > > > [...] > > From the stack trace it looks like malloc() is trying to print some > diagnostics (malloc_printerr()) which itself leads to some kind of > error. Some ideas: > > 1. Could it be that writing to STDERR leads to an abort()? E.g., it is > a daemon with nothing attached to STDERR. > > 2. Could it be that you are running out of memory and even the diagnostics > printing can't be done? > > 3. It could be that the heap is corrupt though I would expect malloc() to > still succeed in printing the diagnostics. > > Could you load the debug symbols for libc.so.6 (not sure how this is done > on CentOS), so that we get more information? > > Boris > From adanesh at noornet.net Tue Jul 12 11:14:32 2016 From: adanesh at noornet.net (=?utf-8?B?2LnZhNuMINiv2KfZhti0?=) Date: Tue Jul 12 11:15:19 2016 Subject: [odb-users] How to change the join type of relations in a view In-Reply-To: References: <201606281600.u5SG03ts011351@codesynthesis.com> <1467204656624.64348@noornet.net> <1467550179271.40852@noornet.net> <1467720146923.89867@noornet.net> <1468042977597.48680@noornet.net>, Message-ID: <1468336472067.3997@noornet.net> Hi Boris, It's a good idea. I think in this situation (i.e. not_null) this is semantically equivalent to use 'inner join' instead of 'left join'. Therefore it's better to use 'inner join' instead of 'left join' in this situation. IBM Knowledge Center says: (https://www.ibm.com/support/knowledgecenter/SSZLC2_7.0.0/com.ibm.commerce.developer.soa.doc/refs/rsdperformanceworkspaces.htm) 5- Use inner join, instead of outer join if possible. The outer join should only be used if it is necessary. Using outer join limits the database optimization options which typically results in slower SQL execution. For object relationships, we can already change the join type in views, therefore this option (i.e. not_null) must set the default join type. #pragma db view object(name1) object(name2 [= alias] [join-type] [: join-condition]) But for containers, there is already no way to change the join type. Therefore if 'value_not_null' is used, 'inner' must be used instead of 'left'. The benefit of your idea is that is already supported by odb pragma language and there is no need to add anything to it. e.g.: #pragma db object class employee { ... #pragma db not_null shared_ptr current_employer_; #pragma db value_not_null std::vector> previous_employers_; }; Ali ________________________________________ From: Boris Kolpackov Sent: Monday, July 11, 2016 7:26 PM To: ??? ???? Cc: odb-users@codesynthesis.com Subject: Re: [odb-users] How to change the join type of relations in a view Hi Ali, I am still thinking. Conceptually, LEFT JOIN is all we need for object relationships. Practically, however, this is a different story, as you have shown. One idea I had is to add an option that will make the ODB compiler use INNER JOIN for NOT NULL object relationships (and probably containers). I still need to think some more on whether this is actually semantically equivalent so any analysis for/against is welcome. Boris From odb at a-cunningham.com Tue Jul 12 12:43:13 2016 From: odb at a-cunningham.com (Andrew Cunningham) Date: Tue Jul 12 12:43:58 2016 Subject: [odb-users] "threads-sqlite" test case takes an extraordinary long time to execute Message-ID: Hi Boris, I was running the "threads-sqlite-vc12" testcase (Windows x64/VS 2013) and it takes a very long time to complete ( it does finally finish). On the order of 45 minutes on a fast-ish machine. Profiling it with Intel Amplifier shows that over 90% of the wall-clock time is spent in threads waiting on synchronization objects. <10% of the time is spent actually doing anything. Andrew From tomstoffer at gmail.com Tue Jul 12 18:41:16 2016 From: tomstoffer at gmail.com (Tom Stoffer) Date: Tue Jul 12 18:42:01 2016 Subject: [odb-users] Problem with many-to-many example Message-ID: Hi, I have been diving deep into ODB over the past few days. Trying to wrap my head around the various relation types etc. I have copied the following code from your example in the manual: ======================================================= class project; #pragma db object class employee { friend class odb::access; public: employee() {}; #pragma db id std::string uid; #pragma db value_not_null unordered std::vector > projects_; }; #pragma db object class project { friend class odb::access; public: project () {}; #pragma db id std::string uid; #pragma db value_not_null inverse(projects_) std::vector> employees_; }; ======================================================= However it does not compile on OSX with Xcode, I getting a compile error: No matching conversion for functional-style cast from 'typename object_traits::pointer_type' (aka 'employee *') to 'ptr_traits::pointer_type' (aka 'weak_ptr') And I have noticed the comment: // If a compiler error points to the line below, then // it most likely means that a pointer used in a member // cannot be initialized from an object pointer. I have read all through this mailing list for similar issues and everything in the manual related, still no luck. Im sure its something simple, please could you advise. The one thing that does get it to compile is if I add: pointer(std::shared_ptr) To the pragma for employee, but I?m not sure why, and actually I don?t think this will work for my situation as the class which will be needed to have a many-to-many also inheriting from an abstract polymorphism. As soon as I introduce this change, I start getting other compiler errors to do with shared_ptr not being supported. Tom From boris at codesynthesis.com Wed Jul 13 06:21:54 2016 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed Jul 13 06:21:53 2016 Subject: [odb-users] Problem with many-to-many example In-Reply-To: References: Message-ID: Hi Tom, Tom Stoffer writes: > The one thing that does get it to compile is if I add: > pointer(std::shared_ptr) To the pragma for employee, but I?m not sure why, > and actually I don?t think this will work for my situation as the class > which will be needed to have a many-to-many also inheriting from an abstract > polymorphism. As soon as I introduce this change, I start getting other > compiler errors to do with shared_ptr not being supported. If you want to use bi-directional relationships like these then you will need the shared_ptr/weak_ptr semantics and you will have to make shared_ptr the object pointer for all the objects involved. I would just make all the objects consistently use shared_ptr, it should get rid of any compile errors. See Section 3.3, "Object and View Pointers" in the manual for details. Boris From tomstoffer at gmail.com Wed Jul 13 06:32:54 2016 From: tomstoffer at gmail.com (Tom Stoffer) Date: Wed Jul 13 06:33:31 2016 Subject: [odb-users] Problem with many-to-many example In-Reply-To: References: Message-ID: Thanks for the clear reply Boris. Would it not make sense to update the documentation in the relationships chapter to include the " pragma db object pointer(std::shared_ptr)" for those classes so the code can compile? On Wed, Jul 13, 2016 at 11:21 AM, Boris Kolpackov wrote: > Hi Tom, > > Tom Stoffer writes: > > > The one thing that does get it to compile is if I add: > > pointer(std::shared_ptr) To the pragma for employee, but I?m not sure > why, > > and actually I don?t think this will work for my situation as the class > > which will be needed to have a many-to-many also inheriting from an > abstract > > polymorphism. As soon as I introduce this change, I start getting other > > compiler errors to do with shared_ptr not being supported. > > If you want to use bi-directional relationships like these then you will > need the shared_ptr/weak_ptr semantics and you will have to make shared_ptr > the object pointer for all the objects involved. I would just make all the > objects consistently use shared_ptr, it should get rid of any compile > errors. > See Section 3.3, "Object and View Pointers" in the manual for details. > > Boris > From boris at codesynthesis.com Wed Jul 13 11:53:11 2016 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed Jul 13 11:53:09 2016 Subject: [odb-users] Re: odb and gcc 6.0 In-Reply-To: References: Message-ID: Hi, MM writes: > Just a little note that, while building odb with g++ (GCC) 6.1.1 > 20160621 (Red Hat 6.1.1-3) in c++11 mode, I got auto_ptr deprecated > warnings... > Perhaps there'll be work to change those occurrences, or perhaps > that's already been done and I am missing to add another flag, I just > thought to mention it. Yes, these warnings are becoming the biggest problem in supporting both C++98 and 11. The plan is to release the next version of ODB as is and then drop C++98 support. In the meantime, you can use the -Wno-deprecated option to suppress them. Boris From boris at codesynthesis.com Wed Jul 13 12:00:30 2016 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed Jul 13 12:00:35 2016 Subject: [odb-users] "threads-sqlite" test case takes an extraordinary long time to execute In-Reply-To: References: Message-ID: Hi Andrew, Andrew Cunningham writes: > I was running the "threads-sqlite-vc12" testcase (Windows x64/VS 2013) > and it takes a very long time to complete ( it does finally finish). On the > order of 45 minutes on a fast-ish machine. It takes a few minutes on our test VM (Windows 7) and doesn't seem to differ much from VC version to version. Is there perhaps something special you did when building SQLite? Boris From Andrew.Cunningham at esi-group.com Wed Jul 13 12:11:56 2016 From: Andrew.Cunningham at esi-group.com (Andrew Cunningham) Date: Thu Jul 14 11:28:39 2016 Subject: [odb-users] "threads-sqlite" test case takes an extraordinary long time to execute In-Reply-To: References: Message-ID: I am using SQLite "sqlite-amalgamation-3120200" The only additional flag when compiling SQLite is "SQLITE_ENABLE_UNLOCK_NOTIFY" and "LIBODB_SQLITE_HAVE_UNLOCK_NOTIFY" in libodbsqlite It's clearly some odd interaction with the internal SQLite thread-safe operations. This is reproducible on multiple machines and VS versions. Since you can't reproduce I will have to dig into the Intel Amplifier results a bit more to try and see what is happening. > -----Original Message----- > From: Boris Kolpackov [mailto:boris@codesynthesis.com] > Sent: Wednesday, July 13, 2016 9:01 AM > To: Andrew Cunningham > Cc: odb-users@codesynthesis.com > Subject: Re: [odb-users] "threads-sqlite" test case takes an extraordinary long > time to execute > > Hi Andrew, > > Andrew Cunningham writes: > > > I was running the "threads-sqlite-vc12" testcase (Windows x64/VS > > 2013) and it takes a very long time to complete ( it does finally > > finish). On the order of 45 minutes on a fast-ish machine. > > It takes a few minutes on our test VM (Windows 7) and doesn't seem to differ > much from VC version to version. Is there perhaps something special you did > when building SQLite? > > Boris From boris at codesynthesis.com Thu Jul 14 11:34:45 2016 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu Jul 14 11:34:41 2016 Subject: [odb-users] Problem with many-to-many example In-Reply-To: References: Message-ID: Hi Tom, Tom Stoffer writes: > Would it not make sense to update the documentation in the relationships > chapter to include the " > > pragma db object pointer(std::shared_ptr)" for those classes so the code > can compile? There is always a balancing act between trying to be complete and not confusing people. Plus, std::shared_ptr is not the only option, you could also use tr1, boost, or Qt equivalents. I think the comment in the code sent you in the right direction. Boris From boris at codesynthesis.com Thu Jul 14 11:52:49 2016 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu Jul 14 11:53:09 2016 Subject: [odb-users] "threads-sqlite" test case takes an extraordinary long time to execute In-Reply-To: References: Message-ID: Hi Andrew, Andrew Cunningham writes: > I am using SQLite "sqlite-amalgamation-3120200" I checked and we are (still) using 3.7.5. You can try that in case SQLite folks broke something. > The only additional flag when compiling SQLite is > "SQLITE_ENABLE_UNLOCK_NOTIFY" We have quite a few more defines. Check SQLite the project files in the etc/ directory in libodb-sqlite. Boris From odb at a-cunningham.com Thu Jul 14 12:52:15 2016 From: odb at a-cunningham.com (Andrew Cunningham) Date: Thu Jul 14 12:53:00 2016 Subject: [odb-users] "threads-sqlite" test case takes an extraordinary long time to execute In-Reply-To: References: Message-ID: With my build of SQLite , using all your SQLite #defines, the test ran in 1243.1s. ( not quite as long as I originally said, but still unexpectedly long) It's pretty clear based on profiling that the time is spent in synchronization objects waiting on disk operations to complete. I changed the Journal mode "PRAGMA journal_mode = MEMORY" and the execution time was 342s (4x faster). Still surprisingly long. The CPU is idle nearly 95% of the time. On Thu, Jul 14, 2016 at 8:52 AM, Boris Kolpackov wrote: > Hi Andrew, > > Andrew Cunningham writes: > > > I am using SQLite "sqlite-amalgamation-3120200" > > I checked and we are (still) using 3.7.5. You can try that in case > SQLite folks broke something. > > > > The only additional flag when compiling SQLite is > > "SQLITE_ENABLE_UNLOCK_NOTIFY" > > We have quite a few more defines. Check SQLite the project files in the > etc/ directory in libodb-sqlite. > > Boris > From odb at a-cunningham.com Thu Jul 14 14:16:11 2016 From: odb at a-cunningham.com (Andrew Cunningham) Date: Thu Jul 14 14:16:56 2016 Subject: [odb-users] "threads-sqlite" test case takes an extraordinary long time to execute In-Reply-To: References: Message-ID: Not surprisingly, conn_.wait() is where all the "waiting" time is spent. For example, this is one particular area where a lot of "waiting" is occurring.... the top of this stack is odb::sqlite::update_statement::execute 650 #ifdef LIBODB_SQLITE_HAVE_UNLOCK_NOTIFY 651 sqlite3* h (conn_.handle ()); 652 while ((e = sqlite3_step (stmt_)) == SQLITE_LOCKED) 653 { 654 if (sqlite3_extended_errcode (h) != SQLITE_LOCKED_SHAREDCACHE) 655 break; 656 657 sqlite3_reset (stmt_); 658 conn_.wait (); 659 } 660 #else 661 e = sqlite3_step (stmt_); 662 #endif On Thu, Jul 14, 2016 at 9:52 AM, Andrew Cunningham wrote: > With my build of SQLite , using all your SQLite #defines, the test ran in > 1243.1s. ( not quite as long as I originally said, but still unexpectedly > long) > > It's pretty clear based on profiling that the time is spent in > synchronization objects waiting on disk operations to complete. > > I changed the Journal mode > > "PRAGMA journal_mode = MEMORY" > > and the execution time was 342s (4x faster). Still surprisingly long. The > CPU is idle nearly 95% of the time. > > > > > On Thu, Jul 14, 2016 at 8:52 AM, Boris Kolpackov > wrote: > >> Hi Andrew, >> >> Andrew Cunningham writes: >> >> > I am using SQLite "sqlite-amalgamation-3120200" >> >> I checked and we are (still) using 3.7.5. You can try that in case >> SQLite folks broke something. >> >> >> > The only additional flag when compiling SQLite is >> > "SQLITE_ENABLE_UNLOCK_NOTIFY" >> >> We have quite a few more defines. Check SQLite the project files in the >> etc/ directory in libodb-sqlite. >> >> Boris >> > > From boris at codesynthesis.com Fri Jul 15 11:25:11 2016 From: boris at codesynthesis.com (Boris Kolpackov) Date: Fri Jul 15 11:25:15 2016 Subject: [odb-users] "threads-sqlite" test case takes an extraordinary long time to execute In-Reply-To: References: Message-ID: Hi Andrew, Andrew Cunningham writes: > With my build of SQLite , using all your SQLite #defines, the test ran in > 1243.1s. ( not quite as long as I originally said, but still unexpectedly > long) Is this a release build of SQLite? If it is, can you try 3.7.5 so that we have the same baseline. Boris From odb at a-cunningham.com Fri Jul 15 13:39:12 2016 From: odb at a-cunningham.com (Andrew Cunningham) Date: Fri Jul 15 13:39:58 2016 Subject: [odb-users] "threads-sqlite" test case takes an extraordinary long time to execute In-Reply-To: References: Message-ID: Hi Boris, I realize chasing SQLite versions is a moving target but I think most of your users will be on a version more current than 3.7.5 ( from 2011?) Can you try with the latest version 3.13.0? I updated to that version and found no change in behavior from 3.12. It does seems like a complete hassle to find older versions of SQLite like 3.7.5. http://stackoverflow.com/questions/615213/where-can-one-find-source-archives-of-old-sqlite-versions Andrew On Fri, Jul 15, 2016 at 8:25 AM, Boris Kolpackov wrote: > Hi Andrew, > > Andrew Cunningham writes: > > > With my build of SQLite , using all your SQLite #defines, the test ran in > > 1243.1s. ( not quite as long as I originally said, but still unexpectedly > > long) > > Is this a release build of SQLite? If it is, can you try 3.7.5 so that > we have the same baseline. > > Boris > From tiagomacarios at gmail.com Mon Jul 18 18:16:42 2016 From: tiagomacarios at gmail.com (Tiago Macarios) Date: Mon Jul 18 18:17:19 2016 Subject: [odb-users] ODB_MSC_VER Message-ID: Hi, Just out of curiosity why some of the test pass the Visual Studio version to odb? odb.exe --std c++11 --database sqlite --generate-query --generate-schema --at-once --table-prefix evo_add_c_ --init-changelog --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -DDATABASE_SQLITE -I$(SolutionDir)\..\libcommon test1.hxx Tiago From boris at codesynthesis.com Tue Jul 19 11:29:59 2016 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue Jul 19 11:30:00 2016 Subject: [odb-users] "threads-sqlite" test case takes an extraordinary long time to execute In-Reply-To: References: Message-ID: Hi Andrew, Andrew Cunningham writes: > Can you try with the latest version 3.13.0? I updated to that version and > found no change in behavior from 3.12. Before I do that, can you confirm that this is a release build of SQLite you are testing? Boris From boris at codesynthesis.com Tue Jul 19 11:37:20 2016 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue Jul 19 11:37:13 2016 Subject: [odb-users] ODB_MSC_VER In-Reply-To: References: Message-ID: Hi Tiago, Tiago Macarios writes: > Just out of curiosity why some of the test pass the Visual Studio version > to odb? > > odb.exe [...] -DODB_MSC_VER=1700 [...] In tests when compiling a header with the ODB compiler we often need to know whether this is a C++11 build or not. ODB_MSC_VER is how we convey this information when building with VS. You can see how it is used in odb-tests/libcommon/common/config-vc.h. Boris From tiagomacarios at gmail.com Tue Jul 19 12:31:00 2016 From: tiagomacarios at gmail.com (Tiago Macarios) Date: Tue Jul 19 12:31:37 2016 Subject: [odb-users] ODB_MSC_VER In-Reply-To: References: Message-ID: Thanks Boris On Tue, Jul 19, 2016 at 8:37 AM, Boris Kolpackov wrote: > Hi Tiago, > > Tiago Macarios writes: > > > Just out of curiosity why some of the test pass the Visual Studio version > > to odb? > > > > odb.exe [...] -DODB_MSC_VER=1700 [...] > > In tests when compiling a header with the ODB compiler we often need to > know whether this is a C++11 build or not. ODB_MSC_VER is how we convey > this information when building with VS. You can see how it is used in > odb-tests/libcommon/common/config-vc.h. > > Boris > From mgirard at theleme.com Tue Jul 19 04:19:36 2016 From: mgirard at theleme.com (=?iso-8859-1?Q?Micka=EBl_Girard?=) Date: Wed Jul 20 10:05:28 2016 Subject: [odb-users] Unable to use odb::nullable on id table Message-ID: <000201d1e196$4a28d8f0$de7a8ad0$@theleme.com> Hello, I am using libOdb oracle version 2.4.0. In my database, I have a table with Id (the Primary key) that is created with a trigger. When inserting, if id is null, id is get from a table sequence. This is an extract of the trigger table : IF INSERTING THEN IF (:NEW.ID IS NULL) THEN SELECT new_id INTO :NEW.ID FROM DUAL; END IF; END IF; So I want to have my id at null when I create my table. I have tried to use it as follow : #pragma db column("ID") id odb::nullable m_adresse_mail_id; and I have the following compiling error : error: value type that is used as object id in persistent class with session support does not define the less than (<) comparison Is it possible to have a nullable id ? Thank you, Best regards, Cordialement, Micka?l Girard Equipe d?veloppement 1, rue des Ar?nes 49100 ANGERS T?l : 33 (0)2 41 22 15 51 Fax : 33 (0)2 41 22 15 52 E-mail : mgirard@theleme.com Informations : info@theleme.com Assistance : assistance@theleme.com ---------------------------------------------------------------------------- ----------------------- Ce message et toutes les pi?ces jointes sont confidentiels et ?tablis ? l'intention exclusive de ses destinataires. Toute utilisation ou diffusion non autoris?e est interdite. Tout message ?lectronique est susceptible d'alt?ration. La Soci?t? Th?l?me d?cline toute responsabilit? au titre de ce message s'il a ?t? alt?r?, d?form? ou falsifi?. Ce message et ses pi?ces jointes ne contiennent, ? priori, pas de virus. Il est de votre responsabilit? de vous en assurer avant de les ouvrir. ---------------------------------------------------------------------------- ----------------------- This message and any attachments are confidential and intended solely for the recipients. Any unauthorised use or dissemination is prohibited. E-mails are susceptible to tampering. Th?l?me declines all responsability for the message if tampered, changed or falsified. We believe, but do not warrant, that this e-mail and any attachments, are virus free. You should take full responsability for virus checking. ---------------------------------------------------------------------------- ----------------------- Conform?ment ? la Loi Informatique et Libert?s du 06 janvier 1978 modifi?e en 2004, les donn?es recueillies seront utilis?es par THELEME pour le traitement de vos demandes techniques et commerciales. Vous disposez, sur simple demande ?crite, d'un droit d'acc?s de modification, de rectification et de suppression des informations nominatives vous concernant. Pour ce faire, envoyer un courrier ? THELEME 1 rue des Ar?nes 49100 Angers ou un mail ? info@theleme.com. Vous pouvez ?galement, pour des motifs l?gitimes, vous opposer au traitement des donn?es vous concernant. ---------------------------------------------------------------------------- ----------------------- Afin de contribuer au respect de l'environnement, merci de n'imprimer ce mail qu'en cas de n?cessit? From Andrew.Cunningham at esi-group.com Tue Jul 19 12:05:02 2016 From: Andrew.Cunningham at esi-group.com (Andrew Cunningham) Date: Wed Jul 20 10:05:29 2016 Subject: [odb-users] "threads-sqlite" test case takes an extraordinary long time to execute In-Reply-To: References: Message-ID: Do you mean, "am I compiling in release vs debug mode". Then yes, in release mode (Visual Studio 2013/x64) using default options. If you mean, am I using a release of SQLite, then yes, I downloaded the "official" 3.13.0 "amalgamation" zip file from sqlite.org and used the unmodified sqlite.c from that. > -----Original Message----- > From: Boris Kolpackov [mailto:boris@codesynthesis.com] > Sent: Tuesday, July 19, 2016 8:30 AM > To: Andrew Cunningham > Cc: odb-users@codesynthesis.com > Subject: Re: [odb-users] "threads-sqlite" test case takes an extraordinary long > time to execute > > Hi Andrew, > > Andrew Cunningham writes: > > > Can you try with the latest version 3.13.0? I updated to that version > > and found no change in behavior from 3.12. > > Before I do that, can you confirm that this is a release build of SQLite you are > testing? > > Boris From boris at codesynthesis.com Wed Jul 20 13:15:08 2016 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed Jul 20 13:15:10 2016 Subject: [odb-users] Unable to use odb::nullable on id table In-Reply-To: <000201d1e196$4a28d8f0$de7a8ad0$@theleme.com> References: <000201d1e196$4a28d8f0$de7a8ad0$@theleme.com> Message-ID: Hi Micka?l, Micka?l Girard writes: > In my database, I have a table with Id (the Primary key) that is created > with a trigger. When inserting, if id is null, id is get from a table > sequence. You probably already know this: ODB can do all of this without the trigger if you mark the id as 'auto'. > #pragma db column("ID") id > odb::nullable m_adresse_mail_id; > > and I have the following compiling error : > > error: value type that is used as object id in persistent class with session > support does not define the less than (<) comparison I think you are the first person trying to use nullable for an id data member and you've uncovered a bug that doesn't really have anything to do with the problem in question. I've fixed it and here is the patch: http://scm.codesynthesis.com/?p=odb/libodb.git;a=commit;h=81da3ee11305296c0ec8300b35ef70d791cb3c77 While I think the basic functionality that you are looking for will now work (i.e., you will be able to pass NULL to the database), there is a big problem with this approach: the id that is assigned by the database won't be returned to the caller and won't be stored in the object. This is the advantage of the 'auto' approach I've mentioned above: it takes care of all of this. Boris From boris at codesynthesis.com Fri Jul 22 11:40:20 2016 From: boris at codesynthesis.com (Boris Kolpackov) Date: Fri Jul 22 11:41:18 2016 Subject: [odb-users] "threads-sqlite" test case takes an extraordinary long time to execute In-Reply-To: References: Message-ID: Hi Andrew, Ok, I've tested the latest ODB pre-release with SQLite 3.13.0 on Visual Studio 12/2013. I've built everything 64-bit/Release. On my Win7 VM with 2 vCPUs the threads test took 1m40s. CPU utilization was ~50% each which makes perfect sense since the test is very write heavy (and since writes need exclusive locks, only one CPU can actually do anything most of the time). My guesses as to what could be going wrong on your side: 1. Something wrong with the way you built things. 2. Something wrong with your Windows setup. 3. Some interaction between your Windows setup and SQLite. To eliminate/confirm #1 (most likely) I can zip up the test and all the DLLs that I've built and you can try to run it. Let me know if you would like to give this a go. Boris From odb at a-cunningham.com Fri Jul 22 12:43:46 2016 From: odb at a-cunningham.com (Andrew Cunningham) Date: Fri Jul 22 12:44:32 2016 Subject: [odb-users] "threads-sqlite" test case takes an extraordinary long time to execute In-Reply-To: References: Message-ID: Hi Boris, As you said, sending me a zip of test+DLLs would be worth looking at. I can't imagine what is different to our setup. Andrew On Fri, Jul 22, 2016 at 8:40 AM, Boris Kolpackov wrote: > Hi Andrew, > > Ok, I've tested the latest ODB pre-release with SQLite 3.13.0 on > Visual Studio 12/2013. I've built everything 64-bit/Release. On > my Win7 VM with 2 vCPUs the threads test took 1m40s. CPU utilization > was ~50% each which makes perfect sense since the test is very write > heavy (and since writes need exclusive locks, only one CPU can actually > do anything most of the time). > > My guesses as to what could be going wrong on your side: > > 1. Something wrong with the way you built things. > > 2. Something wrong with your Windows setup. > > 3. Some interaction between your Windows setup and SQLite. > > To eliminate/confirm #1 (most likely) I can zip up the test and > all the DLLs that I've built and you can try to run it. Let me > know if you would like to give this a go. > > Boris > From Steve.Hales at garmin.com Fri Jul 29 21:01:41 2016 From: Steve.Hales at garmin.com (Hales, Steve) Date: Mon Aug 1 11:45:02 2016 Subject: [odb-users] ODB compiler support for variable templates? Message-ID: The ODB 2.4.0 compiler on Mac OS fails to compile the code below: // Begin code #include template static const auto theGuidRegexStr = std::basic_string{}; template <> static const auto theGuidRegexStr = std::basic_string { "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}" }; template <> static const auto theGuidRegexStr = std::basic_string { L"[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}" }; // End code Does the 2.4.0 compiler support C++ 14 variable templates? Thanks, Steve ________________________________ CONFIDENTIALITY NOTICE: This email and any attachments are for the sole use of the intended recipient(s) and contain information that may be Garmin confidential and/or Garmin legally privileged. If you have received this email in error, please notify the sender by reply email and delete the message. Any disclosure, copying, distribution or use of this communication (including attachments) by someone other than the intended recipient is prohibited. Thank you.