[odb-users] Problem - Using ODB inside a DLL

Cuong Tran vaioinman at googlemail.com
Fri Jan 6 09:55:19 EST 2012


Hi Boris,

Sorry about not getting back sooner. I have gone through quite a journey.

I have tested my project, without any changes, under Windows 7 and it works
very well. Hence, I just carried on because I have a handful of functions
to build in a tight schedule. I have to admit that ODB is a truly fantastic
orm framework which speeds up a lot my project implementation.

Today, I have the first chance to revisit the issue. I compile your example
project under XP Pro. I only changed the server address, db name and user
name. The issue is still there, expectedly, but I learn a few things.

First, my problem looks more and more like the previous post back in last
June, which I already I mentioned. The execution stopped at:

if (make_current && tls_get (current_transaction) != 0)
throwalready_in_transaction ();

in transaction.cxx.

MSVS2010 reported this:

Unhandled exception at 0x00a31dc6 (odb-d-1.7-vc10.dll) in test.exe:
0xC0000005: Access violation reading location 0x00000000.

This is the debug output:

'test.exe': Loaded 'C:\Documents and Settings\Tester\My Documents\Visual
Studio 2010\Projects\com_dll\Debug\test.exe', Symbols loaded.

'test.exe': Loaded 'C:\WINDOWS\system32\ntdll.dll', Cannot find or open the
PDB file

'test.exe': Loaded 'C:\WINDOWS\system32\kernel32.dll', Cannot find or open
the PDB file

'test.exe': Loaded 'C:\WINDOWS\system32\ole32.dll', Cannot find or open the
PDB file

'test.exe': Loaded 'C:\WINDOWS\system32\advapi32.dll', Cannot find or open
the PDB file

'test.exe': Loaded 'C:\WINDOWS\system32\rpcrt4.dll', Cannot find or open
the PDB file

'test.exe': Loaded 'C:\WINDOWS\system32\secur32.dll', Cannot find or open
the PDB file

'test.exe': Loaded 'C:\WINDOWS\system32\gdi32.dll', Cannot find or open the
PDB file

'test.exe': Loaded 'C:\WINDOWS\system32\user32.dll', Cannot find or open
the PDB file

'test.exe': Loaded 'C:\WINDOWS\system32\msvcrt.dll', Cannot find or open
the PDB file

'test.exe': Loaded 'C:\WINDOWS\system32\msvcr100d.dll', Symbols loaded.

'test.exe': Loaded 'C:\WINDOWS\system32\msvcp100d.dll', Symbols loaded.

'test.exe': Loaded 'C:\WINDOWS\system32\imm32.dll', Cannot find or open the
PDB file

'test.exe': Loaded 'C:\WINDOWS\system32\uxtheme.dll', Cannot find or open
the PDB file

'test.exe': Loaded 'C:\WINDOWS\system32\msctf.dll', Cannot find or open the
PDB file

'test.exe': Loaded 'C:\WINDOWS\system32\clbcatq.dll', Cannot find or open
the PDB file

'test.exe': Loaded 'C:\WINDOWS\system32\comres.dll', Cannot find or open
the PDB file

'test.exe': Loaded 'C:\WINDOWS\system32\oleaut32.dll', Cannot find or open
the PDB file

'test.exe': Loaded 'C:\WINDOWS\system32\version.dll', Cannot find or open
the PDB file

'test.exe': Loaded 'C:\Documents and Settings\Tester\My Documents\Visual
Studio 2010\Projects\com_dll\Debug\com_dll.dll', Symbols loaded.

'test.exe': Loaded 'C:\Documents and Settings\Tester\My Documents\Visual
Studio 2010\Projects\com_dll\Debug\odb-mysql-d-1.7-vc10.dll', Symbols
loaded.

'test.exe': Loaded 'C:\Documents and Settings\Tester\My Documents\Visual
Studio 2010\Projects\com_dll\Debug\odb-d-1.7-vc10.dll', Symbols loaded.

