Hi Kevin,
Short answer: this isn't documented anywhere other than in the code.
Installer#getConfigurationResources() explains the naming convention,
though from your post it looks like you are following it ok.
One thing I did note is that the key prefix you are using is
"isis.persistence.sql.xxx" rather than "isis.persistor.sql.xxx". I
don't think this matters (though you should use the latter for
consistency); but you might want to look into the configuration at line
80 to see if there are any keys with the "isis.persistor.xxx" prefix. I
don't think this is your issue though.
The configuration is built up using the
InstallerLookupDefault#mergeConfigurationFor(Installer) method. As each
installer is located, any corresponding property files (ie configuration
resources) are loaded into the global (mutable) configuration builder.
When an Installer is created, its Configuration is an immutable snapshot
of the ConfigurationBuilder at that point in time.
I'm guessing that you the JdbcConnector code is running before the
mergeConfiguration has run. I traced through your code and saw that it
is created as a side-effect of the
PersistenceMechanismInstaller#createOidGenerator(...), which seemed a
little odd to me. What you could do is to put a break point here and
also within mergeConfiguration(...), and see which gets called first.
Let me know how you get on.
Dan
On 06/02/2011 17:59, Kevin Meyer - KMZ wrote:
Hey all,
Where is the algorithms that parse the properties files documented?
I'm finding that when I change the persistor from the default to sql,
then the "persistor_sql.properties" is found (see below):
Copied from the log:
19:48:56,606 [IsisConfigurationBuilderResourceStreams main
INFO ] 'persistor_sql.properties' FOUND
However, none of the sql persistor properties specified within are
available:
Caused by:
org.apache.isis.alternatives.objectstore.sql.SqlObjectStoreException:
No driver specified for database connection
Even though the file contains the required information.
If I put the pesistor property values into "isis.properties", then they're
found and all is A-OK.
Am I misinterpreting the purpose of the persistor_sql.properties file?
Why aren't the values specified therein found?
Contents of persistor_sql.properties:
isis.persistence.sql.jdbc.driver=org.hsqldb.jdbcDriver
isis.persistence.sql.jdbc.connection=jdbc:hsqldb:file:hsql-db/tests
isis.persistence.sql.jdbc.user=sa
isis.persistence.sql.jdbc.password=
If I debug into the framework, then in JdbcConnector.java, line 80, the
configuration:
IsisConfiguration params = IsisContext.getConfiguration();
does not contain the contents of persistor_sql.properties.
Any suggestions?
Regards,
Kevin