Closed emmanuel-keller closed 6 years ago
@dadoonet Thanks for that great patch ! https://github.com/qwazr/jdbc-cache-driver/commit/8226a356c0c2a21fea457448b9b6434c9bafdce7
Do you have any idea of which improvement would make it production ready ? (having the next 1.3 release in mind)
Using a MappedByteBuffer for instance ?
Might be a good idea indeed. I took the most naive approach at the beginning but yeah that might work. My goal with all that is to use your library with the on disk or in memory cache system within an elasticsearch plugin. So I need to check if it actually can run in the context of a java application with a security manager.
I'll give it a try.
Note that with the code we have now, we can always add a new implementation easily. In addition to jdbc:cache:mem:my-memory-cache
we can add support for use jdbc:cache:mmap:my-memory-cache
. WDYT?
we can add support for use jdbc:cache:mmap:my-memory-cache.
There are some use cases where we know we have enough memory and we want to be as fast as possible so we just want to hold in memory a ResultSet related to a given Statement.
This commit implements a new type of cache using memory instead of hard disk files.
It uses a naive implementation with ByteArrayStreams which is not recommended for production.
The syntax of the URL can be: