[
https://issues.apache.org/jira/browse/FELIX-2280?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12868007#action_12868007
]
Christian Müller commented on FELIX-2280:
-----------------------------------------
About your last question (multiple 'SELECT * FROM tableName FOR UPDATE' in the
OracleJDBCLock):
This behavior is because of this integration test:
{code}
@Test
public void isAliveShouldReturnFalseIfItNotHoldsTheLock() throws Exception {
Connection connection = null;
try {
lock = createLock(props);
assertTrue(lock.lock());
lock.lockConnection.rollback(); // release the lock
connection = lock(tableName, clustername); // another connection
locks the table
assertFalse(lock.isAlive());
} finally {
close(connection);
}
}
{code}
I want to make sure, that 'isAlive()' only returns true, if it holds the lock.
In this test case, the first instance instance lose the lock and a second
instance get it. So, the 'isAlive()' method of the first instance should return
false. The only solution I found was to execute 'SELECT FROM UPDATE' each time
I check, whether or not this instance holds the lock.
May be this test is not real or possible? I have adopted it's possible to lose
the database lock, but still have a connection to the database...
Cheers,
Christian
> 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
> Assignee: Jamie goodyear
> Attachments: FELIX-2280.patch, FELIX-2280.patch, FELIX-2280.patch,
> 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.