From yuelin.chen at hds.leica-geosystems.com Mon Jul 4 20:39:01 2022 From: yuelin.chen at hds.leica-geosystems.com (CHEN Yuelin) Date: Tue Jul 5 09:11:26 2022 Subject: [odb-users] Pre-compiled binary distribution of odb for Windows Message-ID: Hi, We are using ODB 2.4.0 on windows. We are using Visual Studio 2017 to link ODB library to the application. Now we tried to switch to Visual Studio 2022, and got this linker error: LINK : fatal error C1047: The object or library file '\ODB\2.4.0\msvc2015_64\libstat\odb-2.4-vc14.lib' was created by a different version of the compiler than other objects like 'C:...' Can you provide us library built by Visual Studio 2022, or some instruction on how to build it? Thanks. Regards, Yuelin From boris at codesynthesis.com Tue Jul 5 09:26:18 2022 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue Jul 5 09:21:42 2022 Subject: [odb-users] Pre-compiled binary distribution of odb for Windows In-Reply-To: References: Message-ID: CHEN Yuelin writes: > We are using ODB 2.4.0 on windows. We are using Visual Studio 2017 to > link ODB library to the application. Now we tried to switch to Visual > Studio 2022, and got this linker error: > > LINK : fatal error C1047: The object or library file > '\ODB\2.4.0\msvc2015_64\libstat\odb-2.4-vc14.lib' was created by a > different version of the compiler [...] > > Can you provide us library built by Visual Studio 2022, or some > instruction on how to build it? Note that the above library (msvc2015_64\libstat\odb-2.4-vc14.lib) was most likely built by you (we definitely don't ship any pre- built libraries like this). So I think you have two options here: 1. If you want to stay on ODB 2.4.0, then you will need to re-build this library with VS 2022. You should be able to open the libodb-vc12.sln solution at which point VS should convert it to the latest version and you should be able to build it. 2. Alternatively, as part of this upgrade to VS 2022, you can take the opportunity to upgrade to the latest ODB 2.5.0 beta (which should be mostly backwards-compatible with 2.4.0). If you would like to go this route, see the following build instructions: https://codesynthesis.com/products/odb/doc/install-build2.xhtml From yuelin.chen at hds.leica-geosystems.com Tue Jul 5 20:10:07 2022 From: yuelin.chen at hds.leica-geosystems.com (CHEN Yuelin) Date: Thu Jul 7 10:08:23 2022 Subject: [odb-users] Pre-compiled binary distribution of odb for Windows In-Reply-To: References: Message-ID: Hi Boris, Thanks for replying. You are right, some other developer actually used/modified libodb-vc12.sln to build vc14 version of binary files a while ago. I tried the same approach and was able to build with Visual Studio 2022. I will also try to download and build ODB 2.5.0 beta. When will you release a stable version? If it's soon (in a couple of months) then I would wait for it. Regards, Yuelin -----Original Message----- From: Boris Kolpackov Sent: Tuesday, July 5, 2022 6:26 AM To: CHEN Yuelin Cc: odb-users@codesynthesis.com Subject: Re: [odb-users] Pre-compiled binary distribution of odb for Windows [You don't often get email from boris@codesynthesis.com. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ] This email is not from Hexagon's Office 365 instance. Please be careful while clicking links, opening attachments, or replying to this email. CHEN Yuelin writes: > We are using ODB 2.4.0 on windows. We are using Visual Studio 2017 to > link ODB library to the application. Now we tried to switch to Visual > Studio 2022, and got this linker error: > > LINK : fatal error C1047: The object or library file > '\ODB\2.4.0\msvc2015_64\libstat\odb-2.4-vc14.lib' was created by a > different version of the compiler [...] > > Can you provide us library built by Visual Studio 2022, or some > instruction on how to build it? Note that the above library (msvc2015_64\libstat\odb-2.4-vc14.lib) was most likely built by you (we definitely don't ship any pre- built libraries like this). So I think you have two options here: 1. If you want to stay on ODB 2.4.0, then you will need to re-build this library with VS 2022. You should be able to open the libodb-vc12.sln solution at which point VS should convert it to the latest version and you should be able to build it. 2. Alternatively, as part of this upgrade to VS 2022, you can take the opportunity to upgrade to the latest ODB 2.5.0 beta (which should be mostly backwards-compatible with 2.4.0). If you would like to go this route, see the following build instructions: https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcodesynthesis.com%2Fproducts%2Fodb%2Fdoc%2Finstall-build2.xhtml&data=05%7C01%7C%7Cac8e76f37e2f4c1e243c08da5e89f589%7C1b16ab3eb8f64fe39f3e2db7fe549f6a%7C0%7C0%7C637926243872185675%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=JKY8v5ghlBv0PcpSng2anwrh7Ty6WgZ6UrV5lnTzFE8%3D&reserved=0 From boris at codesynthesis.com Thu Jul 7 10:27:58 2022 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu Jul 7 10:23:18 2022 Subject: [odb-users] Pre-compiled binary distribution of odb for Windows In-Reply-To: References: Message-ID: CHEN Yuelin writes: > I will also try to download and build ODB 2.5.0 beta. When will you > release a stable version? If it's soon (in a couple of months) then > I would wait for it. We don't have a firm ETA yet, but it's unlikely to be in a couple of months. From PStath at jmawireless.com Thu Jul 14 19:56:32 2022 From: PStath at jmawireless.com (Paul Stath) Date: Thu Jul 14 19:52:00 2022 Subject: [odb-users] Schema migration of sub-class (adding attributes) Message-ID: Hi all, I am having an issue with schema migration related to polymorphic classes that I have found a work-around for, but I'm wondering if there is a better way. #pragma db object optimistic class Request { #pragme db value_not_null inverse(request) std::set groups_; // to many }; #pragma db object optimistic abstract polymorphic class Group { #pragma db not_null on_delete(cascade) std::weak_ptr request_; // to one #pragma db value_not_null inverse(group) std::set details_; // to many }; #pragma db object polymorphic Class GroupA : public Group {}; #pragma db object polymorphic Class GroupB : public Group {}; class Detail { std::weak_ptr group_; // to one } I am attempting to load a Detail record, which in turn loads the parent Group object and then the parent Request object. In a subsequent version of the schema, I soft-add columns to the GroupB object, but the Group base class still has the original (version 1) schema. When loading a persisted Detail record with a foreign key that points to a GroupB record in the database, I get a segmentation violation trying to construct the GroupB object from the database row. I am able to avoid the issue by soft-adding an unused attribute to the Group base class. I suspect that since the Group base class doesn't have any schema version soft add/deletes, the code generated to load the inverse related object doesn't appear to use the method signatures that include the "svm" parameter. Is this a known issue? If not when I have time I'll create a minimal test that re-creates the issue. Is there a way to force the use of the "svm" method signatures for a class other than having added/deleted pragmas in the base class? I noticed a "force_versioned" variable in the ODB plug-in source that would seem to force a class to be considered versioned, but I can't determine a way to cause it to be true. Any advice would be appreciated. --- Paul Stath From boris at codesynthesis.com Fri Jul 15 08:17:29 2022 From: boris at codesynthesis.com (Boris Kolpackov) Date: Fri Jul 15 08:12:46 2022 Subject: [odb-users] Schema migration of sub-class (adding attributes) In-Reply-To: References: Message-ID: Paul Stath writes: > Is this a known issue? If not when I have time I'll create a minimal > test that re-creates the issue. I am a bit fuzzy on exactly what's going on here, but this doesn't ring a bell. So if you could create a reproducer, I can confirm whether this is still present in the latest pre-release (and also hopefully clear up the fuzziness). > Is there a way to force the use of the "svm" method signatures for a > class other than having added/deleted pragmas in the base class? This normally shouldn't be necessary so there is no explicit mechanism for this. I think the first step should be to understand why there is a segfault, not necessarily trying to force the base to be treated as versioned when nothing about it has changed. From vavp12345 at yandex.ru Fri Jul 22 04:25:48 2022 From: vavp12345 at yandex.ru (=?utf-8?B?0JDRgNGC0LXQvCDQkdCw0LHQsNC10LI=?=) Date: Mon Aug 1 04:06:11 2022 Subject: [odb-users] Attempt to refer to a dbvalue inside another dbvalue - "invalid data member in db pragma column" Message-ID: <522621658478087@mail.yandex.ru> OS: Ubuntu 20.04.4 LTS package: libodb-sqlite-2.5.0 compiler: gcc 9.4.0  this code does not compile: // experiment.h #include #pragma db value struct Val_1 { int a; }; #pragma db value struct Val_2 { Val_1 val1; };  #pragma db object class Object {   friend odb::access; #pragma db id auto   int id;   Val_2 value; };  #pragma db view object(Object) struct ObjectView { #pragma db column(Object::value) ///< OK   Val_2 val2; #pragma db column(Object::value.val1.a) ///< OK   int a; #pragma db column(Object::value.val1) ///< DONT WORK: "invalid data member in db pragma column"   Val_1 val1; };