From boris at codesynthesis.com Mon Oct 4 12:03:11 2021 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Oct 4 12:01:24 2021 Subject: [odb-users] Web http client as database runtime In-Reply-To: References: <8dbdbc68-b2a4-471d-61b7-266f69705874@rihan.fr> Message-ID: Adnan RIHAN writes: > I'm having a hard time understanding what you mean by "present your > web API as an existing database API", maybe you're suggesting the same > thing I was thinking about (but I certainly wasn't clear enough). By way of example, there is the MySQL database which defines a C API for its client library (libmysqlclient). MariaDB provides exactly the same API using its own client library and so can be used with ODB in place of MySQL. > I wasn't talking about a complete engine, but just reusing the ODB > database API (persist(), find(), etc?) and reimplement them as web > calls instead of database calls. I think you meant the same? Not quite, but this is also an option, though probably an even harder one. For one, you will also need to customize the ODB compiler. From a.ranfone at gyala.it Mon Oct 11 10:28:36 2021 From: a.ranfone at gyala.it (Andrea Ranfone) Date: Mon Oct 11 12:39:40 2021 Subject: [odb-users] ERROR: prepared statement already exists Message-ID: <60e69b4a-7dfc-5047-403b-b3f3bf7ae5a6@gyala.it> Hi everyone, I'm using odb version 2.4.0 with PostgreSQL 12 database and I stepped on a strange situation when retrying a transaction after a deadlock exception. When a recoverable exception occurs and the transaction is rolled back, it seems that the deallocation of the prepared statement created in the failed transaction fails with the following error: ERROR:? current transaction is aborted, commands ignored until end of transaction block STATEMENT:? deallocate "query_class_name" So when I try to run a new transaction to retry the failed transaction I get the following error: ERROR:? prepared statement "query_class_name" already exists Why the prepared statement is not being rolled-back with the entire transaction? Is there something I'm missing about odb::recoverable exception handling? The following is the code snippet I'm using to handle a recoverable exception: template void callFunctionWithTransactionRetry(F &&function, const odb::connection_ptr &connectionPtr) { ? auto transactionMaxRetryCount =5; ? for (unsigned short iteration(0);; iteration++) { ??? try { ????? odb::transaction t(connectionPtr->begin()); ????? function(); ????? t.commit(); ????? break; ??? } catch (odb::recoverable &e) { ????? if (iteration >= transactionMaxRetryCount) { ??????? throw_with_trace(MaxRetryExceededException( ??????????? "Max retry exceeded performing database operation. Error: " + std::string(e.what()))); ????? } else { ??????? Logger::get().log_debug( ??????????? "A recoverable error occurred performing db operation: " + std::string(e.what()) + ". Trying again."); ??????? continue; ????? } ??? } ? } } Regards, Andrea Ranfone From boris at codesynthesis.com Mon Oct 11 12:49:47 2021 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Oct 11 12:47:57 2021 Subject: [odb-users] ERROR: prepared statement already exists In-Reply-To: <60e69b4a-7dfc-5047-403b-b3f3bf7ae5a6@gyala.it> References: <60e69b4a-7dfc-5047-403b-b3f3bf7ae5a6@gyala.it> Message-ID: Andrea Ranfone writes: > I'm using odb version 2.4.0 with PostgreSQL 12 database and I stepped on a > strange situation when retrying a transaction after a deadlock exception. > > When a recoverable exception occurs and the transaction is rolled back, it > seems that the deallocation of the prepared statement created in the failed > transaction fails with the following error: > > ERROR: current transaction is aborted, commands ignored until end of > transaction block > STATEMENT: deallocate "query_class_name" > > So when I try to run a new transaction to retry the failed transaction I get > the following error: > > ERROR: prepared statement "query_class_name" already exists I believe this is already fixed for the 2.5.0 release, see: https://git.codesynthesis.com/cgit/odb/libodb-pgsql/commit/?id=231d0222fb75 https://git.codesynthesis.com/cgit/odb/libodb-pgsql/commit/?id=5f24741c88cf You can try it using the latest pre-release version: https://codesynthesis.com/products/odb/doc/install-build2.xhtml From a.ranfone at gyala.it Tue Oct 12 04:59:21 2021 From: a.ranfone at gyala.it (Andrea Ranfone) Date: Tue Oct 12 09:29:15 2021 Subject: [odb-users] ERROR: prepared statement already exists In-Reply-To: References: <60e69b4a-7dfc-5047-403b-b3f3bf7ae5a6@gyala.it> Message-ID: <90d4cd21-2621-5029-f2e3-066e3948c788@gyala.it> Hi Boris, thanks for your fast reply. I switched to version 2.5.0-b.19 but it seems the problem is permanent only with tables for which I specified a FOR UPDATE clause on SELECT, In other cases the fix is working fine. Do you think that the only possible solution would be setting up a new connection when a duplicate prepared statement exception occurs? Regard, Andrea From boris at codesynthesis.com Tue Oct 12 09:42:59 2021 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue Oct 12 09:41:08 2021 Subject: [odb-users] ERROR: prepared statement already exists In-Reply-To: <90d4cd21-2621-5029-f2e3-066e3948c788@gyala.it> References: <60e69b4a-7dfc-5047-403b-b3f3bf7ae5a6@gyala.it> <90d4cd21-2621-5029-f2e3-066e3948c788@gyala.it> Message-ID: Andrea Ranfone writes: > thanks for your fast reply. I switched to version 2.5.0-b.19 but it seems > the problem is permanent only with tables for which I specified a FOR UPDATE > clause on SELECT, In other cases the fix is working fine. I am not sure I follow. Are you saying that the fix does not work if the query that causes the transaction to abort is SELECT FOR UPDATE? > Do you think that the only possible solution would be setting up a new > connection when a duplicate prepared statement exception occurs? It's definitely not the only possible solution but it's probably the simplest and, assuming that such aborts are not too frequent, adequate. See the comment in the fix for background: https://git.codesynthesis.com/cgit/odb/libodb-pgsql/commit/?id=231d0222fb75 One thing you could try is to prepare (and thus deallocate) the query yourself, outside of any transaction. See "Prepared Queries" in the manual for details. From Angelika.Haenel at minebea-intec.com Mon Oct 25 03:49:14 2021 From: Angelika.Haenel at minebea-intec.com (Haenel, Angelika) Date: Mon Oct 25 09:42:44 2021 Subject: [odb-users] odb version Message-ID: Dear all, our team uses the odb-version 2.5.0-b.19 downloaded and build via cppget.org. But it seems to be, that now only the newer odb-version 2.5.0-b.21 is available and only one college got these newer version, which leads to error "ODB runtime version mismatch". Is there a way to install the older b.19 version? Freundliche Gr??e | Best regards Angelika H?nel R&D Software Design [Unbenannt-1] Minebea Intec Aachen GmbH & Co. KG Am Gut Wolf 11 D-52070 Aachen, Germany Phone +49.241.1827.228 Fax +49.241.1827.210 Web www.minebea-intec.com The company is a Limited Company. The personal liable and sole managing partner: Minebea Intec Aachen Verwaltungs-GmbH Registered office of company: Aachen Court of registration: Local Court Aachen HRA-No. 976 Minebea Intec Aachen Verwaltungs-GmbH Registered office of company: Aachen Court of registration: Local Court Aachen HRB-No. 1126 Managing Director: Frank Wieland, Dr. Karl Christoph Sommer [facebook] [google_plus] [twitter] [youtube_2] [xing] [linkedin] ________________________________________________________________________________________ Please consider the environment before printing this e-mail The information contained in this e-mail is intended only for the individual addressed. If you have received this e-mail by mistake, please notify us immediately by return reply. Be sure to delete this message and all its attachments from your system. Please note that any unauthorized review, copying, disclosure or any other use of this information is strictly prohibited. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed,received late or incomplete, or could contain viruses. The sender therefore does not accept any liability for any error or omission in the content of this message, either of which are caused as a result of e-mail transmission. If verification is required, please request a hard-copy version. Thank you. -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.png Type: image/png Size: 11555 bytes Desc: image001.png Url : https://codesynthesis.com/pipermail/odb-users/attachments/20211025/9e1ea84a/image001-0001.png -------------- next part -------------- A non-text attachment was scrubbed... Name: image002.jpg Type: image/jpeg Size: 1636 bytes Desc: image002.jpg Url : https://codesynthesis.com/pipermail/odb-users/attachments/20211025/9e1ea84a/image002-0001.jpg -------------- next part -------------- A non-text attachment was scrubbed... Name: image003.jpg Type: image/jpeg Size: 1903 bytes Desc: image003.jpg Url : https://codesynthesis.com/pipermail/odb-users/attachments/20211025/9e1ea84a/image003-0001.jpg -------------- next part -------------- A non-text attachment was scrubbed... Name: image004.jpg Type: image/jpeg Size: 1798 bytes Desc: image004.jpg Url : https://codesynthesis.com/pipermail/odb-users/attachments/20211025/9e1ea84a/image004-0001.jpg -------------- next part -------------- A non-text attachment was scrubbed... Name: image005.jpg Type: image/jpeg Size: 1778 bytes Desc: image005.jpg Url : https://codesynthesis.com/pipermail/odb-users/attachments/20211025/9e1ea84a/image005-0001.jpg -------------- next part -------------- A non-text attachment was scrubbed... Name: image006.jpg Type: image/jpeg Size: 1794 bytes Desc: image006.jpg Url : https://codesynthesis.com/pipermail/odb-users/attachments/20211025/9e1ea84a/image006-0001.jpg -------------- next part -------------- A non-text attachment was scrubbed... Name: image007.jpg Type: image/jpeg Size: 1700 bytes Desc: image007.jpg Url : https://codesynthesis.com/pipermail/odb-users/attachments/20211025/9e1ea84a/image007-0001.jpg From boris at codesynthesis.com Mon Oct 25 10:05:12 2021 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Oct 25 10:03:14 2021 Subject: [odb-users] odb version In-Reply-To: References: Message-ID: Haenel, Angelika writes: > our team uses the odb-version 2.5.0-b.19 downloaded and build via > cppget.org. But it seems to be, that now only the newer odb-version > 2.5.0-b.21 is available and only one college got these newer version, > which leads to error "ODB runtime version mismatch". > Is there a way to install the older b.19 version? During the beta period we only keep one version around. The easiest way forward would be to upgrade to 2.5.0-b.21 (this shouldn't require any changes to your application). See upgrade instructions at the end of the "Building ODB Compiler" and "Building ODB Runtime Libraries" sections: https://codesynthesis.com/products/odb/doc/install-build2.xhtml Alternatively, I can point you to the package archives for b.19 and you should still be able to build this version but the instructions will have to be adjusted a bit. From Angelika.Haenel at minebea-intec.com Tue Oct 26 06:38:41 2021 From: Angelika.Haenel at minebea-intec.com (Haenel, Angelika) Date: Tue Oct 26 08:35:44 2021 Subject: AW: [odb-users] odb version In-Reply-To: References: Message-ID: Thanks for your fast reply! We put installation steps into an own debian-package and I prepared it for now to use already dowloaded b.19 stuff of cppget and install odb from there, which works like a charm. -----Urspr?ngliche Nachricht----- Von: Boris Kolpackov Gesendet: Montag, 25. Oktober 2021 16:05 An: Haenel, Angelika Cc: odb-users@codesynthesis.com Betreff: Re: [odb-users] odb version [Sie erhalten nicht oft E-Mail von "boris@codesynthesis.com". Weitere Informationen, warum dies wichtig ist, finden Sie unter "http://aka.ms/LearnAboutSenderIdentification".] Haenel, Angelika writes: > our team uses the odb-version 2.5.0-b.19 downloaded and build via > cppget.org. But it seems to be, that now only the newer odb-version > 2.5.0-b.21 is available and only one college got these newer version, > which leads to error "ODB runtime version mismatch". > Is there a way to install the older b.19 version? During the beta period we only keep one version around. The easiest way forward would be to upgrade to 2.5.0-b.21 (this shouldn't require any changes to your application). See upgrade instructions at the end of the "Building ODB Compiler" and "Building ODB Runtime Libraries" sections: https://codesynthesis.com/products/odb/doc/install-build2.xhtml Alternatively, I can point you to the package archives for b.19 and you should still be able to build this version but the instructions will have to be adjusted a bit. From boris at codesynthesis.com Wed Oct 27 07:29:59 2021 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed Oct 27 07:28:00 2021 Subject: [odb-users] ODB 2.5.0-b.21 published Message-ID: We've published ODB 2.5.0-b.21 to cppget.org which adds support for GCC 11. It also contains a few major new features. From the NEWS file: * Support for bulk operations in PostgreSQL 14 using the new pipeline mode. For details on bulk operations see Section 15.3, "Bulk Database Operations" in the ODB manual. Note that while this functionality requires libpq version 14 or later, it should be usable with PostgreSQL servers version 7.4 or later. The development of this support was sponsored by Qube Research & Technologies Limited. * Support for SQLite ATTACH DATABASE. Attached databases are represented as special odb::sqlite::database instances (see the class documentation for details). Note that libpq 14.0.0 is also available from cppget.org. Regarding SQLite ATTACH DATABASE support, we use this functionality in the bpkg package manager in order to transactionally manipulate a cluster of build configurations. So far we haven't ran into any issues in this functionality though you would need to use SQLite 3.21.0 or later if you want to be able to ATTACH in transactions. To install or upgrade to ODB 2.5.0-b.21 see the installation instructions: https://codesynthesis.com/products/odb/doc/install-build2.xhtml From haupt.wolfgang at gmail.com Thu Oct 28 19:02:57 2021 From: haupt.wolfgang at gmail.com (Wolfgang Haupt) Date: Thu Oct 28 19:01:06 2021 Subject: [odb-users] Compile odb 2.5.0-b.19 Message-ID: <85bcb3ce-3056-3ff4-37f2-c4a12919c080@gmail.com> Hi Boris, can you send me the instructions to build the odb compiler in version b.19 which was removed from cppget.org? I'm currently trying to update my cross-compiled system to b.21 but I'm facing some weird issues (that are most likely related to something in my project), but I really need a working build asap. So for the time being I think it would be simpler for me to keep my versions of the support libraries and compile the odb compiler in a version that matches. Thanks. BR, Wolfgang From boris at codesynthesis.com Fri Oct 29 00:34:01 2021 From: boris at codesynthesis.com (Boris Kolpackov) Date: Fri Oct 29 00:32:03 2021 Subject: [odb-users] Compile odb 2.5.0-b.19 In-Reply-To: <85bcb3ce-3056-3ff4-37f2-c4a12919c080@gmail.com> References: <85bcb3ce-3056-3ff4-37f2-c4a12919c080@gmail.com> Message-ID: Wolfgang Haupt writes: > can you send me the instructions to build the odb compiler in version > b.19 which was removed from cppget.org? The cppget.org package repository is backed by a git repository so all additions/removals/replacements are recorded in the commit history: https://github.com/cppget/public This is the commit that replaced b.19 with b.21: https://github.com/cppget/public/commit/07bb5631e7e7 The easiest is probably to go one commit before that and download what you need: https://github.com/cppget/public/tree/09b0004608b9/1/beta/odb In order to build the ODB compiler from archive, replace: bpkg build odb@https://pkg.cppget.org/1/beta With: bpkg add https://pkg.cppget.org/1/beta bpkg fetch bpkg build odb-2.5.0-b.19+1.tar.gz From haupt.wolfgang at gmail.com Fri Oct 29 03:57:52 2021 From: haupt.wolfgang at gmail.com (Wolfgang Haupt) Date: Fri Oct 29 03:56:03 2021 Subject: [odb-users] Compile odb 2.5.0-b.19 In-Reply-To: References: <85bcb3ce-3056-3ff4-37f2-c4a12919c080@gmail.com> Message-ID: <799dba18-f259-61bf-abf5-3817eb1bd6d9@gmail.com> On 29.10.21 06:34, Boris Kolpackov wrote: > Wolfgang Haupt writes: > >> can you send me the instructions to build the odb compiler in version >> b.19 which was removed from cppget.org? > The cppget.org package repository is backed by a git repository so all > additions/removals/replacements are recorded in the commit history: > > https://github.com/cppget/public > > This is the commit that replaced b.19 with b.21: > > https://github.com/cppget/public/commit/07bb5631e7e7 > > The easiest is probably to go one commit before that and download > what you need: > > https://github.com/cppget/public/tree/09b0004608b9/1/beta/odb > > In order to build the ODB compiler from archive, replace: > > bpkg build odb@https://pkg.cppget.org/1/beta > > With: > > bpkg add https://pkg.cppget.org/1/beta > bpkg fetch > bpkg build odb-2.5.0-b.19+1.tar.gz Thanks for your fast reply. I'm pretty close, the problem I now have is that I also need a downgraded version of libcutl, if I put a libcutl tar.gz in the build-directory I get an error. How can I specifiy in the build commandline "bpkg build odb-2.5.0-b.19+1.tar.gz" that it should take local tar.gz's for dependencies? From boris at codesynthesis.com Fri Oct 29 04:18:11 2021 From: boris at codesynthesis.com (Boris Kolpackov) Date: Fri Oct 29 04:16:11 2021 Subject: [odb-users] Compile odb 2.5.0-b.19 In-Reply-To: <799dba18-f259-61bf-abf5-3817eb1bd6d9@gmail.com> References: <85bcb3ce-3056-3ff4-37f2-c4a12919c080@gmail.com> <799dba18-f259-61bf-abf5-3817eb1bd6d9@gmail.com> Message-ID: Wolfgang Haupt writes: > How can I specifiy in the build commandline "bpkg build > odb-2.5.0-b.19+1.tar.gz" that it should take local tar.gz's for > dependencies? Just specify the libcutl archive on the command line: bpkg build odb-2.5.0-b.19+1.tar.gz libcutl-....tar.gz From haupt.wolfgang at gmail.com Fri Oct 29 05:10:17 2021 From: haupt.wolfgang at gmail.com (Wolfgang Haupt) Date: Fri Oct 29 05:08:24 2021 Subject: [odb-users] Compile odb 2.5.0-b.19 In-Reply-To: References: <85bcb3ce-3056-3ff4-37f2-c4a12919c080@gmail.com> <799dba18-f259-61bf-abf5-3817eb1bd6d9@gmail.com> Message-ID: On 29.10.21 10:18, Boris Kolpackov wrote: > Wolfgang Haupt writes: > >> How can I specifiy in the build commandline "bpkg build >> odb-2.5.0-b.19+1.tar.gz" that it should take local tar.gz's for >> dependencies? > Just specify the libcutl archive on the command line: > > bpkg build odb-2.5.0-b.19+1.tar.gz libcutl-....tar.gz Thanks. Seems to work as expected :) I'll probably switch over to the build2 mailing list for my cross-compile issues when I use build2. I'd prefer to go with build2 and b.21, so I don't have to maintain my own packages.