From neverov.biks.07.1 at gmail.com Wed Jan 26 03:27:50 2011 From: neverov.biks.07.1 at gmail.com (Eugene N) Date: Wed Jan 26 03:27:58 2011 Subject: [odb-users] odb compiler Message-ID: Hello I hope to clarify some things about ODB. Firstly, I want to add ODB to my program, but it uses a number of libraries, and is compiled with g++ with l options. I was wondering, whether odb compiler will complain about unresolved externals. Secondly, if i have a class, objects of which i intend on storing in a relational DB, but this class has object members from some other library, where should i put pragmas - in my class, or in library classes? Thanks for your replies. Eugene From boris at codesynthesis.com Wed Jan 26 04:36:28 2011 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed Jan 26 04:22:35 2011 Subject: [odb-users] ODB 1.1.0 released Message-ID: Hi, We have released ODB 1.1.0. The NEWS file entries for this release are as follows: * Support for storing containers in the database. For example, now you can write: #pragma db object class person { ... std::set emails_; }; For more information refer to Chapter 5, "Containers" in the ODB manual as well as the 'container' example in the odb-examples package. * Support for unidirectional and bidirectional object relationships, including lazy loading. For example: #pragma db object class employer { ... #pragma db inverse(employer_) std::vector > employees_; }; #pragma db object class employer { ... shared_ptr employer_; }; For more information refer to Chapter 6, "Relationships" in the ODB manual as well as the 'relationship' and 'inverse' examples in the odb-examples package. * Support for composite value types. For example: #pragma db value class name { ... std::string first_; std::string last_; }; #pragma db object class person { ... name name_; }; For more information refer to Chapter 7, "Composite Value Types" in the ODB manual as well as the 'composite' example in the odb-examples package. * Support for sessions. A session is an application's unit of work that may encompass several database transactions. In this version of ODB a session is just an object cache. For more information refer to Chapter 8, "Session" in the ODB manual. * Support for custom object pointers that allows you to use smart pointers to return, pass, and cache persistent objects. See Section 3.2, "Object Pointers" in the ODB manual for details. * Support for native SQL statement execution. See Section 3.9, "Executing Native SQL Statements" in the ODB manual for details. * New option, --profile/-p, instructs the ODB compiler to use the specified profile library. See the ODB compiler command line manual for details. * Support for literal names (template-id, derived type declarator such as pointers, etc) in data member declarations. Now, for example, you can use std::vector directly instead of having to create a typedef alias for it. * Support for inheritance from transient base types for object types and composite value types. * New example, 'schema', shows how to map persistent C++ classes to a custom database schema. * New options, --odb-prologue, --odb-epilogue, allow inclusion of extra code into the ODB compilation process. This can be useful for making additional traits specializations or ODB pragmas known to the ODB compiler. * Support for persistent classes without default constructors. For objects of such classes only the load() and find() database functions that populate an existing instance can be used. Similarly, only the load() query result iterator function which populates an existing instance can be used. Source code and pre-compiled binary packages for this release are available from the download page: http://www.codesynthesis.com/products/odb/download.xhtml SHA1 checksums for the files in this release are as follows: 770aeca0e626754906bb84ad8d3b1dc3a40cbe27 libodb-1.1.0.tar.bz2 4e931be19d1d5071510e3516b5719bbd81c60b14 libodb-1.1.0.tar.gz 6184ace925fa09755a9af0447a74cf16a4b2b96c libodb-1.1.0.zip 89c07493e3355190cfd9e8756c42fa8dedcbafbb libodb-mysql-1.1.0.tar.bz2 c5c5a6548805099e395a896eedc9bdb50f1d99c7 libodb-mysql-1.1.0.tar.gz f611ab47135a1579471036f4557331028b2854e3 libodb-mysql-1.1.0.zip 3b334c933820977ca42dcdcb235e82dd913867e3 libodb-tracer-1.1.0.tar.bz2 29edfed7b29712d8ba920a8008f0cc2d077f1782 libodb-tracer-1.1.0.tar.gz adec98afbb0099f2a5a5ee14cc4ace9aac640203 libodb-tracer-1.1.0.zip 7ba5e2ff86261960c312edcbe096ce7d4351f96b odb-1.1.0-i686-linux-gnu.tar.bz2 c77d72678d6325f8c53c9cc2afc206f032872c8c odb-1.1.0-i686-macosx.tar.bz2 2037bb3f324d763cd28b99a547ab68de81729ebf odb-1.1.0-i686-solaris.tar.bz2 83ece19fe618b9f74ee3b50e00bf0dfce5e1c406 odb-1.1.0-i686-windows.zip b8dc849093e65dd8501091e1837ad21dec008eee odb-1.1.0-sparc-solaris.tar.bz2 1ec3c8368d6fff708e8ade250d4f08c54ee9cb98 odb-1.1.0.tar.bz2 ba92a4ebd60b600462644dc502f08124a25a6069 odb-1.1.0.tar.gz cdaf55183708c049a8952cf3df21304a656ee5f6 odb-1.1.0-x86_64-linux-gnu.tar.bz2 284f9abbe988c10ea9bbfd8460ab31d1b7725f12 odb-1.1.0.zip a0ba27b59c79671c7e481dc7c188a8202a3e0aa9 odb-examples-1.1.0.tar.bz2 3ab1eda2200955cba52e169a4bd23905c0d16d67 odb-examples-1.1.0.tar.gz e66c017dcf1ed191506366d20014662f560453c9 odb-examples-1.1.0.zip ef45ade0f0748c1803b8f22f6e790ddb74ff6c60 odb-tests-1.1.0.tar.bz2 14e80612e05e2e93b0b21e772f59c9719b4553d1 odb-tests-1.1.0.tar.gz a5d1c3165d41abdeb20875be5668ef04acd7a1b0 odb-tests-1.1.0.zip Enjoy, Boris From boris at codesynthesis.com Wed Jan 26 08:31:55 2011 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed Jan 26 08:18:00 2011 Subject: [odb-users] odb compiler In-Reply-To: References: Message-ID: Hi Eugene, Eugene N writes: > Firstly, I want to add ODB to my program, but it uses a number of libraries, > and is compiled with g++ with l options. I was wondering, whether odb > compiler will complain about unresolved externals. I am not sure what you mean here. Are you trying to build the ODB compiler itself instead of using a pre-compiled binary? Can you explain in a bit more detail what you are trying to achieve? > Secondly, if i have a class, objects of which i intend on storing in a > relational DB, but this class has object members from some other library, > where should i put pragmas - in my class, or in library classes? By "object members" do you mean data members? If that's the case, then the way to handle this situation depends on whether these types are simple or composite value types. Can you maybe show us a concrete example from your application? Boris From boris at codesynthesis.com Wed Jan 26 11:07:41 2011 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed Jan 26 10:53:43 2011 Subject: [odb-users] odb compiler In-Reply-To: References: Message-ID: Hi Eugene, In the future please keep your replies CC'ed to the odb-users mailing list as discussed in the posting guidelines: http://www.codesynthesis.com/support/posting-guidelines.xhtml Eugene N writes: > Thank you very much for your quick responce. What i basically ment was this > - i have a lot of extrenal dependancies in my application (libraries), and i > wasnt sure how would odb compiler react on them (if i try to compile my > application with it). > > I missed the description of odb on your website at first, so i thought it > would try to link my application. But as it produces c++ code, my first > question had no sence really, forgive my ignorance. No problem. I am glad it is clearer now. > My second question was this: i have a class (lets call it "A") with 4 > members ( sort of POD class), those members are vectors of sort (contiguous > in memory, just like stl vectors, elements are bytes). I need to store a few > thousands of "A" objects, i really need only three operations - find, add, > and get. > > So, i would like to know, would i have to modify only my "A" classes, in > order to persist them with ODB, or would i have to modify those internal > vector classes (which are from external library)? No, you shouldn't need to modify the vector classes from the external library. The way to handle this depends on how you want to store these vectors in the database. Seeing that their elements are bytes, then one possible representation would be to store them as BLOBs. For this, you will need to provide specializations of the value_traits template which perform the conversion between these vectors and the database type. This should be fairly simple and the 'mapping' example in the odb-examples package shows how to do this. Also see Section 9.2.1, "type" in the ODB manual. The other possible way to handle these vectors would be to store them as containers so that each member of a vector type is mapped to a table and each element in a container is stored in a separate row. Container support was added in the just-released ODB 1.1.0. Otherwise, this also should be fairly easy to implement, as discussed in Section 5.4, "Using Custom Containers" in the ODB manual. Boris From boris at codesynthesis.com Thu Jan 27 06:45:12 2011 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu Jan 27 06:31:04 2011 Subject: [odb-users] Re: RPMs for ODB In-Reply-To: References: Message-ID: Hi Chris, [CC'ed odb-users mailing list to my reply.] Chris Morgan writes: > Are there any plans to provide a set of RPMs to the RedHat and/or > Fedora projects at some point? I was hoping Fedora community would do this at some point (and put ODB into their repository). I wonder if there is any way to suggest software for packaging in Fedora? > We were looking at ODB for a recent project but were unable to use > it because our customer requires RPMs for 3rd party libraries. Are you only looking for RPMs for the runtime libraries (libodb and libodb-mysql; in other words libraries that you would normally distribute with your application). Or for the whole system, including the ODB compiler? Boris From christopher.j.morgan at gmail.com Thu Jan 27 08:46:25 2011 From: christopher.j.morgan at gmail.com (Chris Morgan) Date: Thu Jan 27 09:29:53 2011 Subject: [odb-users] Re: RPMs for ODB In-Reply-To: References: Message-ID: On Thu, Jan 27, 2011 at 03:45, Boris Kolpackov wrote: > Hi Chris, > > [CC'ed odb-users mailing list to my reply.] > > Chris Morgan writes: > >> Are there any plans to provide a set of RPMs to the RedHat and/or >> Fedora projects at some point? > > I was hoping Fedora community would do this at some point (and put > ODB into their repository). I wonder if there is any way to suggest > software for packaging in Fedora? http://fedoraproject.org/wiki/Package_Review_Process > >> We were looking at ODB for a recent project but were unable to use >> it because our customer requires RPMs for 3rd party libraries. > > Are you only looking for RPMs for the runtime libraries (libodb and > libodb-mysql; in other words libraries that you would normally > distribute with your application). Or for the whole system, including > the ODB compiler? I would imagine a -devel RPM for the compiler and any include files, etc. needed for development with ODB. Then possibly a -libs file for the runtime libraries and maybe even a separate -docs RPM (that's similar to the mysql++ packaging scheme). -Chris From boris at codesynthesis.com Thu Jan 27 10:01:17 2011 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu Jan 27 09:47:06 2011 Subject: [odb-users] Re: RPMs for ODB In-Reply-To: References: Message-ID: Hi Chris, Chris Morgan writes: > http://fedoraproject.org/wiki/Package_Review_Process Thanks for the link. This, however, would require us to package ODB ourselves. We would prefer to find a Fedora package maintainer that is interested in doing it. This is what happened with our other projects. > I would imagine a -devel RPM for the compiler and any include files, > etc. needed for development with ODB. Then possibly a -libs file for > the runtime libraries and maybe even a separate -docs RPM (that's > similar to the mysql++ packaging scheme). Yes, that's what a full set of packages would look like. I was more interested to know a minimal set of packages that would allow you to use ODB in your project. If it were just the runtime libraries, then we could try to package those as an interim solution. Boris From mksong at vt.edu Mon Jan 31 19:33:57 2011 From: mksong at vt.edu (Myoungkyu Song) Date: Mon Jan 31 19:34:24 2011 Subject: [odb-users] [ODB] About the issue about installing libodb-mysql-1.1.0 Message-ID: Hello, Boris While installing 'libodb-mysql-1.1.0', I got some problem; it was unable to find 'libmysqlclient_r'. I installed MySQL which is the version, 'Ver 14.12 Distrib 5.0.51a'. Here is my information I am using. -------------------------------------------------------------------------------- $ dpkg -l | grep mysql ii ?libdbd-mysql-perl ? ? ? ? ? ? ? ? ? ? ? ? ?4.005-1 ? ? ? ?A Perl5 database interface to the MySQL data ii ?libmysqlclient15off ? ? ? ? ? ? ? ? ? ? ? ?5.0.51a-3ubuntu5.8 ? ? ? MySQL database client library ii ?mysql-client-5.0 ? ? ? ? ? ? ? ? ? ? ? ? ? 5.0.51a-3ubuntu5.8 ? ? ? MySQL database client binaries ii ?mysql-common ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 5.0.51a-3ubuntu5.8 ? ? ? MySQL database common files ii ?mysql-server ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 5.0.51a-3ubuntu5.8 ? ? ? MySQL database server (meta package dependin ii ?mysql-server-5.0 ? ? ? ? ? ? ? ? ? ? ? ? ? 5.0.51a-3ubuntu5.8 ? ? ? MySQL database server binaries $ $ ldconfig -p | grep mysql libmysqlclient_r.so.15 (libc6,x86-64) => /usr/lib/libmysqlclient_r.so.15 libmysqlclient.so.15 (libc6,x86-64) => /usr/lib/libmysqlclient.so.15 $ $ ls -la /usr/lib/*mysql* lrwxrwxrwx 1 root root ? ? ?26 2011-01-31 19:04 /usr/lib/libmysqlclient_r.so.15 -> libmysqlclient_r.so.15.0.0 -rw-r--r-- 1 root root 2113216 2010-11-10 00:08 /usr/lib/libmysqlclient_r.so.15.0.0 lrwxrwxrwx 1 root root ? ? ?24 2011-01-31 19:04 /usr/lib/libmysqlclient.so.15 -> libmysqlclient.so.15.0.0 -rw-r--r-- 1 root root 2104672 2010-11-10 00:08 /usr/lib/libmysqlclient.so.15.0.0 $ $ cat /etc/issue Ubuntu 8.04.4 LTS \n \l -------------------------------------------------------------------------------- #1) I downloaded 'mysql-connector-c-6.0.1-linux-glibc2.3-x86-64bit' and extracted the archived file to my local path. #2) I carried out the following three command, respectively, each of which was not working. $ $./configure CPPFLAGS="-I/home/mksong/mysql_install_file/mysql-connector-c-6.0.1-linux-glibc2.3-x86-64bit/include" LDFLAGS="-L/home/mksong/mysql_install_file/mysql-connector-c-6.0.1-linux-glibc2.3-x86-64bit/lib" ... ... checking for libmysqlclient_r... no configure: error: libmysqlclient_r is not found; consider using CPPFLAGS/LDFLAGS to specify its location $ $ ./configure CPPFLAGS="-I/usr/include" LDFLAGS="-L/usr/lib" $ $ ./configure $ -------------------------------------------------------------------------------- Could you give me some comments about that? Best regards, Myoungkyu Song From mksong at vt.edu Mon Jan 31 21:11:49 2011 From: mksong at vt.edu (Myoungkyu Song) Date: Mon Jan 31 21:12:16 2011 Subject: [odb-users] Re: [ODB] About the issue about installing libodb-mysql-1.1.0 In-Reply-To: References: Message-ID: Hello, Boris I was able to figure out the below issue by installing the 'mysql-connector-c' from the source code, rather than the distributed binary version from the MySQL community. Sorry about any convenience. Best regards, Myoungkyu Song On Mon, Jan 31, 2011 at 7:33 PM, Myoungkyu Song wrote: > Hello, Boris > > While installing 'libodb-mysql-1.1.0', I got some problem; it was > unable to find 'libmysqlclient_r'. > I installed MySQL which is the version, 'Ver 14.12 Distrib 5.0.51a'. > Here is my information I am using. > -------------------------------------------------------------------------------- > $ dpkg -l | grep mysql > ii ?libdbd-mysql-perl ? ? ? ? ? ? ? ? ? ? ? ? ?4.005-1 > ? ? ? ?A Perl5 database interface to the MySQL data > ii ?libmysqlclient15off ? ? ? ? ? ? ? ? ? ? ? ?5.0.51a-3ubuntu5.8 > ?? ? ? MySQL database client library > ii ?mysql-client-5.0 ? ? ? ? ? ? ? ? ? ? ? ? ? 5.0.51a-3ubuntu5.8 > ?? ? ? MySQL database client binaries > ii ?mysql-common ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 5.0.51a-3ubuntu5.8 > ?? ? ? MySQL database common files > ii ?mysql-server ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 5.0.51a-3ubuntu5.8 > ?? ? ? MySQL database server (meta package dependin > ii ?mysql-server-5.0 ? ? ? ? ? ? ? ? ? ? ? ? ? 5.0.51a-3ubuntu5.8 > ?? ? ? MySQL database server binaries > $ > $ ldconfig -p | grep mysql > libmysqlclient_r.so.15 (libc6,x86-64) => /usr/lib/libmysqlclient_r.so.15 > libmysqlclient.so.15 (libc6,x86-64) => /usr/lib/libmysqlclient.so.15 > $ > $ ls -la /usr/lib/*mysql* > lrwxrwxrwx 1 root root ? ? ?26 2011-01-31 19:04 > /usr/lib/libmysqlclient_r.so.15 -> libmysqlclient_r.so.15.0.0 > -rw-r--r-- 1 root root 2113216 2010-11-10 00:08 > /usr/lib/libmysqlclient_r.so.15.0.0 > lrwxrwxrwx 1 root root ? ? ?24 2011-01-31 19:04 > /usr/lib/libmysqlclient.so.15 -> libmysqlclient.so.15.0.0 > -rw-r--r-- 1 root root 2104672 2010-11-10 00:08 > /usr/lib/libmysqlclient.so.15.0.0 > $ > $ cat /etc/issue > Ubuntu 8.04.4 LTS \n \l > -------------------------------------------------------------------------------- > #1) I downloaded 'mysql-connector-c-6.0.1-linux-glibc2.3-x86-64bit' > and extracted the archived file to my local path. > #2) I carried out the following three command, respectively, each of > which was not working. > $ > $./configure CPPFLAGS="-I/home/mksong/mysql_install_file/mysql-connector-c-6.0.1-linux-glibc2.3-x86-64bit/include" > LDFLAGS="-L/home/mksong/mysql_install_file/mysql-connector-c-6.0.1-linux-glibc2.3-x86-64bit/lib" > ... > ... > checking for libmysqlclient_r... no > configure: error: libmysqlclient_r is not found; consider using > CPPFLAGS/LDFLAGS to specify its location > $ > $ ./configure CPPFLAGS="-I/usr/include" LDFLAGS="-L/usr/lib" > $ > $ ./configure > $ > -------------------------------------------------------------------------------- > > Could you give me some comments about that? > Best regards, > Myoungkyu Song >