The in-memory storage module is provided with any DRAGOS assembly. Just use the corresponding URL schema to create an in-memory storage:
memory:///NAME
where NAME is some unique name among all opened memory graph pools.
As of Feb'06, DRAGOS In-Memory Graph Storage can be stored persistently using the Java serialization mechanism. When activated, the memory graph pool will try to read the contents of the given file. If no storage file exists, an empty graph pool will be used. When closing the graph pool, its contents is written to the given file. To activate persistency, you might choose between two alternatives: Global or graphpool-specific persistency.
java -Ddragos.db.memory.persistency=/tmp/store-my-graphs-here [...]
Note, this way multiple graph pools opened by one application will always use the same file for storage. So the graphpool closed last will overwrite the storage of all other pools. All pools will try to read this data when opened again. This might not what you want when using multiple memory graph pools.
memory:///A?persistency=/tmp/store-my-graphs-here
As hard coding filenames in a datasource URL might be inappropriate, you may refer to an environment variable. For this purpose, preprend the value of persistency with an @. For example, the datasource URL
memory:///A?persistency=@myfile
in conjunction with the command line
java -Dmyfile=/tmp/store-my-graphs-here [...]
stores and retrieves graphs to/from the given file. If the environment variable is not set, no persistency will be used.
No matter which approach for passing the persistency file is used, some convenience methods apply: