Reading ResultSet from multiple threads
Posted
by superdario
on Stack Overflow
See other posts from Stack Overflow
or by superdario
Published on 2010-03-27T18:56:45Z
Indexed on
2010/03/27
19:03 UTC
Read the original article
Hit count: 259
Hello,
In the database, I have a definition table that is read from the application once upon starting. This definition table rarely changes, so it makes sense to read it once and restart the application every time it changes.
However, after the table is read (put into a ResultSet), it will be read by multiple handlers running in their own threads.
How do you suggest to accomplish this?
My idea was to populate a CachedRowSet, and then create a copy of this set (through the createCopy() method) for each handler every time a new request comes.
Do you think this is wise? Does this offer a good performance?
Thanks.
© Stack Overflow or respective owner