The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My work

  • My badges

  • Twitter Updates

  • My Flickr Stream

    20140508-Delphi-2007--Project-Options--Cannot-Edit-Application-Title-HelpFile-Icon-Theming

    20140430-Fiddler-Filter-Actions-Button-Run-Filterset-now

    20140424-Windows-7-free-disk-space

    More Photos
  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,776 other followers

Firebird [# CORE-3558] server reports that DB file is used by another application on secondary attachment attempt through a symlink

Posted by jpluimers on 2016/12/15

It took quite a while to find out what happened, but this is the underlying issue: [# CORE-3558] FB server reports that DB file is used by another application on secondary attachment attempt through a symlink – Firebird RDBMS Issue Tracker.

The error you get in Windows is this one: I/O error during “CreateFile (open)” “The process cannot access the file because it is being used by another process.”

When you look with Process Explorer or handle.exe (both from SysInternals) they will show exactly the same filename (the canonical name to which the SymLink points).

But when you look in the config files of the applications, the database connections point to different filenames. Either (or both) are a symlink themselves or have a directory in their path that is a symlink.

 

In my case it was the latter: one of the directories in the path had an mklink.exe created link to another directory that had a directory contained the final file. There is even an API function that gets the canonical file name: GetFinalPathNameByHandle function (Windows)

Firebird doesn’t use that API on Windows (probably because it’s only available as of Windows Vista and Windows Server 2008) but does use a similar POSIX function (so on Mac OS X and Linux you don’t get this error).

Note that the above error messages can also happen when you use an embedded connection to a database (i.e. a connection string without a network address). There it is normal you get an exclusive file lock.

–jeroen

via: ADO.NET – a problem with multiple connections to the database (Russian) with Google Translate

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: