Closed GoogleCodeExporter closed 8 years ago
Hi,
Sorry I don't understand what the problem is. You wrote "This explains why"
but the document at the given link doesn't explain the problem to me.
> There's gotta be some way to code that in H2, instead of having to have users
contact their hosts to fix it all the time.
Well, could you provide a patch?
Why do you use FILE_LOCK=SOCKET at all (except that it's a documented feature)?
Original comment by thomas.t...@gmail.com
on 25 Jan 2013 at 1:26
The problem is in the localhost portion of the local address method. Some
linux distros don't put their localdomain in the hosts file as 127.0.0.1 by
default, and this is causing the unknown host error. The "this explains why"
shows the way the hosts file is when it works and when it doesn't.
I'm using the SOCKET lock because it's crash-proof. The FILE lock leaves the
lock file there after a crash, and there's no way to check if something's
really using the DB with the FILE lock in place. And I didn't want to leave it
unlocked because it truly does overwrite changes from another process.
However, because of this issue, I've had to leave it unlocked anyway.
Original comment by rhydonj@gmail.com
on 25 Jan 2013 at 3:28
In the linked document, the only difference I see is with 127.0.1.1 not with
127.0.0.1.
127.0.0.1 is localhost in both cases. So no, I don't understand how this links
shows the problem.
> I'm using the SOCKET lock because it's crash-proof.
What do you mean with crash-proof? The default is also crash-proof in my
understanding of the word crash-proof.
> The FILE lock leaves the lock file there after a crash, and there's no way to
check if something's really using the DB with the FILE lock in place.
You can: try to open the database. That's anyway the best way to do it. You
shouldn't try to dig into the internals of the database anyway. Just use the
API.
> I've had to leave it unlocked anyway.
If you do, then you are asking for trouble. But you decide of course.
Original comment by thomas.t...@gmail.com
on 12 Feb 2013 at 5:56
> What do you mean with crash-proof? The default is also crash-proof in my
understanding of the word crash-proof.
I mean that, in case of a crash, it's possible for the library itself to tell
that the process that locked the database is no longer running. With the FILE
lock, that's not possible.
> You can: try to open the database. That's anyway the best way to do it. You
shouldn't try to dig into the internals of the database anyway. Just use the
API.
If I try to open the database after a crash with the FILE lock, it will read
the lock file there and say the database is open in another process, even
though it probably isn't, since it crashed.
> In the linked document, the only difference I see is with 127.0.1.1 not with
127.0.0.1.
127.0.0.1 is localhost in both cases. So no, I don't understand how this links
shows the problem.
The problem is that localdomain and localhost aren't the same for linux
distros, like they are for Windows machines, and localdomain is what is needed
to access some localhost-type functionality on linux.
Meh, whatever, I see it's not possible to express to you, so I'll just have to
wait the indefinite period until someone on the team experiences the problem.
Original comment by rhydonj@gmail.com
on 12 Feb 2013 at 4:30
> With the FILE lock, that's not possible.
It is, see the docs as
http://h2database.com/html/advanced.html#file_locking_protocols
The issue tracker is not a discussion forum. Please use StackOverflow or the
Google Group for questions.
Original comment by thomas.t...@gmail.com
on 12 Feb 2013 at 7:11
Original issue reported on code.google.com by
rhydonj@gmail.com
on 24 Jan 2013 at 8:27