[
https://issues.apache.org/jira/browse/FELIX-3395?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13229464#comment-13229464
]
Pieter commented on FELIX-3395:
-------------------------------
I can easily configure Pax Runner not the delete the cache, but that introduced
another problem for me, see
http://groups.google.com/group/ops4j/browse_thread/thread/eca643395acbd529. You
are right that this might be a problem for every bundle that saves it's data to
the private area, but luckily for me I don't use other bundles doing so.
Storing the data in the bundle's private area is a good approach, I wouldn't
argue that. However, the Preferences javadoc
(http://www.osgi.org/javadoc/r4v41/org/osgi/service/prefs/Preferences.html)
states that "This data is stored persistently in an implementation-dependent
backing store. Typical implementations include flat files, OS-specific
registries, directory servers and SQL databases.", which led me to the idea
that a configurable location might be a good idea.
> Make preferences persistence location configurable
> --------------------------------------------------
>
> Key: FELIX-3395
> URL: https://issues.apache.org/jira/browse/FELIX-3395
> Project: Felix
> Issue Type: Wish
> Components: Preferences Service
> Reporter: Pieter
>
> I want Preference Service to persist stored preferences and have them survive
> system restarts. Preference Service stores its stuff in the OSGi frameworks'
> cache region, which get cleared on restart (by Pax Runner, which is what I
> use). Trying to get around this was problematic, so I figured it would be
> nice to be able have the preferences database outside the cache directory. A
> system property like "felix.prefs.rootdir" could be used to set the location.
> I patched the Preference Service from trunk to get this feature and the
> changes are minimal, I just added the following lines to the
> DataFileBackingStoreImpl constructor:
> String configuredRootDir = System.getProperty("felix.prefs.rootdir");
> this.rootDirectory = configuredRootDir == null ?
> context.getDataFile("") : new File(configuredRootDir);
> this.rootDirectory.mkdirs();
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira