You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
// Initialize the cache driverClass.forName("com.qwazr.jdbc.cache.Driver");
// Provide the URL and the Class name of the backend driverPropertiesinfo = newProperties();
info.setProperty("cache.driver.url", "jdbc:derby:memory:myDB;create=true");
info.setProperty("cache.driver.class", "org.apache.derby.jdbc.EmbeddedDriver");
// Get your JDBC connectionConnectioncnx = DriverManager.getConnection("jdbc:cache:mem:my-memory-cache", info);
The syntax of the URL can be:
jdbc:cache:file:{path-to-the-cache-directory} for on disk cache
jdbc:cache:mem:{name-of-the-cache} for in memory cache
The text was updated successfully, but these errors were encountered:
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?
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:
The text was updated successfully, but these errors were encountered: