You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@karaf.apache.org by "Ton Swieb (JIRA)" <ji...@apache.org> on 2011/06/27 13:04:47 UTC

[jira] [Created] (KARAF-689) Karaf instance can wrongly obtain a lock when the locking table is empty on a Oracle DB

Karaf instance can wrongly obtain a lock when the locking table is empty on a Oracle DB
---------------------------------------------------------------------------------------

                 Key: KARAF-689
                 URL: https://issues.apache.org/jira/browse/KARAF-689
             Project: Karaf
          Issue Type: Bug
          Components: runtime
    Affects Versions: 2.1.3
         Environment: Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
            Reporter: Ton Swieb


When running Karaf in Master/Slave mode a Karaf instance can wrongly obtain a lock when the locking table is empty on a Oracle DB.
Karaf creates a lock table and a lock record in de OracleDB upon first usage. When the lock record is removed afterwards without dropping the table then the locking mechanisme does not work anymore and any instance can wrongly obtain a lock.

This is not an issue for other database systems, because the implementation for other DB systems periodically tries to update the lock record and verify how many records are updated. According to the documentation in the code the "update" functionality has been removed for Oracle because it can exhaust the Oracle UNDO log.

I created a patch which does not use the "update" functionality, but executes an extra check after we acquired the lock. It checks if the SELECT FOR UPDATE used for the lock has not been executed on an empty selection, because when the selection is empty then the locking functionality will not work as expected.

Can you apply this patch to the branches karaf-2.1.x and karaf-2.2.x and the trunk. I looked at the SVN history of the files I have modified and noticed that they are the same in both branches and the trunk.
The patch has been created against the karaf-2.1.x branch.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (KARAF-689) Karaf instance can wrongly obtain a lock when the locking table is empty on a Oracle DB

Posted by "Jamie goodyear (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/KARAF-689?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13055476#comment-13055476 ] 

Jamie goodyear commented on KARAF-689:
--------------------------------------

Hi Ton,

In order to use your patch we're going to need an ASF grant on the file.

Cheers,
Jamie

> Karaf instance can wrongly obtain a lock when the locking table is empty on a Oracle DB
> ---------------------------------------------------------------------------------------
>
>                 Key: KARAF-689
>                 URL: https://issues.apache.org/jira/browse/KARAF-689
>             Project: Karaf
>          Issue Type: Bug
>          Components: runtime
>    Affects Versions: 2.1.3
>         Environment: Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
>            Reporter: Ton Swieb
>            Assignee: Jamie goodyear
>             Fix For: 2.1.6, 2.2.2, 3.0.0
>
>         Attachments: patch.txt
>
>
> When running Karaf in Master/Slave mode a Karaf instance can wrongly obtain a lock when the locking table is empty on a Oracle DB.
> Karaf creates a lock table and a lock record in de OracleDB upon first usage. When the lock record is removed afterwards without dropping the table then the locking mechanisme does not work anymore and any instance can wrongly obtain a lock.
> This is not an issue for other database systems, because the implementation for other DB systems periodically tries to update the lock record and verify how many records are updated. According to the documentation in the code the "update" functionality has been removed for Oracle because it can exhaust the Oracle UNDO log.
> I created a patch which does not use the "update" functionality, but executes an extra check after we acquired the lock. It checks if the SELECT FOR UPDATE used for the lock has not been executed on an empty selection, because when the selection is empty then the locking functionality will not work as expected.
> Can you apply this patch to the branches karaf-2.1.x and karaf-2.2.x and the trunk. I looked at the SVN history of the files I have modified and noticed that they are the same in both branches and the trunk.
> The patch has been created against the karaf-2.1.x branch.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (KARAF-689) Karaf instance can wrongly obtain a lock when the locking table is empty on a Oracle DB

Posted by "Jamie goodyear (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/KARAF-689?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13055478#comment-13055478 ] 

Jamie goodyear commented on KARAF-689:
--------------------------------------

Awesome, thanks again Ton :)

> Karaf instance can wrongly obtain a lock when the locking table is empty on a Oracle DB
> ---------------------------------------------------------------------------------------
>
>                 Key: KARAF-689
>                 URL: https://issues.apache.org/jira/browse/KARAF-689
>             Project: Karaf
>          Issue Type: Bug
>          Components: runtime
>    Affects Versions: 2.1.3
>         Environment: Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
>            Reporter: Ton Swieb
>            Assignee: Jamie goodyear
>             Fix For: 2.1.6, 2.2.2, 3.0.0
>
>         Attachments: patch.txt, patch.txt
>
>
> When running Karaf in Master/Slave mode a Karaf instance can wrongly obtain a lock when the locking table is empty on a Oracle DB.
> Karaf creates a lock table and a lock record in de OracleDB upon first usage. When the lock record is removed afterwards without dropping the table then the locking mechanisme does not work anymore and any instance can wrongly obtain a lock.
> This is not an issue for other database systems, because the implementation for other DB systems periodically tries to update the lock record and verify how many records are updated. According to the documentation in the code the "update" functionality has been removed for Oracle because it can exhaust the Oracle UNDO log.
> I created a patch which does not use the "update" functionality, but executes an extra check after we acquired the lock. It checks if the SELECT FOR UPDATE used for the lock has not been executed on an empty selection, because when the selection is empty then the locking functionality will not work as expected.
> Can you apply this patch to the branches karaf-2.1.x and karaf-2.2.x and the trunk. I looked at the SVN history of the files I have modified and noticed that they are the same in both branches and the trunk.
> The patch has been created against the karaf-2.1.x branch.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (KARAF-689) Karaf instance can wrongly obtain a lock when the locking table is empty on a Oracle DB

Posted by "Ton Swieb (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/KARAF-689?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ton Swieb updated KARAF-689:
----------------------------

    Attachment: patch.txt

Attached the patch with the ASF grant.

> Karaf instance can wrongly obtain a lock when the locking table is empty on a Oracle DB
> ---------------------------------------------------------------------------------------
>
>                 Key: KARAF-689
>                 URL: https://issues.apache.org/jira/browse/KARAF-689
>             Project: Karaf
>          Issue Type: Bug
>          Components: runtime
>    Affects Versions: 2.1.3
>         Environment: Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
>            Reporter: Ton Swieb
>            Assignee: Jamie goodyear
>             Fix For: 2.1.6, 2.2.2, 3.0.0
>
>         Attachments: patch.txt, patch.txt
>
>
> When running Karaf in Master/Slave mode a Karaf instance can wrongly obtain a lock when the locking table is empty on a Oracle DB.
> Karaf creates a lock table and a lock record in de OracleDB upon first usage. When the lock record is removed afterwards without dropping the table then the locking mechanisme does not work anymore and any instance can wrongly obtain a lock.
> This is not an issue for other database systems, because the implementation for other DB systems periodically tries to update the lock record and verify how many records are updated. According to the documentation in the code the "update" functionality has been removed for Oracle because it can exhaust the Oracle UNDO log.
> I created a patch which does not use the "update" functionality, but executes an extra check after we acquired the lock. It checks if the SELECT FOR UPDATE used for the lock has not been executed on an empty selection, because when the selection is empty then the locking functionality will not work as expected.
> Can you apply this patch to the branches karaf-2.1.x and karaf-2.2.x and the trunk. I looked at the SVN history of the files I have modified and noticed that they are the same in both branches and the trunk.
> The patch has been created against the karaf-2.1.x branch.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (KARAF-689) Karaf instance can wrongly obtain a lock when the locking table is empty on a Oracle DB

Posted by "Jamie goodyear (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/KARAF-689?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jamie goodyear updated KARAF-689:
---------------------------------

    Comment: was deleted

(was: test)

> Karaf instance can wrongly obtain a lock when the locking table is empty on a Oracle DB
> ---------------------------------------------------------------------------------------
>
>                 Key: KARAF-689
>                 URL: https://issues.apache.org/jira/browse/KARAF-689
>             Project: Karaf
>          Issue Type: Bug
>          Components: runtime
>    Affects Versions: 2.1.3
>         Environment: Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
>            Reporter: Ton Swieb
>            Assignee: Jamie goodyear
>             Fix For: 2.1.6, 2.2.2, 3.0.0
>
>         Attachments: karaf689.txt, patch.txt
>
>
> When running Karaf in Master/Slave mode a Karaf instance can wrongly obtain a lock when the locking table is empty on a Oracle DB.
> Karaf creates a lock table and a lock record in de OracleDB upon first usage. When the lock record is removed afterwards without dropping the table then the locking mechanisme does not work anymore and any instance can wrongly obtain a lock.
> This is not an issue for other database systems, because the implementation for other DB systems periodically tries to update the lock record and verify how many records are updated. According to the documentation in the code the "update" functionality has been removed for Oracle because it can exhaust the Oracle UNDO log.
> I created a patch which does not use the "update" functionality, but executes an extra check after we acquired the lock. It checks if the SELECT FOR UPDATE used for the lock has not been executed on an empty selection, because when the selection is empty then the locking functionality will not work as expected.
> Can you apply this patch to the branches karaf-2.1.x and karaf-2.2.x and the trunk. I looked at the SVN history of the files I have modified and noticed that they are the same in both branches and the trunk.
> The patch has been created against the karaf-2.1.x branch.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (KARAF-689) Karaf instance can wrongly obtain a lock when the locking table is empty on a Oracle DB

Posted by "Jamie goodyear (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/KARAF-689?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jamie goodyear updated KARAF-689:
---------------------------------

    Attachment: karaf689.txt

test

> Karaf instance can wrongly obtain a lock when the locking table is empty on a Oracle DB
> ---------------------------------------------------------------------------------------
>
>                 Key: KARAF-689
>                 URL: https://issues.apache.org/jira/browse/KARAF-689
>             Project: Karaf
>          Issue Type: Bug
>          Components: runtime
>    Affects Versions: 2.1.3
>         Environment: Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
>            Reporter: Ton Swieb
>            Assignee: Jamie goodyear
>             Fix For: 2.1.6, 2.2.2, 3.0.0
>
>         Attachments: karaf689.txt, patch.txt
>
>
> When running Karaf in Master/Slave mode a Karaf instance can wrongly obtain a lock when the locking table is empty on a Oracle DB.
> Karaf creates a lock table and a lock record in de OracleDB upon first usage. When the lock record is removed afterwards without dropping the table then the locking mechanisme does not work anymore and any instance can wrongly obtain a lock.
> This is not an issue for other database systems, because the implementation for other DB systems periodically tries to update the lock record and verify how many records are updated. According to the documentation in the code the "update" functionality has been removed for Oracle because it can exhaust the Oracle UNDO log.
> I created a patch which does not use the "update" functionality, but executes an extra check after we acquired the lock. It checks if the SELECT FOR UPDATE used for the lock has not been executed on an empty selection, because when the selection is empty then the locking functionality will not work as expected.
> Can you apply this patch to the branches karaf-2.1.x and karaf-2.2.x and the trunk. I looked at the SVN history of the files I have modified and noticed that they are the same in both branches and the trunk.
> The patch has been created against the karaf-2.1.x branch.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Work started] (KARAF-689) Karaf instance can wrongly obtain a lock when the locking table is empty on a Oracle DB

Posted by "Jamie goodyear (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/KARAF-689?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Work on KARAF-689 started by Jamie goodyear.

> Karaf instance can wrongly obtain a lock when the locking table is empty on a Oracle DB
> ---------------------------------------------------------------------------------------
>
>                 Key: KARAF-689
>                 URL: https://issues.apache.org/jira/browse/KARAF-689
>             Project: Karaf
>          Issue Type: Bug
>          Components: runtime
>    Affects Versions: 2.1.3
>         Environment: Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
>            Reporter: Ton Swieb
>            Assignee: Jamie goodyear
>             Fix For: 2.1.6, 2.2.2, 3.0.0
>
>         Attachments: patch.txt, patch.txt
>
>
> When running Karaf in Master/Slave mode a Karaf instance can wrongly obtain a lock when the locking table is empty on a Oracle DB.
> Karaf creates a lock table and a lock record in de OracleDB upon first usage. When the lock record is removed afterwards without dropping the table then the locking mechanisme does not work anymore and any instance can wrongly obtain a lock.
> This is not an issue for other database systems, because the implementation for other DB systems periodically tries to update the lock record and verify how many records are updated. According to the documentation in the code the "update" functionality has been removed for Oracle because it can exhaust the Oracle UNDO log.
> I created a patch which does not use the "update" functionality, but executes an extra check after we acquired the lock. It checks if the SELECT FOR UPDATE used for the lock has not been executed on an empty selection, because when the selection is empty then the locking functionality will not work as expected.
> Can you apply this patch to the branches karaf-2.1.x and karaf-2.2.x and the trunk. I looked at the SVN history of the files I have modified and noticed that they are the same in both branches and the trunk.
> The patch has been created against the karaf-2.1.x branch.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (KARAF-689) Karaf instance can wrongly obtain a lock when the locking table is empty on a Oracle DB

Posted by "Jamie goodyear (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/KARAF-689?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13055738#comment-13055738 ] 

Jamie goodyear commented on KARAF-689:
--------------------------------------

Checked in to trunk with thanks to Ton Swieb for the patch.

$ svn ci
Sending        main/src/main/java/org/apache/karaf/main/OracleJDBCLock.java
Sending        main/src/main/java/org/apache/karaf/main/Statements.java
Sending        main/src/test/java/org/apache/karaf/main/BaseJDBCLockIntegrationTest.java
Sending        main/src/test/java/org/apache/karaf/main/BaseJDBCLockTest.java
Sending        main/src/test/java/org/apache/karaf/main/OracleJDBCLockTest.java
Transmitting file data .....
Committed revision 1140306.

> Karaf instance can wrongly obtain a lock when the locking table is empty on a Oracle DB
> ---------------------------------------------------------------------------------------
>
>                 Key: KARAF-689
>                 URL: https://issues.apache.org/jira/browse/KARAF-689
>             Project: Karaf
>          Issue Type: Bug
>          Components: runtime
>    Affects Versions: 2.1.3
>         Environment: Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
>            Reporter: Ton Swieb
>            Assignee: Jamie goodyear
>             Fix For: 2.1.6, 2.2.2, 3.0.0
>
>         Attachments: patch.txt, patch.txt
>
>
> When running Karaf in Master/Slave mode a Karaf instance can wrongly obtain a lock when the locking table is empty on a Oracle DB.
> Karaf creates a lock table and a lock record in de OracleDB upon first usage. When the lock record is removed afterwards without dropping the table then the locking mechanisme does not work anymore and any instance can wrongly obtain a lock.
> This is not an issue for other database systems, because the implementation for other DB systems periodically tries to update the lock record and verify how many records are updated. According to the documentation in the code the "update" functionality has been removed for Oracle because it can exhaust the Oracle UNDO log.
> I created a patch which does not use the "update" functionality, but executes an extra check after we acquired the lock. It checks if the SELECT FOR UPDATE used for the lock has not been executed on an empty selection, because when the selection is empty then the locking functionality will not work as expected.
> Can you apply this patch to the branches karaf-2.1.x and karaf-2.2.x and the trunk. I looked at the SVN history of the files I have modified and noticed that they are the same in both branches and the trunk.
> The patch has been created against the karaf-2.1.x branch.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Assigned] (KARAF-689) Karaf instance can wrongly obtain a lock when the locking table is empty on a Oracle DB

Posted by "Jamie goodyear (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/KARAF-689?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jamie goodyear reassigned KARAF-689:
------------------------------------

    Assignee: Jamie goodyear

> Karaf instance can wrongly obtain a lock when the locking table is empty on a Oracle DB
> ---------------------------------------------------------------------------------------
>
>                 Key: KARAF-689
>                 URL: https://issues.apache.org/jira/browse/KARAF-689
>             Project: Karaf
>          Issue Type: Bug
>          Components: runtime
>    Affects Versions: 2.1.3
>         Environment: Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
>            Reporter: Ton Swieb
>            Assignee: Jamie goodyear
>         Attachments: patch.txt
>
>
> When running Karaf in Master/Slave mode a Karaf instance can wrongly obtain a lock when the locking table is empty on a Oracle DB.
> Karaf creates a lock table and a lock record in de OracleDB upon first usage. When the lock record is removed afterwards without dropping the table then the locking mechanisme does not work anymore and any instance can wrongly obtain a lock.
> This is not an issue for other database systems, because the implementation for other DB systems periodically tries to update the lock record and verify how many records are updated. According to the documentation in the code the "update" functionality has been removed for Oracle because it can exhaust the Oracle UNDO log.
> I created a patch which does not use the "update" functionality, but executes an extra check after we acquired the lock. It checks if the SELECT FOR UPDATE used for the lock has not been executed on an empty selection, because when the selection is empty then the locking functionality will not work as expected.
> Can you apply this patch to the branches karaf-2.1.x and karaf-2.2.x and the trunk. I looked at the SVN history of the files I have modified and noticed that they are the same in both branches and the trunk.
> The patch has been created against the karaf-2.1.x branch.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Closed] (KARAF-689) Karaf instance can wrongly obtain a lock when the locking table is empty on a Oracle DB

Posted by "Jamie goodyear (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/KARAF-689?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jamie goodyear closed KARAF-689.
--------------------------------


Fixed in Apache Karaf 2.2.2.

> Karaf instance can wrongly obtain a lock when the locking table is empty on a Oracle DB
> ---------------------------------------------------------------------------------------
>
>                 Key: KARAF-689
>                 URL: https://issues.apache.org/jira/browse/KARAF-689
>             Project: Karaf
>          Issue Type: Bug
>          Components: runtime
>    Affects Versions: 2.1.3
>         Environment: Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
>            Reporter: Ton Swieb
>            Assignee: Jamie goodyear
>             Fix For: 2.1.6, 2.2.2, 3.0.0
>
>         Attachments: patch.txt, patch.txt
>
>
> When running Karaf in Master/Slave mode a Karaf instance can wrongly obtain a lock when the locking table is empty on a Oracle DB.
> Karaf creates a lock table and a lock record in de OracleDB upon first usage. When the lock record is removed afterwards without dropping the table then the locking mechanisme does not work anymore and any instance can wrongly obtain a lock.
> This is not an issue for other database systems, because the implementation for other DB systems periodically tries to update the lock record and verify how many records are updated. According to the documentation in the code the "update" functionality has been removed for Oracle because it can exhaust the Oracle UNDO log.
> I created a patch which does not use the "update" functionality, but executes an extra check after we acquired the lock. It checks if the SELECT FOR UPDATE used for the lock has not been executed on an empty selection, because when the selection is empty then the locking functionality will not work as expected.
> Can you apply this patch to the branches karaf-2.1.x and karaf-2.2.x and the trunk. I looked at the SVN history of the files I have modified and noticed that they are the same in both branches and the trunk.
> The patch has been created against the karaf-2.1.x branch.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (KARAF-689) Karaf instance can wrongly obtain a lock when the locking table is empty on a Oracle DB

Posted by "Jamie goodyear (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/KARAF-689?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13055474#comment-13055474 ] 

Jamie goodyear commented on KARAF-689:
--------------------------------------

Thanks for the patch Ton. I'll take a look at it.

> Karaf instance can wrongly obtain a lock when the locking table is empty on a Oracle DB
> ---------------------------------------------------------------------------------------
>
>                 Key: KARAF-689
>                 URL: https://issues.apache.org/jira/browse/KARAF-689
>             Project: Karaf
>          Issue Type: Bug
>          Components: runtime
>    Affects Versions: 2.1.3
>         Environment: Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
>            Reporter: Ton Swieb
>         Attachments: patch.txt
>
>
> When running Karaf in Master/Slave mode a Karaf instance can wrongly obtain a lock when the locking table is empty on a Oracle DB.
> Karaf creates a lock table and a lock record in de OracleDB upon first usage. When the lock record is removed afterwards without dropping the table then the locking mechanisme does not work anymore and any instance can wrongly obtain a lock.
> This is not an issue for other database systems, because the implementation for other DB systems periodically tries to update the lock record and verify how many records are updated. According to the documentation in the code the "update" functionality has been removed for Oracle because it can exhaust the Oracle UNDO log.
> I created a patch which does not use the "update" functionality, but executes an extra check after we acquired the lock. It checks if the SELECT FOR UPDATE used for the lock has not been executed on an empty selection, because when the selection is empty then the locking functionality will not work as expected.
> Can you apply this patch to the branches karaf-2.1.x and karaf-2.2.x and the trunk. I looked at the SVN history of the files I have modified and noticed that they are the same in both branches and the trunk.
> The patch has been created against the karaf-2.1.x branch.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (KARAF-689) Karaf instance can wrongly obtain a lock when the locking table is empty on a Oracle DB

