[odb-users] ODB Crashed in a multi-threaded environment

Albert (Jinku) Gu albert.gu at ringcentral.com
Tue Feb 2 10:08:53 EST 2016


Hi Boris,

To be more specifically, if we want to support the multi-threads in ODB-sqlite, could you please help check if there is anything wrong with our compile script?

Let’s take the armv7 as an example:

ios_armv7:
	cd ./libodb-2.4.0; ./configure CXX=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ LD=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld AR=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar CXXFLAGS="-Os -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk -target armv7-apple-darwin -std=c++11 -stdlib=libc++ -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/" CPPFLAGS="-I/`pwd`/../install/include" LDFLAGS="-L/`pwd`/../install/lib -arch armv7 -stdlib=libc++ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk" --prefix=`pwd`/../install --disable-shared --host=arm-apple-darwin
	cd ./libodb-2.4.0; make clean; make; make install
	cd ./libodb-sqlite-2.4.0; ./configure CXX=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang LD=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld AR=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar CXXFLAGS="-Os -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk -target armv7-apple-darwin -std=c++11 -stdlib=libc++  -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/" LDFLAGS="-arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk -stdlib=libc++" --prefix=`pwd`/../install --disable-shared --host=arm-apple-darwin CXXCPP="" --with-libodb=../libodb-2.4.0
	cd ./libodb-sqlite-2.4.0; make clean; make; make install
	rm -rf ./install/libs/ios/lib_armv7
	mkdir ./install/libs/ios/lib_armv7
	mv ./install/lib/* ./install/libs/ios/lib_armv7

Thanks in advance!

Regards,
Albert

> On Feb 2, 2016, at 9:27 PM, Boris Kolpackov <boris at codesynthesis.com> wrote:
> 
> Hi Albert,
> 
> Albert (Jinku) Gu <albert.gu at ringcentral.com> writes:
> 
>> And the exception message is “transaction already in progress in this
>> thread”.
> 
> This means you have tried to create a nested ODB transaction, something
> along these lines:
> 
> void f ()
> {
>  transaction t (db.begin ()); // Exception.
>  ...
> }
> 
> void g ()
> {
>  transaction t (db.begin ());
>  f ();
> }
> 
> Boris




More information about the odb-users mailing list