[
https://issues.apache.org/jira/browse/JCR-940?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12529346
]
Thomas Mueller commented on JCR-940:
------------------------------------
Sorry, I have attached my comments to the wrong bug (JCR-1138).
Hi,
The patch looks good. I tried with PostgreSQL and got this problem:
ConnectionRecoveryManager: could not setup connection, reason: could not load
driver: org.postgresql.Driver, state/code: null/0
(ConnectionRecoveryManager.java, line 430)
ConnectionRecoveryManager: blocking until database connection is up again...
(ConnectionRecoveryManager.java, line 368)
Do you agree that retry doesn't make sense if the driver could not be loaded?
If yes I will change the code. Also, it would probably make sense to write the
database URL and the user name (not the password) to the log file, so the
person (alias poor guy) who has to start the database knows which one and can
test the connection using some other tool.
If that's OK with you, I will make it throw a RepositoryException if the
database driver could not be loaded or initialized
(ExceptionInInitializerError):
private void setupConnection() throws SQLException, RepositoryException {
try {
Class driverClass = Class.forName(driver);
// Workaround for Apache Derby:
// The JDBC specification recommends the Class.ForName method
without the .newInstance() method call,
// but adding the newInstance() guarantees that Derby will be
booted on any Java Virtual Machine.
driverClass.newInstance();
} catch (Throwable e) {
throw new RepositoryException("Could not load or initialize the
database driver class " + driver, e);
}
> add db connection autoConnect for BundleDbPersistenceManager.
> -------------------------------------------------------------
>
> Key: JCR-940
> URL: https://issues.apache.org/jira/browse/JCR-940
> Project: Jackrabbit
> Issue Type: Improvement
> Components: jackrabbit-core
> Affects Versions: 1.3
> Reporter: Xiaohua Lu
> Attachments: JCR-940-2nd.patch, JCR-940-v2.patch, JCR-940-v3.patch,
> JCR-940.patch
>
>
> Since bundled db pm doesn't inherited from database pm, it can't reconnect
> once database is bounced. it would be nice to add this feature.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.