Creating In-Memory File Systems with Google’s Jimfs

Sometimes when writing an application we might consider using an in-memory file system to speed up data access or to create some kind of cache. There are different libraries to help us here but one looks especially promising for me because it supports almost every functionality of the Java NIO File APIs added in Java 7 – from creating, reading, deleting files and directory to handling symbolic and hard links or watching directory changes with a WatchService. ...

March 18, 2015 · 4 min · 778 words · Micha Kops

Java Persistence API: Controlling the Second-Level-Cache

Using the Java Persistence API and a decent persistence provider allows us to configure and fine-tune when and how the second level cache is used in our application. In the following short examples, we’re going to demonstrate those features written as JUnit test cases and running on a H2 in-memory database. Figure 1. Persistence Unit Configuration Setup First of all we need some basic setup to run the following examples .. we need to select a JPA persistence provider and database, create a persistence-unit configuration and an environment to run tests on an in-memory database. ...

April 21, 2014 · 7 min · 1417 words · Micha Kops