[ 
https://issues.apache.org/jira/browse/FELIX-2280?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12863443#action_12863443
 ] 

Jamie goodyear edited comment on FELIX-2280 at 5/3/10 2:20 PM:
---------------------------------------------------------------

Hi Christian,

The general procedure your following here is ok, however your going to need to 
make a one off exception for Oracle here :)

* 1) check that the connection is not null
* 2) check that the connection is not closed
* 3) run a select query against the database
* 4) check that at leased one row was returned.

When we perform an update on a long lived locked table Oracle will save a copy 
of the transaction in it's UNDO table space. Eventually this can cause the UNDO 
table to become full, disrupting all locks in the DB instance. If you were to 
commit the update, thereby cleaning up UNDO space, you will give up the table 
lock. A select query just touches the table, ensuring we can still read the DB 
but doesn't add to the UNDO.

Cheers,
Jamie

      was (Author: jgoodyear):
    Hi Christian,

The general procedure your following here is ok, however your going to need to 
make a one off exception for Oracle here :)

* 1) check that the connection is not null
* 2) check that the connection is not closed
* 3) run a select query against the database
* 4) check that at leased one row was returned.

When we perform an update on a long lived locked table Oracle will save a copy 
of the transaction in it's UNDO table space. Eventually this can cause the UNDO 
table to become full, disrupting all locks in the DB instance. If you were to 
commit the update, thereby cleaning up UNDO space, you will give up the table 
lock. 

Cheers,
Jamie
  
> 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, 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.

Reply via email to