You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@empire-db.apache.org by "Sebb (JIRA)" <em...@incubator.apache.org> on 2009/09/01 19:08:33 UTC
[jira] Created: (EMPIREDB-49) Non-thread-safe counters
Non-thread-safe counters
------------------------
Key: EMPIREDB-49
URL: https://issues.apache.org/jira/browse/EMPIREDB-49
Project: Empire-DB
Issue Type: Bug
Components: Core
Affects Versions: empire-db-2.0.5-incubating
Reporter: Sebb
There are various static counters which are not accessed in a thread-safe way.
At present, multiple threads may see duplicate numbers.
The fields involved are:
DBQuery.queryCount
DBTable.tableCount
DBView.viewCount
All access to these fields needs to be synchronised to ensure uniqueness. Volatile is not sufficient.
Perhaps use AtomicInteger variables instead.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Assigned: (EMPIREDB-49) Non-thread-safe counters
Posted by "Rainer Döbele (JIRA)" <em...@incubator.apache.org>.
[ https://issues.apache.org/jira/browse/EMPIREDB-49?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Rainer Döbele reassigned EMPIREDB-49:
-------------------------------------
Assignee: Rainer Döbele
> Non-thread-safe counters
> ------------------------
>
> Key: EMPIREDB-49
> URL: https://issues.apache.org/jira/browse/EMPIREDB-49
> Project: Empire-DB
> Issue Type: Bug
> Components: Core
> Affects Versions: empire-db-2.0.5-incubating
> Reporter: Sebb
> Assignee: Rainer Döbele
>
> There are various static counters which are not accessed in a thread-safe way.
> At present, multiple threads may see duplicate numbers.
> The fields involved are:
> DBQuery.queryCount
> DBTable.tableCount
> DBView.viewCount
> All access to these fields needs to be synchronised to ensure uniqueness. Volatile is not sufficient.
> Perhaps use AtomicInteger variables instead.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (EMPIREDB-49) Non-thread-safe counters
Posted by "Francis De Brabandere (JIRA)" <em...@incubator.apache.org>.
[ https://issues.apache.org/jira/browse/EMPIREDB-49?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12750009#action_12750009 ]
Francis De Brabandere commented on EMPIREDB-49:
-----------------------------------------------
I'm pro AtomicLongs here
Did you use a tool to find these?
> Non-thread-safe counters
> ------------------------
>
> Key: EMPIREDB-49
> URL: https://issues.apache.org/jira/browse/EMPIREDB-49
> Project: Empire-DB
> Issue Type: Bug
> Components: Core
> Affects Versions: empire-db-2.0.5-incubating
> Reporter: Sebb
>
> There are various static counters which are not accessed in a thread-safe way.
> At present, multiple threads may see duplicate numbers.
> The fields involved are:
> DBQuery.queryCount
> DBTable.tableCount
> DBView.viewCount
> All access to these fields needs to be synchronised to ensure uniqueness. Volatile is not sufficient.
> Perhaps use AtomicInteger variables instead.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (EMPIREDB-49) Non-thread-safe counters
Posted by "Sebb (JIRA)" <em...@incubator.apache.org>.
[ https://issues.apache.org/jira/browse/EMPIREDB-49?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12750031#action_12750031 ]
Sebb commented on EMPIREDB-49:
------------------------------
I use a PMD script that looks for non-final static variables etc.
> Non-thread-safe counters
> ------------------------
>
> Key: EMPIREDB-49
> URL: https://issues.apache.org/jira/browse/EMPIREDB-49
> Project: Empire-DB
> Issue Type: Bug
> Components: Core
> Affects Versions: empire-db-2.0.5-incubating
> Reporter: Sebb
>
> There are various static counters which are not accessed in a thread-safe way.
> At present, multiple threads may see duplicate numbers.
> The fields involved are:
> DBQuery.queryCount
> DBTable.tableCount
> DBView.viewCount
> All access to these fields needs to be synchronised to ensure uniqueness. Volatile is not sufficient.
> Perhaps use AtomicInteger variables instead.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (EMPIREDB-49) Non-thread-safe counters
Posted by "Rainer Döbele (JIRA)" <em...@incubator.apache.org>.
[ https://issues.apache.org/jira/browse/EMPIREDB-49?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Rainer Döbele resolved EMPIREDB-49.
-----------------------------------
Resolution: Fixed
Fix Version/s: empire-db-2.0.6
empire-db-2.0.5-incubating
Replaced uses of static int with static AtomicInteger.
> Non-thread-safe counters
> ------------------------
>
> Key: EMPIREDB-49
> URL: https://issues.apache.org/jira/browse/EMPIREDB-49
> Project: Empire-DB
> Issue Type: Bug
> Components: Core
> Affects Versions: empire-db-2.0.5-incubating
> Reporter: Sebb
> Assignee: Rainer Döbele
> Fix For: empire-db-2.0.5-incubating, empire-db-2.0.6
>
>
> There are various static counters which are not accessed in a thread-safe way.
> At present, multiple threads may see duplicate numbers.
> The fields involved are:
> DBQuery.queryCount
> DBTable.tableCount
> DBView.viewCount
> All access to these fields needs to be synchronised to ensure uniqueness. Volatile is not sufficient.
> Perhaps use AtomicInteger variables instead.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.