Posted by "Jamie goodyear (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/KARAF-689?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jamie goodyear updated KARAF-689:
---------------------------------

    Attachment:     (was: karaf689.txt)

> Karaf instance can wrongly obtain a lock when the locking table is empty on a Oracle DB
> ---------------------------------------------------------------------------------------
>
>                 Key: KARAF-689
>                 URL: https://issues.apache.org/jira/browse/KARAF-689
>             Project: Karaf
>          Issue Type: Bug
>          Components: runtime
>    Affects Versions: 2.1.3
>         Environment: Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
>            Reporter: Ton Swieb
>            Assignee: Jamie goodyear
>             Fix For: 2.1.6, 2.2.2, 3.0.0
>
>         Attachments: patch.txt
>
>
> When running Karaf in Master/Slave mode a Karaf instance can wrongly obtain a lock when the locking table is empty on a Oracle DB.
> Karaf creates a lock table and a lock record in de OracleDB upon first usage. When the lock record is removed afterwards without dropping the table then the locking mechanisme does not work anymore and any instance can wrongly obtain a lock.
> This is not an issue for other database systems, because the implementation for other DB systems periodically tries to update the lock record and verify how many records are updated. According to the documentation in the code the "update" functionality has been removed for Oracle because it can exhaust the Oracle UNDO log.
> I created a patch which does not use the "update" functionality, but executes an extra check after we acquired the lock. It checks if the SELECT FOR UPDATE used for the lock has not been executed on an empty selection, because when the selection is empty then the locking functionality will not work as expected.
> Can you apply this patch to the branches karaf-2.1.x and karaf-2.2.x and the trunk. I looked at the SVN history of the files I have modified and noticed that they are the same in both branches and the trunk.
> The patch has been created against the karaf-2.1.x branch.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (KARAF-689) Karaf instance can wrongly obtain a lock when the locking table is empty on a Oracle DB

Posted by "Jamie goodyear (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/KARAF-689?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jamie goodyear updated KARAF-689:
---------------------------------

    Fix Version/s: 3.0.0
                   2.2.2
                   2.1.6

> Karaf instance can wrongly obtain a lock when the locking table is empty on a Oracle DB
> ---------------------------------------------------------------------------------------
>
>                 Key: KARAF-689
>                 URL: https://issues.apache.org/jira/browse/KARAF-689
>             Project: Karaf
>          Issue Type: Bug
>          Components: runtime
>    Affects Versions: 2.1.3
>         Environment: Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
>            Reporter: Ton Swieb
>            Assignee: Jamie goodyear
>             Fix For: 2.1.6, 2.2.2, 3.0.0
>
>         Attachments: patch.txt
>
>
> When running Karaf in Master/Slave mode a Karaf instance can wrongly obtain a lock when the locking table is empty on a Oracle DB.
> Karaf creates a lock table and a lock record in de OracleDB upon first usage. When the lock record is removed afterwards without dropping the table then the locking mechanisme does not work anymore and any instance can wrongly obtain a lock.
> This is not an issue for other database systems, because the implementation for other DB systems periodically tries to update the lock record and verify how many records are updated. According to the documentation in the code the "update" functionality has been removed for Oracle because it can exhaust the Oracle UNDO log.
> I created a patch which does not use the "update" functionality, but executes an extra check after we acquired the lock. It checks if the SELECT FOR UPDATE used for the lock has not been executed on an empty selection, because when the selection is empty then the locking functionality will not work as expected.
> Can you apply this patch to the branches karaf-2.1.x and karaf-2.2.x and the trunk. I looked at the SVN history of the files I have modified and noticed that they are the same in both branches and the trunk.
> The patch has been created against the karaf-2.1.x branch.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (KARAF-689) Karaf instance can wrongly obtain a lock when the locking table is empty on a Oracle DB

Posted by "Ton Swieb (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/KARAF-689?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ton Swieb updated KARAF-689:
----------------------------

    Attachment: patch.txt

Attached patch based on the branch karaf 2.1.x

> Karaf instance can wrongly obtain a lock when the locking table is empty on a Oracle DB
> ---------------------------------------------------------------------------------------
>
>                 Key: KARAF-689
>                 URL: https://issues.apache.org/jira/browse/KARAF-689
>             Project: Karaf
>          Issue Type: Bug
>          Components: runtime
>    Affects Versions: 2.1.3
>         Environment: Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
>            Reporter: Ton Swieb
>         Attachments: patch.txt
>
>
> When running Karaf in Master/Slave mode a Karaf instance can wrongly obtain a lock when the locking table is empty on a Oracle DB.
> Karaf creates a lock table and a lock record in de OracleDB upon first usage. When the lock record is removed afterwards without dropping the table then the locking mechanisme does not work anymore and any instance can wrongly obtain a lock.
> This is not an issue for other database systems, because the implementation for other DB systems periodically tries to update the lock record and verify how many records are updated. According to the documentation in the code the "update" functionality has been removed for Oracle because it can exhaust the Oracle UNDO log.
> I created a patch which does not use the "update" functionality, but executes an extra check after we acquired the lock. It checks if the SELECT FOR UPDATE used for the lock has not been executed on an empty selection, because when the selection is empty then the locking functionality will not work as expected.
> Can you apply this patch to the branches karaf-2.1.x and karaf-2.2.x and the trunk. I looked at the SVN history of the files I have modified and noticed that they are the same in both branches and the trunk.
> The patch has been created against the karaf-2.1.x branch.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (KARAF-689) Karaf instance can wrongly obtain a lock when the locking table is empty on a Oracle DB

Posted by "Jamie goodyear (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/KARAF-689?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13055709#comment-13055709 ] 

Jamie goodyear commented on KARAF-689:
--------------------------------------

Checked in to 2.1.x branch, with thanks to Ton Swieb for the patch.

$ svn ci 
Sending        main/src/main/java/org/apache/karaf/main/OracleJDBCLock.java
Sending        main/src/main/java/org/apache/karaf/main/Statements.java
Sending        main/src/test/java/org/apache/karaf/main/BaseJDBCLockIntegrationTest.java
Sending        main/src/test/java/org/apache/karaf/main/BaseJDBCLockTest.java
Sending        main/src/test/java/org/apache/karaf/main/OracleJDBCLockTest.java
Transmitting file data .....
Committed revision 1140285.

> Karaf instance can wrongly obtain a lock when the locking table is empty on a Oracle DB
> ---------------------------------------------------------------------------------------
>
>                 Key: KARAF-689
>                 URL: https://issues.apache.org/jira/browse/KARAF-689
>             Project: Karaf
>          Issue Type: Bug
>          Components: runtime
>    Affects Versions: 2.1.3
>         Environment: Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
>            Reporter: Ton Swieb
>            Assignee: Jamie goodyear
>             Fix For: 2.1.6, 2.2.2, 3.0.0
>
>         Attachments: patch.txt, patch.txt
>
>
> When running Karaf in Master/Slave mode a Karaf instance can wrongly obtain a lock when the locking table is empty on a Oracle DB.
> Karaf creates a lock table and a lock record in de OracleDB upon first usage. When the lock record is removed afterwards without dropping the table then the locking mechanisme does not work anymore and any instance can wrongly obtain a lock.
> This is not an issue for other database systems, because the implementation for other DB systems periodically tries to update the lock record and verify how many records are updated. According to the documentation in the code the "update" functionality has been removed for Oracle because it can exhaust the Oracle UNDO log.
> I created a patch which does not use the "update" functionality, but executes an extra check after we acquired the lock. It checks if the SELECT FOR UPDATE used for the lock has not been executed on an empty selection, because when the selection is empty then the locking functionality will not work as expected.
> Can you apply this patch to the branches karaf-2.1.x and karaf-2.2.x and the trunk. I looked at the SVN history of the files I have modified and noticed that they are the same in both branches and the trunk.
> The patch has been created against the karaf-2.1.x branch.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (KARAF-689) Karaf instance can wrongly obtain a lock when the locking table is empty on a Oracle DB

Posted by "Jamie goodyear (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/KARAF-689?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jamie goodyear resolved KARAF-689.
----------------------------------

    Resolution: Fixed

