From alaiseca at gmail.com Tue Oct 17 17:32:10 2023 From: alaiseca at gmail.com (Aldo Laiseca) Date: Wed Oct 18 06:56:13 2023 Subject: [odb-users] Problem building libodb-2.4.0 Message-ID: <65E0DD0E-7295-4C5E-B64C-A45A206FA8F5@gmail.com> Hi, I was trying to build libodb 2.4.0 in a Mac OS X BigSur (OS 11.7) with XCode version 13.2.1 and Clang 13.0.0. Unfortunately I am getting this error as soon as I execute the make command: Making all in odb /Applications/Xcode.app/Contents/Developer/usr/bin/make all-am depbase=`echo callback.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\ /bin/sh ../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I'..' -I'..' -DLIBODB_DYNAMIC_LIB -std=c++11 -D_THREAD_SAFE -MT callback.lo -MD -MP -MF $depbase.Tpo -c -o callback.lo callback.cxx &&\ mv -f $depbase.Tpo $depbase.Plo libtool: compile: g++ -DHAVE_CONFIG_H -I.. -I.. -DLIBODB_DYNAMIC_LIB -std=c++11 -D_THREAD_SAFE -MT callback.lo -MD -MP -MF .deps/callback.Tpo -c callback.cxx -fno-common -DPIC -o .libs/callback.o In file included from callback.cxx:5: In file included from ../odb/callback.hxx:10: In file included from ../odb/forward.hxx:10: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cstddef:37: ../version:1:1: error: expected unqualified-id 2.4.0 ^ In file included from callback.cxx:5: In file included from ../odb/callback.hxx:10: In file included from ../odb/forward.hxx:10: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cstddef:49:9: error: no member named 'ptrdiff_t' in the global namespace using ::ptrdiff_t; ~~^ 2 errors generated. make[2]: *** [callback.lo] Error 1 make[1]: *** [all] Error 2 make: *** [all-recursive] Error 1 Looks like the libodb source code is not compatible with this version of the Clang compiler, even though I have set -std=c++11 option in CXXFLAGS as part of the configure command. Is there a workaround to make this work? Are you planning to release a newer version? Thanks in advance From boris at codesynthesis.com Wed Oct 18 07:10:34 2023 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed Oct 18 07:01:23 2023 Subject: [odb-users] Problem building libodb-2.4.0 In-Reply-To: <65E0DD0E-7295-4C5E-B64C-A45A206FA8F5@gmail.com> References: <65E0DD0E-7295-4C5E-B64C-A45A206FA8F5@gmail.com> Message-ID: Aldo Laiseca writes: > Hi, I was trying to build libodb 2.4.0 in a Mac OS X BigSur (OS 11.7) with > XCode version 13.2.1 and Clang 13.0.0. Unfortunately I am getting this error > as soon as I execute the make command: > > [...] > > Is there a workaround to make this work? I suggest that you try the latest 2.5.0 pre-release per the instructions here: https://codesynthesis.com/products/odb/doc/install-build2.xhtml (Note that you can now get build2 from Homebrew so no need to build it from source.) > Are you planning to release a newer version? Yes, we are working on it right now. Hopefully in the next couple of months. From mmichalewicz6 at gmail.com Thu Oct 19 07:48:24 2023 From: mmichalewicz6 at gmail.com (Marc Michalewicz) Date: Thu Oct 19 07:39:31 2023 Subject: [odb-users] odb 2.5.0 b25 installation on windows Message-ID: Hi, I am following the build2-instructions for 2.5.0; until the install-step everything works seamlessly but coming to this, I get several errormessages of which I pasted below the start. Apart from that it seams that the windows-install documentation was copied from the linux-installation doc, because there is no "where" command in windows - probably this is the same reason why the install fails at this point here - ? Can somebody tell what is going wrong and what needs to be done to install odb on windows correctly ? Thanks, Marc " C:\odb-build\odb-mingw>bpkg install odb ld odb-2.5.0-b.25\odb\exe{odb} error: unknown installation directory name 'root' info: did you forget to specify config.install.root? info: specify !config.install.root=... if installing from multiple projects info: while installing odb-2.5.0-b.25\doc\css{default} info: while installing odb-2.5.0-b.25\dir{doc\} info: while installing dir{odb-2.5.0-b.25\} error: unknown installation directory name 'root' info: did you forget to specify config.install.root? info: specify !config.install.root=... if installing from multiple projects info: while installing odb-2.5.0-b.25\doc\xhtml{manual} info: while installing odb-2.5.0-b.25\dir{doc\} info: while installing dir{odb-2.5.0-b.25\} error: unknown installation directory name 'root' info: did you forget to specify config.install.root? info: specify !config.install.root=... if installing from multiple projects info: while installing odb-2.5.0-b.25\doc\doc{odb-arch.png} info: while installing odb-2.5.0-b.25\dir{doc\} info: while installing dir{odb-2.5.0-b.25\} error: unknown installation directory name 'root' info: did you forget to specify config.install.root? info: specify !config.install.root=... if installing from multiple projects info: while installing odb-2.5.0-b.25\doc\doc{odb-flow.png} info: while installing odb-2.5.0-b.25\dir{doc\} info: while installing dir{odb-2.5.0-b.25\} error: unknown installation directory name 'root' info: did you forget to specify config.install.root? ... ... " From boris at codesynthesis.com Thu Oct 19 08:32:12 2023 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu Oct 19 08:23:03 2023 Subject: [odb-users] odb 2.5.0 b25 installation on windows In-Reply-To: References: Message-ID: Marc Michalewicz writes: > I am following the build2-instructions for 2.5.0; until the install-step > everything works seamlessly but coming to this, I get several errormessages > of which I pasted below the start. > > C:\odb-build\odb-mingw>bpkg install odb > ld odb-2.5.0-b.25\odb\exe{odb} > error: unknown installation directory name 'root' > info: did you forget to specify config.install.root? The config.install.root value should have been specified as part of the bpkg create command: bpkg create -d odb-mingw cc^ config.cxx=g++^ config.cc.coptions=-O2^ config.install.root=C:\build2 Can you make sure you did not omit it by accident? > Apart from that it seams that the windows-install documentation was copied > from the linux-installation doc, because there is no "where" command in > windows No, the Windows installation instructions were not just copied from Linux, but they are very similar (which is the key point of build2 -- uniform interface across platforms/compilers). And there is `where` command on Windows, provided you use a recent enough version. For background, see: https://stackoverflow.com/questions/304319/is-there-an-equivalent-of-which-on-the-windows-command-line https://ss64.com/nt/where.html From mmichalewicz6 at gmail.com Thu Oct 19 09:03:35 2023 From: mmichalewicz6 at gmail.com (Marc Michalewicz) Date: Thu Oct 19 08:54:42 2023 Subject: [odb-users] odb 2.5.0 b25 installation on windows In-Reply-To: References: Message-ID: Thanks for this fast reply. i reassured that the command was input in the right way, afterwards I retried again, and again with adminatrot privileges, but I always get the same error-output. I have no clue what is wrong. My windows is Windows 10 Enterprise 21H2. And sorry. Of course there is a where command in windows, I was a bit confused ;-) Marc Am Do., 19. Okt. 2023 um 14:32 Uhr schrieb Boris Kolpackov < boris@codesynthesis.com>: > Marc Michalewicz writes: > > > I am following the build2-instructions for 2.5.0; until the install-step > > everything works seamlessly but coming to this, I get several > errormessages > > of which I pasted below the start. > > > > C:\odb-build\odb-mingw>bpkg install odb > > ld odb-2.5.0-b.25\odb\exe{odb} > > error: unknown installation directory name 'root' > > info: did you forget to specify config.install.root? > > The config.install.root value should have been specified as part of the > bpkg create command: > > bpkg create -d odb-mingw cc^ > config.cxx=g++^ > config.cc.coptions=-O2^ > config.install.root=C:\build2 > > Can you make sure you did not omit it by accident? > > > > Apart from that it seams that the windows-install documentation was > copied > > from the linux-installation doc, because there is no "where" command in > > windows > > No, the Windows installation instructions were not just copied from > Linux, but they are very similar (which is the key point of build2 -- > uniform interface across platforms/compilers). > > And there is `where` command on Windows, provided you use a recent > enough version. For background, see: > > > https://stackoverflow.com/questions/304319/is-there-an-equivalent-of-which-on-the-windows-command-line > > https://ss64.com/nt/where.html > From boris at codesynthesis.com Thu Oct 19 11:35:36 2023 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu Oct 19 11:26:27 2023 Subject: [odb-users] odb 2.5.0 b25 installation on windows In-Reply-To: References: Message-ID: Marc Michalewicz writes: > i reassured that the command was input in the right way, afterwards I > retried again, and again with adminatrot privileges, but I always get the > same error-output. Hm, that's strange. You are running the command from vanilla Windows Command Prompt, right? Not from an MSYS shell or PowerShell (both are know to translate things on the command line)? Can you open the odb-mingw\build\config.build file and check what is the value of the config.install.root variable inside? From mmichalewicz6 at gmail.com Thu Oct 19 11:54:15 2023 From: mmichalewicz6 at gmail.com (Marc Michalewicz) Date: Thu Oct 19 11:45:25 2023 Subject: [odb-users] odb 2.5.0 b25 installation on windows In-Reply-To: References: Message-ID: After some experiments I found the issue: the reason was how I copied and pasted the command into the commandline: line by line including the ending "^"... it worked actually but the last line apparently was not accepted without any warning or error or any message. After entering the entire command in one single line it is installed without any issues: bpkg create -d odb-mingw cc config.cxx=g++ config.cc.coptions=-O2 config.install.root=C:\build2 --wipe Sorry for bothering but it took some hours to find out now. Thanks anyway for your help. Great job by the way, the entire ODB project. Marc Am Do., 19. Okt. 2023 um 17:35 Uhr schrieb Boris Kolpackov < boris@codesynthesis.com>: > Marc Michalewicz writes: > > > i reassured that the command was input in the right way, afterwards I > > retried again, and again with adminatrot privileges, but I always get the > > same error-output. > > Hm, that's strange. You are running the command from vanilla Windows > Command Prompt, right? Not from an MSYS shell or PowerShell (both are > know to translate things on the command line)? > > Can you open the odb-mingw\build\config.build file and check what > is the value of the config.install.root variable inside? > From reillyhekazusa at gmail.com Mon Oct 30 04:34:00 2023 From: reillyhekazusa at gmail.com (Reilly He) Date: Mon Oct 30 04:25:07 2023 Subject: [odb-users] Questions on object_not_persistent exception Message-ID: Hi Boris, We recently encountered the '*object_not_persistent*' exceptions when using odb. After reading through the manual, especially the chapter: - 3.9: Loading Persistent Objects - 3.10: Updating Persistent Objects - 3.11: Deleting Persistent Objects We know that we might R/U/D some ORM objects that do not exist in the database. But it is really hard to find the detailed biz logic which triggers this error. Based on the manual, the exception itself looks like this: > struct object_not_persistent: exception { > > virtual const char* > > what () const throw (); }; > And based on the descriptions on the manual: > *Catching this exception guarantees that we will catch all the exceptions > thrown by ODB. The what() function returns a human-readable description of > the condition that triggered the exception. * We still find it not enough to quickly detect who triggers the exception. Do you know how to get more information when this exception happens? *Like the id, or the operation (R/U/D), or even the type of the Model?* Thanks a lot. Best Regards, Reilly He From boris at codesynthesis.com Tue Oct 31 07:31:01 2023 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue Oct 31 07:21:50 2023 Subject: [odb-users] Questions on object_not_persistent exception In-Reply-To: References: Message-ID: Reilly He writes: > We recently encountered the '*object_not_persistent*' exceptions when using > odb. > > [...] > > Based on the manual, the exception itself looks like this: > > > struct object_not_persistent: exception { > > > > virtual const char* > > > > what () const throw (); }; > > > > We still find it not enough to quickly detect who triggers the exception. Generally, ODB exceptions are derived from the underlying database error code/message and the amount of information you get varies. Unfortunately, for SQLite (which is the database I assume you are using), this is just the high-level error code without any specifics (like the table name or primary key value) that would allow you to map this back to your objects. > Do you know how to get more information when this exception happens? *Like > the id, or the operation (R/U/D), or even the type of the Model?* A couple of things come to mind: 1. Don't catch the exception and instead let the application crash under the debugger (or examine the core). This should give you the exact location of where the exception was thrown and from outer stack frames you should be able to determine the object type and object id. 2. Enable SQL statement tracing: https://www.codesynthesis.com/products/odb/doc/manual.xhtml#3.13 Provided your application is single-threaded (or you make arrangements for saving traces on the per-thread basis), the last statement executed should give you the idea of the object(s) involved. Note that because prepared statements are used, you won't see the object id in these traces, only the parameter placeholders. 3. For client-server databases (so not SQLite), there is also the option of looking into server logs to see which SQL statements get executed. There you may be able to see both the statement and the values for the parameters. From jarryd.beck at akunacapital.com Tue Oct 31 23:11:37 2023 From: jarryd.beck at akunacapital.com (Jarryd Beck) Date: Wed Nov 1 02:51:48 2023 Subject: [odb-users] Invalid postgresql type with `[` on odb 2.5.0 Message-ID: We have been using odb 2.4.0 for a long time in some of our code, and I was looking at updating this to 2.5.0. I have tried both odb-2.5.0-b.19+2 and odb-2.5.0-b.25. The compiler is failing with this error: src/schema/inst_schema.h:321:30: error: invalid PostgreSQL type declaration: unexpected character '[' it is coming from this piece of code: #pragma db type("TEXT[]") std::vector attr; Is this a bug in odb or do we need to do something different to use an array of text values? Thanks, Jarryd Beck. ________________________________ [http://www.akunacapital.com/wp-content/uploads/2018/04/akuna-logo_email-signature_4-3-18.png] Jarryd Beck | Senior Software Engineer Akuna Capital Level 10 / 1 Shelley St Sydney NSW 2000 | www.akunacapital.com p: | m: | f: | jarryd.beck@akunacapital.com Learn More About the New Wave in Tech and Trading Visit Us- A 360? Virtual Reality Experience [http://www.akunacapital.com/images/linkedin.png] [http://www.akunacapital.com/images/facebook.png] [http://www.akunacapital.com/images/instagram.png] [http://www.akunacapital.com/images/twitter.png] Please consider the environment before printing this email. This electronic message contains information from Akuna Capital LLC that may be confidential, legally privileged or otherwise protected from disclosure. This information is intended for the use of the addressee only and is not offered as investment advice to be relied upon for personal or professional use. Additionally, all electronic messages are recorded and stored in compliance pursuant to applicable SEC rules. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, printing or any other use of, or any action in reliance on, the contents of this electronic message is strictly prohibited. If you have received this communication in error, please notify us by telephone at (312)994- 4640 and destroy the original message.