> is it ok to reuse one connection with multiple threads? Is the H2
> connection thread-safe?
I will add the following paragraph to the Javadocs of Connection:
* Thread safety: This database is thread-safe, because it synchronizes access
* to the connection. However, for compatibility with other databases, a
* connection should only be used in one thread at any time.
> could it be when I open the database in
> the read-only mode?
No, because even a read-only database can have state: you can create
local temporary tables and variables (SET @X=10 and so on). But you
can use multiple connections in read-only mode of course.
What is your use case?
Regards,
Thomas