Applied patch to 2.1.x, 2.2.x, and trunk, with thanks to Ton Swieb for the patch.

> Karaf instance can wrongly obtain a lock when the locking table is empty on a Oracle DB
> ---------------------------------------------------------------------------------------
>
>                 Key: KARAF-689
>                 URL: https://issues.apache.org/jira/browse/KARAF-689
>             Project: Karaf
>          Issue Type: Bug
>          Components: runtime
>    Affects Versions: 2.1.3
>         Environment: Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
>            Reporter: Ton Swieb
>            Assignee: Jamie goodyear
>             Fix For: 2.1.6, 2.2.2, 3.0.0
>
>         Attachments: patch.txt, patch.txt
>
>
> When running Karaf in Master/Slave mode a Karaf instance can wrongly obtain a lock when the locking table is empty on a Oracle DB.
> Karaf creates a lock table and a lock record in de OracleDB upon first usage. When the lock record is removed afterwards without dropping the table then the locking mechanisme does not work anymore and any instance can wrongly obtain a lock.
> This is not an issue for other database systems, because the implementation for other DB systems periodically tries to update the lock record and verify how many records are updated. According to the documentation in the code the "update" functionality has been removed for Oracle because it can exhaust the Oracle UNDO log.
> I created a patch which does not use the "update" functionality, but executes an extra check after we acquired the lock. It checks if the SELECT FOR UPDATE used for the lock has not been executed on an empty selection, because when the selection is empty then the locking functionality will not work as expected.
> Can you apply this patch to the branches karaf-2.1.x and karaf-2.2.x and the trunk. I looked at the SVN history of the files I have modified and noticed that they are the same in both branches and the trunk.
> The patch has been created against the karaf-2.1.x branch.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (KARAF-689) Karaf instance can wrongly obtain a lock when the locking table is empty on a Oracle DB

Posted by "Jamie goodyear (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/KARAF-689?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13055717#comment-13055717 ] 

Jamie goodyear commented on KARAF-689:
--------------------------------------

Checked into 2.2.x branch with thanks to Ton Swieb for the patch.

$ svn ci
Sending        main/src/main/java/org/apache/karaf/main/OracleJDBCLock.java
Sending        main/src/main/java/org/apache/karaf/main/Statements.java
Sending        main/src/test/java/org/apache/karaf/main/BaseJDBCLockIntegrationTest.java
Sending        main/src/test/java/org/apache/karaf/main/BaseJDBCLockTest.java
Sending        main/src/test/java/org/apache/karaf/main/OracleJDBCLockTest.java
Transmitting file data .....
Committed revision 1140291.

> Karaf instance can wrongly obtain a lock when the locking table is empty on a Oracle DB
> ---------------------------------------------------------------------------------------
>
>                 Key: KARAF-689
>                 URL: https://issues.apache.org/jira/browse/KARAF-689
>             Project: Karaf
>          Issue Type: Bug
>          Components: runtime
>    Affects Versions: 2.1.3
>         Environment: Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
>            Reporter: Ton Swieb
>            Assignee: Jamie goodyear
>             Fix For: 2.1.6, 2.2.2, 3.0.0
>
>         Attachments: patch.txt, patch.txt
>
>
> When running Karaf in Master/Slave mode a Karaf instance can wrongly obtain a lock when the locking table is empty on a Oracle DB.
> Karaf creates a lock table and a lock record in de OracleDB upon first usage. When the lock record is removed afterwards without dropping the table then the locking mechanisme does not work anymore and any instance can wrongly obtain a lock.
> This is not an issue for other database systems, because the implementation for other DB systems periodically tries to update the lock record and verify how many records are updated. According to the documentation in the code the "update" functionality has been removed for Oracle because it can exhaust the Oracle UNDO log.
> I created a patch which does not use the "update" functionality, but executes an extra check after we acquired the lock. It checks if the SELECT FOR UPDATE used for the lock has not been executed on an empty selection, because when the selection is empty then the locking functionality will not work as expected.
> Can you apply this patch to the branches karaf-2.1.x and karaf-2.2.x and the trunk. I looked at the SVN history of the files I have modified and noticed that they are the same in both branches and the trunk.
> The patch has been created against the karaf-2.1.x branch.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira