#108 Can't open database - unavailable resource

closed
Michael Hieke
None
5
2012-10-20
2007-04-29
Dan Cooperstock
No

When I try to connect to a database (which used to work!) I get a message box, as follows:

* IBPP: SQLException
Context: Database::Connect
Message: isc_attach_database failed

SQL Message: -904
Unsuccessful execution caused by an unavailable resource.

Engine code: 335544375
Engine message: unavailable database

The bizarre thing is that it appears the database registration exactly matches how I am connecting from a .NET app I am developing, which is opening the DB fine.

I'm using embedded Firebird. I am not running the app at the same time (I know from experience that doesn't work!) and I even closed VisualStudio.NET in case that was relevant (which I think it shouldn't be).

Any bright ideas? Thanks.

Discussion

  • Milan Babuskov
    Milan Babuskov
    2007-05-08

    Logged In: YES
    user_id=577247
    Originator: NO

    I looks like VS.NET is somehow leaving the database open. Perhaps it leaves embedded DLL files loaded in memory in case it "need them later" and the connection is not closed properly. Create a test case and when this happens, try to delete the database file from the disk (when neither FR or VS.NET are running). If it doesn't allow you to delete it than my assumption is correct. If it does allow, then we need to investigate further.

    Which operating system are you using?

     
  • Logged In: YES
    user_id=1585805
    Originator: YES

    That's not it. I closed VS.NET and had the same problem. I also could delete the database file. Also, another application (fyiReporting) is using the file successfully.

    I'm on Windows XP.

    This used to work fine, and I'm not aware of anything major in my configuration that has changed.

     
  • Logged In: YES
    user_id=1585805
    Originator: YES

    Any progress or further ideas on this? FlameRobin is a really useful tool, and it's quite frustrating that I can't use it any more.

     
  • Michael Hieke
    Michael Hieke
    2007-06-07

    Logged In: YES
    user_id=17524
    Originator: NO

    Do you see any pattern? Have you installed a new Firebird version, and then it stopped working? Does it work when the PC is started, and stops working once you connect with another program, or does it not work at all? I honestly have no idea what might be wrong, so if you can add any more info...

     
  • Logged In: YES
    user_id=1585805
    Originator: YES

    This happens right all the time, include after a reboot when nothing else (except services like my Norton Internet Security) is running. I can't tell you what changed before this problem started - I'm certainly not aware of anything significant.

    I'm using Firebird version 2.0.1, and using the Embedded version. Flamerobin is picking up fbclient.dll (which for me is a copy of fbembed.dll) from the PATH. I'm using the .NET driver from November 16, 2006, and I have copied it (FirebirdSql.Data.FirebirdClient.dll) into the Flamerobin directory.

    Anyways, I have pretty much given up on this. Everything works in my .NET application I'm developing with VS.NET, in a reporting tool (fyiReporting) and I have downloaded another admin tool that works (IB_SQL).

     
  • Logged In: YES
    user_id=1585805
    Originator: YES

    Sorry, the first sentence of that last comment was supposed to be:

    "This happens all the time, including right after a reboot ..."

     
  • Michael Hieke
    Michael Hieke
    2007-06-07

    Logged In: YES
    user_id=17524
    Originator: NO

    If you have not really given up on FR yet, could you please run FlameRobin.exe under the Dependency Tracker tool (http://www.dependencywalker.com/)? It gives a lot of information about (among other things) loaded modules, so when you try to connect to your database you should see which client libraries IBPP tries to load, and which one it finds and finally uses for connection. It's about the last thing I can think of, short of debugging it under MSVC.

     
  • Logged In: YES
    user_id=1585805
    Originator: YES

    OK, I did that.

    Right at load time, I get an error about not finding DWMAPI.DLL.

    Then when I start tracing Flamerobin I get errors about not finding FBCLIENT.DLL or FBEMBED.DLL, but when I look in the details, it is trying to find them in C:\Program Files\Flamerobin and fails. But right after that it successfully loads FBCLIENT.DLL from c:\program files\FirebirdServer\bin.

    BUT, that isn't the right version (one that's a copy of FBEMBED.DL) - it's obviously a real server version. That doesn't make sense, because the version that is found first on my PATH is in c:\program files\firebird. Do you have a hard-coded direction for the program to look in c:\program files\FirebirdServer\bin before using the PATH? That doesn't sounds like a good plan.

    Some other errors I see are:
    GetProcAddress(0x7C800000 [KERNEL32.DLL], "FlsAlloc") called from "MSVCR71.DLL" at address 0x7C341950 and returned NULL. Error: The specified procedure could not be found (127).
    GetProcAddress(0x7C800000 [KERNEL32.DLL], "FlsGetValue") called from "MSVCR71.DLL" at address 0x7C34195D and returned NULL. Error: The specified procedure could not be found (127).
    GetProcAddress(0x7C800000 [KERNEL32.DLL], "FlsSetValue") called from "MSVCR71.DLL" at address 0x7C34196A and returned NULL. Error: The specified procedure could not be found (127).
    GetProcAddress(0x7C800000 [KERNEL32.DLL], "FlsFree") called from "MSVCR71.DLL" at address 0x7C341977 and returned NULL. Error: The specified procedure could not be found (127).
    GetProcAddress(0x755C0000 [MSCTFIME.IME], "ImeGetImeMenuItems") called from "IMM32.DLL" at address 0x76397374 and returned NULL. Error: The specified procedure could not be found (127).

    Anyways, based on this information (about how it was trying to load FBCLIENT.DLL / FBEMBED.DLL) I copied FBEMBED.DLL into C:\Program Files\Flamerobin and it is working again. Thanks. This sure took a long time to figure out, though!

     
  • Michael Hieke
    Michael Hieke
    2007-06-07

    Logged In: YES
    user_id=17524
    Originator: NO

    Dan,

    there's more to be said than I can reasonably add to the tracker here. If you're interested in discussing this, please join us in flamrobin-devel list.

    Most of your problems with missing DLLs or exports are nothing to worry about. The client library isn't loaded from the path, but IBPP tries a few hard-coded library locations. That is to change in a future version, which will hopefully bring the feature of different client libraries for different databases to FR. If that's important to you, please add a feature request with some specifics.

    As for taking a long time to figure this out - better late than never ;-)

     


Anonymous


Cancel   Add attachments