Thank you. Use case: we fetch database into H2 from your central server and then we do some reporting with this "snapshot". Many concurrent reads, no writes. Thread count = no-CPUS + 1.
Before H2 we have used java serialization API. Pros: very very fast. Cons: needs big heap size, loading from disc is slow (takes 99 % of the overall processing time during simple unit tests). With H2 we are able to process all data in the same time but with constant heap size ;-) plus great flexibility. The only one problem is much bigger snapshot data but its not big deal. We could even implement compacting but we do not care now. LZ On 18 Říj, 11:14, "Thomas Mueller" <[EMAIL PROTECTED]> wrote: > Hi, > > > 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 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "H2 Database" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/h2-database?hl=en -~----------~----~----~----~------~----~------~--~---
