That sounds clear enough. Since I can not guarantee my databases will not be accessed from threads that may be interrupted (by the servlet container) we have to use async. Thanks for clearing that up.
On Thursday, 28 July 2022 at 14:11:58 UTC+2 Evgenij Ryazanov wrote: > Hello! > > file: and nio: have no special meaning in modern versions of H2, > jdbc:h2:file:SOME_PATH, jdbc:h2:nio:SOME_PATH, and plain jdbc:h2:SOME_PATH > have exactly the same meaning. > Unfortunately, invocation of Thread.interrupt() during disk I/O closes the > underlying file channel, so it isn't safe to interrupt a thread that > executes some database command in embedded persistent database. If you use > a separate server process you can interrupt client threads safely. > > async: file system uses asynchronous I/O on Windows and it may work a > little bit faster, but better performance is not guaranteed for all cases. > On POSIX systems in simply performs I/O in separate threads, so > performance may be slightly reduced. These systems, unlike Windows, don't > need any special optimizations for multi-threaded access to the same file. > In both cases case Thread.interrupt() on thread that works with database > doesn't perform disk I/O by itself, so if you cannot prevent interrupts and > cannot use a separate server, you need to use this file system abstraction > layer. > -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/h2-database/7a57232e-a045-4aff-8b84-fcc1a61fe751n%40googlegroups.com.
