[ https://issues.apache.org/jira/browse/FELIX-2280?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12862829#action_12862829 ]
Christian Müller commented on FELIX-2280: ----------------------------------------- My proposal/plan is to update the behavior to the following: - new XXXLock() should: - create the database, if they not exists - this is possible for derby (create=true) and mysql (createDatabaseIfNotExist=true) with jdbc url properties. We could append this jdbc url properties if they are not provided and let the driver handle the creation of the database. - create the lock table if they not exist and populate the table - lock() should: - return true, if it is still connected, could aquire the lock and could update exact one row - otherwise return false - isAlive() should: - return true, if it is still connected, holds the lock and could update exact one row - otherwise return false - release() should: - release the connection safely, if they still exist > To much code duplication in DefaultJDBCLock, OracleJDBCLock and MySQLJDBCLock > ----------------------------------------------------------------------------- > > Key: FELIX-2280 > URL: https://issues.apache.org/jira/browse/FELIX-2280 > Project: Felix > Issue Type: Improvement > Components: Karaf > Affects Versions: karaf-1.4.0 > Environment: All > Reporter: Christian Müller > Attachments: FELIX-2280.patch > > > org.apache.felix.karaf.main.DefaultJDBCLock, > org.apache.felix.karaf.main.MySQLJDBCLock and > org.apache.felix.karaf.main.OracleJDBCLock has to much code duplications. I > propose a solution like in ActiveMQ [package > org.apache.activemq.store.jdbc.adapter|http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/jdbc/adapter/]. > And we should implement some unit tests for it. > If it's fine for you, I will try to improve this part of karaf and provide a > patch for it. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.