'test.exe': Loaded 'C:\Documents and Settings\Tester\My Documents\Visual
Studio 2010\Projects\com_dll\Debug\libmysql.dll', Cannot find or open the
PDB file

'test.exe': Loaded 'C:\WINDOWS\system32\ws2_32.dll', Cannot find or open
the PDB file

'test.exe': Loaded 'C:\WINDOWS\system32\ws2help.dll', Cannot find or open
the PDB file

'test.exe': Loaded 'C:\WINDOWS\system32\mfc100ud.dll', Symbols loaded.

'test.exe': Loaded 'C:\WINDOWS\system32\shlwapi.dll', Cannot find or open
the PDB file

'test.exe': Loaded 'C:\WINDOWS\system32\comctl32.dll', Cannot find or open
the PDB file

'test.exe': Loaded 'C:\WINDOWS\system32\msimg32.dll', Cannot find or open
the PDB file

'test.exe': Loaded 'C:\WINDOWS\system32\atl100.dll', Cannot find or open
the PDB file

'test.exe': Loaded 'C:\WINDOWS\system32\mswsock.dll', Cannot find or open
the PDB file

'test.exe': Loaded 'C:\WINDOWS\system32\dnsapi.dll', Cannot find or open
the PDB file

'test.exe': Loaded 'C:\WINDOWS\system32\iphlpapi.dll', Cannot find or open
the PDB file

'test.exe': Loaded 'C:\WINDOWS\system32\winrnr.dll', Cannot find or open
the PDB file

'test.exe': Loaded 'C:\WINDOWS\system32\wldap32.dll', Cannot find or open
the PDB file

'test.exe': Loaded 'C:\WINDOWS\system32\wshbth.dll', Cannot find or open
the PDB file

'test.exe': Loaded 'C:\WINDOWS\system32\setupapi.dll', Cannot find or open
the PDB file

'test.exe': Loaded 'C:\WINDOWS\system32\rasadhlp.dll', Cannot find or open
the PDB file

'test.exe': Loaded 'C:\WINDOWS\system32\mfc100enu.dll', Binary was not
built with debug information.

First-chance exception at 0x00a31dc6 (odb-d-1.7-vc10.dll) in test.exe:
0xC0000005: Access violation reading location 0x00000000.

Unhandled exception at 0x00a31dc6 (odb-d-1.7-vc10.dll) in test.exe:
0xC0000005: Access violation reading location 0x00000000.

First-chance exception at 0x00a31dc6 (odb-d-1.7-vc10.dll) in test.exe:
0xC0000005: Access violation reading location 0x00000000.

Unhandled exception at 0x00a31dc6 (odb-d-1.7-vc10.dll) in test.exe:
0xC0000005: Access violation reading location 0x00000000.

The program '[240] test.exe: Native' has exited with code 0 (0x0).
All required DLLs appear loaded correctly.

Second, as I said at the beginning, the problem does not exist in Windows
7. So there could be a fundamental difference between them the way they
handle DLLs.
Third, it does not matter which database engine is used, MySQL or SQLite.
The problem appears the same.

What do you think?

Many thanks and Best regards,

Cuong
On Mon, Dec 12, 2011 at 2:10 PM, Boris Kolpackov <boris at codesynthesis.com>wrote:

> Hi Cuong,
>
> Cuong Minh Tran <vaioinman at googlemail.com> writes:
>
> > Nonetheless, looking back through the archives, I found my problem to be
> > very much like this:
> >
> > http://www.codesynthesis.com/pipermail/odb-users/2011-June/000127.html
> >
> > But the archive does not seem to contain the solution.
>
> In that case the problem seemed to be missing sqlite3.dll. I checked
> the output from your original post and I see that libmysql.dll was
> loaded successfully.
>
> I think the best way to figure out what's going on is to create
> a small test case that reproduces the problem. Then I would be
> able to try to find out the cause.
>
> Boris
>


More information about the odb-users mailing list