Hm.. Now I understand your case and current behavior of H2 is really
bad for it. I looked at the code of WriterThread and it seems to me
that it is inefficient because by default WriterThread flushes
transaction log of database once per 500 ms. If there is no activity
on its database it will be just useless. I think in most of cases it
will be needed less writer threads than opened databases.
It is also seems to me that it will be not that hard to replace
WriterThread with ScheduledThreadPoolExecutor (which will have one
writer thread per database only in the worst case) but this likely
will introduce additional lock contention, so need some experimenting.
Also if I understand right WriterThread is not mandatory, it is just
for better performance and reliability.
Thomas, what do you think about it?

But anyways, James, this change only will make H2 more effective but
will not solve the problem with resources in your architecture - you
still can get out of memory not because of count of threads but just
because of too many opened documents in memory.

regards,
Sergi

-- 
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.

Reply via email to