You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by "Ron Gavlin (JIRA)" <tu...@ws.apache.org> on 2006/12/19 18:07:23 UTC

[jira] Created: (TUSCANY-1006) ChangeSummaryImpl.cachedSDOObjectChanges appears to not be thread safe

ChangeSummaryImpl.cachedSDOObjectChanges appears to not be thread safe
----------------------------------------------------------------------

                 Key: TUSCANY-1006
                 URL: http://issues.apache.org/jira/browse/TUSCANY-1006
             Project: Tuscany
          Issue Type: Bug
          Components: Java SDO Implementation
    Affects Versions: Java-M2
         Environment: Sun JDK 1.4.2_11, 2-CPU server
            Reporter: Ron Gavlin
            Priority: Critical


I have an application in which multiple threads access a shared ChangeSummaryImpl. Each thread invokes ChangeSummaryImpl.getOldValues() repeatedly. This causes one or more of the threads to enter an infinite "while (true) -" loop in HashMap.get(Object) with the following stack trace:

HashMap.get(Object) line: 323
ChangeSummaryImpl.getOldValues(DataObject) line: 481
...

I suspect this occurs because the access to HashMap cachedSDOObjectChanges is not synchronized. 

I have been unable as of yet to create a simple test case that demonstrates the problem. In the meantime, I will try to implement a short-term fix by changing line 93 of ChangeSummaryImpl 

from

protected HashMap cachedSDOObjectChanges = new HashMap();

to

protected Map cachedSDOObjectChanges = Collections.synchronizedMap(new HashMap());

I will let you know if that fixes the problem. Any insight or assistance you can offer concerning this problem is appreciated. This is a show-stopper problem for us.

Regards,

- Ron


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


[jira] Commented: (TUSCANY-1006) ChangeSummaryImpl.cachedSDOObjectChanges appears to not be thread safe

Posted by "Ron Gavlin (JIRA)" <tu...@ws.apache.org>.
    [ http://issues.apache.org/jira/browse/TUSCANY-1006?page=comments#action_12459732 ] 
            
Ron Gavlin commented on TUSCANY-1006:
-------------------------------------

Indeed, the problem disappeared when I changed line 93 to synchronize the HashMap. I am not sure this simple solution is the optimal one. What are your thoughts?

- Ron

> ChangeSummaryImpl.cachedSDOObjectChanges appears to not be thread safe
> ----------------------------------------------------------------------
>
>                 Key: TUSCANY-1006
>                 URL: http://issues.apache.org/jira/browse/TUSCANY-1006
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SDO Implementation
>    Affects Versions: Java-M2
>         Environment: Sun JDK 1.4.2_11, 2-CPU server
>            Reporter: Ron Gavlin
>            Priority: Critical
>
> I have an application in which multiple threads access a shared ChangeSummaryImpl. Each thread invokes ChangeSummaryImpl.getOldValues() repeatedly. This causes one or more of the threads to enter an infinite "while (true) -" loop in HashMap.get(Object) with the following stack trace:
> HashMap.get(Object) line: 323
> ChangeSummaryImpl.getOldValues(DataObject) line: 481
> ...
> I suspect this occurs because the access to HashMap cachedSDOObjectChanges is not synchronized. 
> I have been unable as of yet to create a simple test case that demonstrates the problem. In the meantime, I will try to implement a short-term fix by changing line 93 of ChangeSummaryImpl 
> from
> protected HashMap cachedSDOObjectChanges = new HashMap();
> to
> protected Map cachedSDOObjectChanges = Collections.synchronizedMap(new HashMap());
> I will let you know if that fixes the problem. Any insight or assistance you can offer concerning this problem is appreciated. This is a show-stopper problem for us.
> Regards,
> - Ron

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


[jira] Resolved: (TUSCANY-1006) ChangeSummaryImpl.cachedSDOObjectChanges appears to not be thread safe

Posted by "Frank Budinsky (JIRA)" <tu...@ws.apache.org>.
     [ https://issues.apache.org/jira/browse/TUSCANY-1006?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Frank Budinsky resolved TUSCANY-1006.
-------------------------------------

    Resolution: Fixed

I'm assuming this is fixed in EMF 2.2.2. Please reopen if not.

> ChangeSummaryImpl.cachedSDOObjectChanges appears to not be thread safe
> ----------------------------------------------------------------------
>
>                 Key: TUSCANY-1006
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1006
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SDO Implementation
>    Affects Versions: Java-SDO-M3
>         Environment: Sun JDK 1.4.2_11, 2-CPU server
>            Reporter: Ron Gavlin
>            Priority: Critical
>             Fix For: Java-SDO-Mx
>
>
> I have an application in which multiple threads access a shared ChangeSummaryImpl. Each thread invokes ChangeSummaryImpl.getOldValues() repeatedly. This causes one or more of the threads to enter an infinite "while (true) -" loop in HashMap.get(Object) with the following stack trace:
> HashMap.get(Object) line: 323
> ChangeSummaryImpl.getOldValues(DataObject) line: 481
> ...
> I suspect this occurs because the access to HashMap cachedSDOObjectChanges is not synchronized. 
> I have been unable as of yet to create a simple test case that demonstrates the problem. In the meantime, I will try to implement a short-term fix by changing line 93 of ChangeSummaryImpl 
> from
> protected HashMap cachedSDOObjectChanges = new HashMap();
> to
> protected Map cachedSDOObjectChanges = Collections.synchronizedMap(new HashMap());
> I will let you know if that fixes the problem. Any insight or assistance you can offer concerning this problem is appreciated. This is a show-stopper problem for us.
> Regards,
> - Ron

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


[jira] Updated: (TUSCANY-1006) ChangeSummaryImpl.cachedSDOObjectChanges appears to not be thread safe

Posted by "Kelvin Goodson (JIRA)" <tu...@ws.apache.org>.
     [ https://issues.apache.org/jira/browse/TUSCANY-1006?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kelvin Goodson updated TUSCANY-1006:
------------------------------------

    Affects Version/s:     (was: Java-SDO-Mx)
                       Java-SDO-M3

The above referenced bugzilla is resolved.  Is there more to be done here or does that fix this issue?

> ChangeSummaryImpl.cachedSDOObjectChanges appears to not be thread safe
> ----------------------------------------------------------------------
>
>                 Key: TUSCANY-1006
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1006
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SDO Implementation
>    Affects Versions: Java-SDO-M3
>         Environment: Sun JDK 1.4.2_11, 2-CPU server
>            Reporter: Ron Gavlin
>            Priority: Critical
>             Fix For: Java-SDO-Mx
>
>
> I have an application in which multiple threads access a shared ChangeSummaryImpl. Each thread invokes ChangeSummaryImpl.getOldValues() repeatedly. This causes one or more of the threads to enter an infinite "while (true) -" loop in HashMap.get(Object) with the following stack trace:
> HashMap.get(Object) line: 323
> ChangeSummaryImpl.getOldValues(DataObject) line: 481
> ...
> I suspect this occurs because the access to HashMap cachedSDOObjectChanges is not synchronized. 
> I have been unable as of yet to create a simple test case that demonstrates the problem. In the meantime, I will try to implement a short-term fix by changing line 93 of ChangeSummaryImpl 
> from
> protected HashMap cachedSDOObjectChanges = new HashMap();
> to
> protected Map cachedSDOObjectChanges = Collections.synchronizedMap(new HashMap());
> I will let you know if that fixes the problem. Any insight or assistance you can offer concerning this problem is appreciated. This is a show-stopper problem for us.
> Regards,
> - Ron

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


[jira] Commented: (TUSCANY-1006) ChangeSummaryImpl.cachedSDOObjectChanges appears to not be thread safe

Posted by "Ron Gavlin (JIRA)" <tu...@ws.apache.org>.
    [ https://issues.apache.org/jira/browse/TUSCANY-1006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12518510 ] 

Ron Gavlin commented on TUSCANY-1006:
-------------------------------------

FYI, I am writing the patch to look for and subsequently instantiate a thread-safe Map as follows:

Lookup java.util.ConcurrentHashMap
if found, instantiate it 
else
{
    Lookup backport ConcurrentHashMap
    if found, instantiate it
    else create a Map via Collections.synchronizedMap(new HashMap())
}

Does that seem reasonable?

- Ron

> ChangeSummaryImpl.cachedSDOObjectChanges appears to not be thread safe
> ----------------------------------------------------------------------
>
>                 Key: TUSCANY-1006
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1006
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SDO Implementation
>    Affects Versions: Java-SDO-beta1
>         Environment: Sun JDK 1.4.2_11, 2-CPU server
>            Reporter: Ron Gavlin
>            Priority: Critical
>             Fix For: Java-SDO-beta1
>
>
> I have an application in which multiple threads access a shared ChangeSummaryImpl. Each thread invokes ChangeSummaryImpl.getOldValues() repeatedly. This causes one or more of the threads to enter an infinite "while (true) -" loop in HashMap.get(Object) with the following stack trace:
> HashMap.get(Object) line: 323
> ChangeSummaryImpl.getOldValues(DataObject) line: 481
> ...
> I suspect this occurs because the access to HashMap cachedSDOObjectChanges is not synchronized. 
> I have been unable as of yet to create a simple test case that demonstrates the problem. In the meantime, I will try to implement a short-term fix by changing line 93 of ChangeSummaryImpl 
> from
> protected HashMap cachedSDOObjectChanges = new HashMap();
> to
> protected Map cachedSDOObjectChanges = Collections.synchronizedMap(new HashMap());
> I will let you know if that fixes the problem. Any insight or assistance you can offer concerning this problem is appreciated. This is a show-stopper problem for us.
> Regards,
> - Ron

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


[jira] Commented: (TUSCANY-1006) ChangeSummaryImpl.cachedSDOObjectChanges appears to not be thread safe

Posted by "Ron Gavlin (JIRA)" <tu...@ws.apache.org>.
    [ http://issues.apache.org/jira/browse/TUSCANY-1006?page=comments#action_12460009 ] 
            
Ron Gavlin commented on TUSCANY-1006:
-------------------------------------

FYI, our application test suite was unable to reproduce this problem on a single-CPU system. Rather, we had to use one of our dual-CPU test machines to reproduce it. So, developing a unit test to reliably reproduce this problem on a single-CPU machine will likely be difficult. Nevertheless, I'll do a little more research and see what I can do.

In the meantime, would you consider applying my one-line patch? Without synchronized access to cachedSDOObjectChanges, it is reasonable to expect map corruption when multiple threads "put" to it at the same time.


> ChangeSummaryImpl.cachedSDOObjectChanges appears to not be thread safe
> ----------------------------------------------------------------------
>
>                 Key: TUSCANY-1006
>                 URL: http://issues.apache.org/jira/browse/TUSCANY-1006
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SDO Implementation
>    Affects Versions: Java-M2
>         Environment: Sun JDK 1.4.2_11, 2-CPU server
>            Reporter: Ron Gavlin
>            Priority: Critical
>
> I have an application in which multiple threads access a shared ChangeSummaryImpl. Each thread invokes ChangeSummaryImpl.getOldValues() repeatedly. This causes one or more of the threads to enter an infinite "while (true) -" loop in HashMap.get(Object) with the following stack trace:
> HashMap.get(Object) line: 323
> ChangeSummaryImpl.getOldValues(DataObject) line: 481
> ...
> I suspect this occurs because the access to HashMap cachedSDOObjectChanges is not synchronized. 
> I have been unable as of yet to create a simple test case that demonstrates the problem. In the meantime, I will try to implement a short-term fix by changing line 93 of ChangeSummaryImpl 
> from
> protected HashMap cachedSDOObjectChanges = new HashMap();
> to
> protected Map cachedSDOObjectChanges = Collections.synchronizedMap(new HashMap());
> I will let you know if that fixes the problem. Any insight or assistance you can offer concerning this problem is appreciated. This is a show-stopper problem for us.
> Regards,
> - Ron

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


[jira] Updated: (TUSCANY-1006) ChangeSummaryImpl.cachedSDOObjectChanges appears to not be thread safe

Posted by "Amita Vadhavkar (JIRA)" <tu...@ws.apache.org>.
     [ https://issues.apache.org/jira/browse/TUSCANY-1006?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Amita Vadhavkar updated TUSCANY-1006:
-------------------------------------

    Fix Version/s:     (was: Java-SDO-Next)
                   Java-SDO-1.1

> ChangeSummaryImpl.cachedSDOObjectChanges appears to not be thread safe
> ----------------------------------------------------------------------
>
>                 Key: TUSCANY-1006
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1006
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SDO Implementation
>    Affects Versions: Java-SDO-beta1
>         Environment: Sun JDK 1.4.2_11, 2-CPU server
>            Reporter: Ron Gavlin
>            Priority: Critical
>             Fix For: Java-SDO-1.1
>
>         Attachments: tuscany-sdo-impl.TUSCANY-1006.patch
>
>
> I have an application in which multiple threads access a shared ChangeSummaryImpl. Each thread invokes ChangeSummaryImpl.getOldValues() repeatedly. This causes one or more of the threads to enter an infinite "while (true) -" loop in HashMap.get(Object) with the following stack trace:
> HashMap.get(Object) line: 323
> ChangeSummaryImpl.getOldValues(DataObject) line: 481
> ...
> I suspect this occurs because the access to HashMap cachedSDOObjectChanges is not synchronized. 
> I have been unable as of yet to create a simple test case that demonstrates the problem. In the meantime, I will try to implement a short-term fix by changing line 93 of ChangeSummaryImpl 
> from
> protected HashMap cachedSDOObjectChanges = new HashMap();
> to
> protected Map cachedSDOObjectChanges = Collections.synchronizedMap(new HashMap());
> I will let you know if that fixes the problem. Any insight or assistance you can offer concerning this problem is appreciated. This is a show-stopper problem for us.
> Regards,
> - Ron

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


[jira] Commented: (TUSCANY-1006) ChangeSummaryImpl.cachedSDOObjectChanges appears to not be thread safe

Posted by "Frank Budinsky (JIRA)" <tu...@ws.apache.org>.
    [ http://issues.apache.org/jira/browse/TUSCANY-1006?page=comments#action_12460296 ] 
            
Frank Budinsky commented on TUSCANY-1006:
-----------------------------------------

I think there's another similar theading problem in the EMF base class method, ChangeDescriptionImpl.getOldContainmentInformation(). The fix for it is simpler, but needs to be done in EMF. I opened this bugzilla: 

https://bugs.eclipse.org/bugs/show_bug.cgi?id=168859

which will be fixed in EMF 2.2.2..


> ChangeSummaryImpl.cachedSDOObjectChanges appears to not be thread safe
> ----------------------------------------------------------------------
>
>                 Key: TUSCANY-1006
>                 URL: http://issues.apache.org/jira/browse/TUSCANY-1006
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SDO Implementation
>    Affects Versions: Java-M2
>         Environment: Sun JDK 1.4.2_11, 2-CPU server
>            Reporter: Ron Gavlin
>            Priority: Critical
>
> I have an application in which multiple threads access a shared ChangeSummaryImpl. Each thread invokes ChangeSummaryImpl.getOldValues() repeatedly. This causes one or more of the threads to enter an infinite "while (true) -" loop in HashMap.get(Object) with the following stack trace:
> HashMap.get(Object) line: 323
> ChangeSummaryImpl.getOldValues(DataObject) line: 481
> ...
> I suspect this occurs because the access to HashMap cachedSDOObjectChanges is not synchronized. 
> I have been unable as of yet to create a simple test case that demonstrates the problem. In the meantime, I will try to implement a short-term fix by changing line 93 of ChangeSummaryImpl 
> from
> protected HashMap cachedSDOObjectChanges = new HashMap();
> to
> protected Map cachedSDOObjectChanges = Collections.synchronizedMap(new HashMap());
> I will let you know if that fixes the problem. Any insight or assistance you can offer concerning this problem is appreciated. This is a show-stopper problem for us.
> Regards,
> - Ron

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


[jira] Commented: (TUSCANY-1006) ChangeSummaryImpl.cachedSDOObjectChanges appears to not be thread safe

Posted by "Kelvin Goodson (JIRA)" <tu...@ws.apache.org>.
    [ https://issues.apache.org/jira/browse/TUSCANY-1006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12518509 ] 

Kelvin Goodson commented on TUSCANY-1006:
-----------------------------------------

Thanks Ron,  I'll take a look at the attributions in their LICENSE files.

> ChangeSummaryImpl.cachedSDOObjectChanges appears to not be thread safe
> ----------------------------------------------------------------------
>
>                 Key: TUSCANY-1006
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1006
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SDO Implementation
>    Affects Versions: Java-SDO-beta1
>         Environment: Sun JDK 1.4.2_11, 2-CPU server
>            Reporter: Ron Gavlin
>            Priority: Critical
>             Fix For: Java-SDO-beta1
>
>
> I have an application in which multiple threads access a shared ChangeSummaryImpl. Each thread invokes ChangeSummaryImpl.getOldValues() repeatedly. This causes one or more of the threads to enter an infinite "while (true) -" loop in HashMap.get(Object) with the following stack trace:
> HashMap.get(Object) line: 323
> ChangeSummaryImpl.getOldValues(DataObject) line: 481
> ...
> I suspect this occurs because the access to HashMap cachedSDOObjectChanges is not synchronized. 
> I have been unable as of yet to create a simple test case that demonstrates the problem. In the meantime, I will try to implement a short-term fix by changing line 93 of ChangeSummaryImpl 
> from
> protected HashMap cachedSDOObjectChanges = new HashMap();
> to
> protected Map cachedSDOObjectChanges = Collections.synchronizedMap(new HashMap());
> I will let you know if that fixes the problem. Any insight or assistance you can offer concerning this problem is appreciated. This is a show-stopper problem for us.
> Regards,
> - Ron

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


[jira] Updated: (TUSCANY-1006) ChangeSummaryImpl.cachedSDOObjectChanges appears to not be thread safe

Posted by "Ron Gavlin (JIRA)" <tu...@ws.apache.org>.
     [ https://issues.apache.org/jira/browse/TUSCANY-1006?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ron Gavlin updated TUSCANY-1006:
--------------------------------

    Attachment: tuscany-sdo-impl.TUSCANY-1006.patch

Patch attached. 

> ChangeSummaryImpl.cachedSDOObjectChanges appears to not be thread safe
> ----------------------------------------------------------------------
>
>                 Key: TUSCANY-1006
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1006
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SDO Implementation
>    Affects Versions: Java-SDO-beta1
>         Environment: Sun JDK 1.4.2_11, 2-CPU server
>            Reporter: Ron Gavlin
>            Priority: Critical
>             Fix For: Java-SDO-beta1
>
>         Attachments: tuscany-sdo-impl.TUSCANY-1006.patch
>
>
> I have an application in which multiple threads access a shared ChangeSummaryImpl. Each thread invokes ChangeSummaryImpl.getOldValues() repeatedly. This causes one or more of the threads to enter an infinite "while (true) -" loop in HashMap.get(Object) with the following stack trace:
> HashMap.get(Object) line: 323
> ChangeSummaryImpl.getOldValues(DataObject) line: 481
> ...
> I suspect this occurs because the access to HashMap cachedSDOObjectChanges is not synchronized. 
> I have been unable as of yet to create a simple test case that demonstrates the problem. In the meantime, I will try to implement a short-term fix by changing line 93 of ChangeSummaryImpl 
> from
> protected HashMap cachedSDOObjectChanges = new HashMap();
> to
> protected Map cachedSDOObjectChanges = Collections.synchronizedMap(new HashMap());
> I will let you know if that fixes the problem. Any insight or assistance you can offer concerning this problem is appreciated. This is a show-stopper problem for us.
> Regards,
> - Ron

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


[jira] Updated: (TUSCANY-1006) ChangeSummaryImpl.cachedSDOObjectChanges appears to not be thread safe

Posted by "Ron Gavlin (JIRA)" <tu...@ws.apache.org>.
     [ https://issues.apache.org/jira/browse/TUSCANY-1006?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ron Gavlin updated TUSCANY-1006:
--------------------------------

    Patch Info: [Patch Available]

> ChangeSummaryImpl.cachedSDOObjectChanges appears to not be thread safe
> ----------------------------------------------------------------------
>
>                 Key: TUSCANY-1006
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1006
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SDO Implementation
>    Affects Versions: Java-SDO-beta1
>         Environment: Sun JDK 1.4.2_11, 2-CPU server
>            Reporter: Ron Gavlin
>            Priority: Critical
>             Fix For: Java-SDO-beta1
>
>         Attachments: tuscany-sdo-impl.TUSCANY-1006.patch
>
>
> I have an application in which multiple threads access a shared ChangeSummaryImpl. Each thread invokes ChangeSummaryImpl.getOldValues() repeatedly. This causes one or more of the threads to enter an infinite "while (true) -" loop in HashMap.get(Object) with the following stack trace:
> HashMap.get(Object) line: 323
> ChangeSummaryImpl.getOldValues(DataObject) line: 481
> ...
> I suspect this occurs because the access to HashMap cachedSDOObjectChanges is not synchronized. 
> I have been unable as of yet to create a simple test case that demonstrates the problem. In the meantime, I will try to implement a short-term fix by changing line 93 of ChangeSummaryImpl 
> from
> protected HashMap cachedSDOObjectChanges = new HashMap();
> to
> protected Map cachedSDOObjectChanges = Collections.synchronizedMap(new HashMap());
> I will let you know if that fixes the problem. Any insight or assistance you can offer concerning this problem is appreciated. This is a show-stopper problem for us.
> Regards,
> - Ron

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


[jira] Commented: (TUSCANY-1006) ChangeSummaryImpl.cachedSDOObjectChanges appears to not be thread safe

Posted by "Frank Budinsky (JIRA)" <tu...@ws.apache.org>.
    [ http://issues.apache.org/jira/browse/TUSCANY-1006?page=comments#action_12460015 ] 
            
Frank Budinsky commented on TUSCANY-1006:
-----------------------------------------

I don't know a lot about thread safety/sychronizing but I wonder if changing the put() call to something like this might be a less brute force solution to the problem:

    synchronized(cachedSDOObjectChanges) { cachedSDOObjectChanges.put(dataObject, sdoSettings); }

Does that fix your scenario?


> ChangeSummaryImpl.cachedSDOObjectChanges appears to not be thread safe
> ----------------------------------------------------------------------
>
>                 Key: TUSCANY-1006
>                 URL: http://issues.apache.org/jira/browse/TUSCANY-1006
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SDO Implementation
>    Affects Versions: Java-M2
>         Environment: Sun JDK 1.4.2_11, 2-CPU server
>            Reporter: Ron Gavlin
>            Priority: Critical
>
> I have an application in which multiple threads access a shared ChangeSummaryImpl. Each thread invokes ChangeSummaryImpl.getOldValues() repeatedly. This causes one or more of the threads to enter an infinite "while (true) -" loop in HashMap.get(Object) with the following stack trace:
> HashMap.get(Object) line: 323
> ChangeSummaryImpl.getOldValues(DataObject) line: 481
> ...
> I suspect this occurs because the access to HashMap cachedSDOObjectChanges is not synchronized. 
> I have been unable as of yet to create a simple test case that demonstrates the problem. In the meantime, I will try to implement a short-term fix by changing line 93 of ChangeSummaryImpl 
> from
> protected HashMap cachedSDOObjectChanges = new HashMap();
> to
> protected Map cachedSDOObjectChanges = Collections.synchronizedMap(new HashMap());
> I will let you know if that fixes the problem. Any insight or assistance you can offer concerning this problem is appreciated. This is a show-stopper problem for us.
> Regards,
> - Ron

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


[jira] Resolved: (TUSCANY-1006) ChangeSummaryImpl.cachedSDOObjectChanges appears to not be thread safe

Posted by "Kelvin Goodson (JIRA)" <tu...@ws.apache.org>.
     [ https://issues.apache.org/jira/browse/TUSCANY-1006?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kelvin Goodson resolved TUSCANY-1006.
-------------------------------------

       Resolution: Fixed
    Fix Version/s:     (was: Java-SDO-beta1)
                   Java-SDO-Next

I applied Ron's patch, thanks Ron.  I added a note to the open JIRA TUSCANY-1182 for the addition of the multi-threaded test case when it is ready.

> ChangeSummaryImpl.cachedSDOObjectChanges appears to not be thread safe
> ----------------------------------------------------------------------
>
>                 Key: TUSCANY-1006
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1006
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SDO Implementation
>    Affects Versions: Java-SDO-beta1
>         Environment: Sun JDK 1.4.2_11, 2-CPU server
>            Reporter: Ron Gavlin
>            Priority: Critical
>             Fix For: Java-SDO-Next
>
>         Attachments: tuscany-sdo-impl.TUSCANY-1006.patch
>
>
> I have an application in which multiple threads access a shared ChangeSummaryImpl. Each thread invokes ChangeSummaryImpl.getOldValues() repeatedly. This causes one or more of the threads to enter an infinite "while (true) -" loop in HashMap.get(Object) with the following stack trace:
> HashMap.get(Object) line: 323
> ChangeSummaryImpl.getOldValues(DataObject) line: 481
> ...
> I suspect this occurs because the access to HashMap cachedSDOObjectChanges is not synchronized. 
> I have been unable as of yet to create a simple test case that demonstrates the problem. In the meantime, I will try to implement a short-term fix by changing line 93 of ChangeSummaryImpl 
> from
> protected HashMap cachedSDOObjectChanges = new HashMap();
> to
> protected Map cachedSDOObjectChanges = Collections.synchronizedMap(new HashMap());
> I will let you know if that fixes the problem. Any insight or assistance you can offer concerning this problem is appreciated. This is a show-stopper problem for us.
> Regards,
> - Ron

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


[jira] Reopened: (TUSCANY-1006) ChangeSummaryImpl.cachedSDOObjectChanges appears to not be thread safe

Posted by "Ron Gavlin (JIRA)" <tu...@ws.apache.org>.
     [ https://issues.apache.org/jira/browse/TUSCANY-1006?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ron Gavlin reopened TUSCANY-1006:
---------------------------------


This problem still appears in the latest code. It looks to me like the cachedSDOObjectChanges requires synchronization. Please confirm.

- Ron

> ChangeSummaryImpl.cachedSDOObjectChanges appears to not be thread safe
> ----------------------------------------------------------------------
>
>                 Key: TUSCANY-1006
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1006
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SDO Implementation
>    Affects Versions: Java-SDO-beta1
>         Environment: Sun JDK 1.4.2_11, 2-CPU server
>            Reporter: Ron Gavlin
>            Priority: Critical
>             Fix For: Java-SDO-beta1
>
>
> I have an application in which multiple threads access a shared ChangeSummaryImpl. Each thread invokes ChangeSummaryImpl.getOldValues() repeatedly. This causes one or more of the threads to enter an infinite "while (true) -" loop in HashMap.get(Object) with the following stack trace:
> HashMap.get(Object) line: 323
> ChangeSummaryImpl.getOldValues(DataObject) line: 481
> ...
> I suspect this occurs because the access to HashMap cachedSDOObjectChanges is not synchronized. 
> I have been unable as of yet to create a simple test case that demonstrates the problem. In the meantime, I will try to implement a short-term fix by changing line 93 of ChangeSummaryImpl 
> from
> protected HashMap cachedSDOObjectChanges = new HashMap();
> to
> protected Map cachedSDOObjectChanges = Collections.synchronizedMap(new HashMap());
> I will let you know if that fixes the problem. Any insight or assistance you can offer concerning this problem is appreciated. This is a show-stopper problem for us.
> Regards,
> - Ron

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


[jira] Commented: (TUSCANY-1006) ChangeSummaryImpl.cachedSDOObjectChanges appears to not be thread safe

Posted by "Ron Gavlin (JIRA)" <tu...@ws.apache.org>.
    [ https://issues.apache.org/jira/browse/TUSCANY-1006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12518151 ] 

Ron Gavlin commented on TUSCANY-1006:
-------------------------------------

I am working on a test that exposes this problem. Unfortunately, the problem only seems to appear when running on multi-core or multi-cpu systems. As mentioned earlier, the problem results in a runaway thread which is quite problematic especially in server environments. I see 3 solutions:

1. Use backport-util-concurrent ConcurrentHashMap - Pros: 1). very scalable 2). easy to remove when upgrading to JDK 5 Cons: introduces 320k jar dependency to Tuscany SDO

2. Use synchronized HashMap - Pros: available in JDK 1.4 so no add'l jars or custom code needed Cons: not scalable (see http://www.ibm.com/developerworks/java/library/j-jtp07233.html Table 1)

3. Implement custom, thread-safe HashMap - Pros: no add'l jar dependencies Cons: difficult to implement and test well

How should we proceed?

> ChangeSummaryImpl.cachedSDOObjectChanges appears to not be thread safe
> ----------------------------------------------------------------------
>
>                 Key: TUSCANY-1006
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1006
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SDO Implementation
>    Affects Versions: Java-SDO-beta1
>         Environment: Sun JDK 1.4.2_11, 2-CPU server
>            Reporter: Ron Gavlin
>            Priority: Critical
>             Fix For: Java-SDO-beta1
>
>
> I have an application in which multiple threads access a shared ChangeSummaryImpl. Each thread invokes ChangeSummaryImpl.getOldValues() repeatedly. This causes one or more of the threads to enter an infinite "while (true) -" loop in HashMap.get(Object) with the following stack trace:
> HashMap.get(Object) line: 323
> ChangeSummaryImpl.getOldValues(DataObject) line: 481
> ...
> I suspect this occurs because the access to HashMap cachedSDOObjectChanges is not synchronized. 
> I have been unable as of yet to create a simple test case that demonstrates the problem. In the meantime, I will try to implement a short-term fix by changing line 93 of ChangeSummaryImpl 
> from
> protected HashMap cachedSDOObjectChanges = new HashMap();
> to
> protected Map cachedSDOObjectChanges = Collections.synchronizedMap(new HashMap());
> I will let you know if that fixes the problem. Any insight or assistance you can offer concerning this problem is appreciated. This is a show-stopper problem for us.
> Regards,
> - Ron

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


[jira] Commented: (TUSCANY-1006) ChangeSummaryImpl.cachedSDOObjectChanges appears to not be thread safe

Posted by "Yang ZHONG (JIRA)" <tu...@ws.apache.org>.
    [ http://issues.apache.org/jira/browse/TUSCANY-1006?page=comments#action_12460180 ] 
            
Yang ZHONG commented on TUSCANY-1006:
-------------------------------------

Synchronizing only writes may cause reads access invalid memory.
This's the code snippet implementing HashMap#get:
        int i = indexFor(hash, this.table.length);
        Entry e = this.table[i]; 
The index i may not be valid any longer since a concurrent put may change this.table to a different memory.
A simple change may make it thread-safer:
        Entry tab = table;
        int i = indexFor(hash, tab.length);
        Entry e = tab[i];

More on http://www.mail-archive.com/tuscany-dev%40ws.apache.org/msg12110.html

> ChangeSummaryImpl.cachedSDOObjectChanges appears to not be thread safe
> ----------------------------------------------------------------------
>
>                 Key: TUSCANY-1006
>                 URL: http://issues.apache.org/jira/browse/TUSCANY-1006
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SDO Implementation
>    Affects Versions: Java-M2
>         Environment: Sun JDK 1.4.2_11, 2-CPU server
>            Reporter: Ron Gavlin
>            Priority: Critical
>
> I have an application in which multiple threads access a shared ChangeSummaryImpl. Each thread invokes ChangeSummaryImpl.getOldValues() repeatedly. This causes one or more of the threads to enter an infinite "while (true) -" loop in HashMap.get(Object) with the following stack trace:
> HashMap.get(Object) line: 323
> ChangeSummaryImpl.getOldValues(DataObject) line: 481
> ...
> I suspect this occurs because the access to HashMap cachedSDOObjectChanges is not synchronized. 
> I have been unable as of yet to create a simple test case that demonstrates the problem. In the meantime, I will try to implement a short-term fix by changing line 93 of ChangeSummaryImpl 
> from
> protected HashMap cachedSDOObjectChanges = new HashMap();
> to
> protected Map cachedSDOObjectChanges = Collections.synchronizedMap(new HashMap());
> I will let you know if that fixes the problem. Any insight or assistance you can offer concerning this problem is appreciated. This is a show-stopper problem for us.
> Regards,
> - Ron

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


[jira] Commented: (TUSCANY-1006) ChangeSummaryImpl.cachedSDOObjectChanges appears to not be thread safe

Posted by "Frank Budinsky (JIRA)" <tu...@ws.apache.org>.
    [ http://issues.apache.org/jira/browse/TUSCANY-1006?page=comments#action_12459959 ] 
            
Frank Budinsky commented on TUSCANY-1006:
-----------------------------------------

The changes we're currently making as part of TUSCANY-859 may affect this behavior. It would be good to have a test program so that we can see  if the problem goes away once we check in those changes.

> ChangeSummaryImpl.cachedSDOObjectChanges appears to not be thread safe
> ----------------------------------------------------------------------
>
>                 Key: TUSCANY-1006
>                 URL: http://issues.apache.org/jira/browse/TUSCANY-1006
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SDO Implementation
>    Affects Versions: Java-M2
>         Environment: Sun JDK 1.4.2_11, 2-CPU server
>            Reporter: Ron Gavlin
>            Priority: Critical
>
> I have an application in which multiple threads access a shared ChangeSummaryImpl. Each thread invokes ChangeSummaryImpl.getOldValues() repeatedly. This causes one or more of the threads to enter an infinite "while (true) -" loop in HashMap.get(Object) with the following stack trace:
> HashMap.get(Object) line: 323
> ChangeSummaryImpl.getOldValues(DataObject) line: 481
> ...
> I suspect this occurs because the access to HashMap cachedSDOObjectChanges is not synchronized. 
> I have been unable as of yet to create a simple test case that demonstrates the problem. In the meantime, I will try to implement a short-term fix by changing line 93 of ChangeSummaryImpl 
> from
> protected HashMap cachedSDOObjectChanges = new HashMap();
> to
> protected Map cachedSDOObjectChanges = Collections.synchronizedMap(new HashMap());
> I will let you know if that fixes the problem. Any insight or assistance you can offer concerning this problem is appreciated. This is a show-stopper problem for us.
> Regards,
> - Ron

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


[jira] Commented: (TUSCANY-1006) ChangeSummaryImpl.cachedSDOObjectChanges appears to not be thread safe

Posted by "Kelvin Goodson (JIRA)" <tu...@ws.apache.org>.
    [ https://issues.apache.org/jira/browse/TUSCANY-1006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12518690 ] 

Kelvin Goodson commented on TUSCANY-1006:
-----------------------------------------

Looks good to me -- caters for all possibilities.  Will this be a one time check and store state?

> ChangeSummaryImpl.cachedSDOObjectChanges appears to not be thread safe
> ----------------------------------------------------------------------
>
>                 Key: TUSCANY-1006
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1006
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SDO Implementation
>    Affects Versions: Java-SDO-beta1
>         Environment: Sun JDK 1.4.2_11, 2-CPU server
>            Reporter: Ron Gavlin
>            Priority: Critical
>             Fix For: Java-SDO-beta1
>
>
> I have an application in which multiple threads access a shared ChangeSummaryImpl. Each thread invokes ChangeSummaryImpl.getOldValues() repeatedly. This causes one or more of the threads to enter an infinite "while (true) -" loop in HashMap.get(Object) with the following stack trace:
> HashMap.get(Object) line: 323
> ChangeSummaryImpl.getOldValues(DataObject) line: 481
> ...
> I suspect this occurs because the access to HashMap cachedSDOObjectChanges is not synchronized. 
> I have been unable as of yet to create a simple test case that demonstrates the problem. In the meantime, I will try to implement a short-term fix by changing line 93 of ChangeSummaryImpl 
> from
> protected HashMap cachedSDOObjectChanges = new HashMap();
> to
> protected Map cachedSDOObjectChanges = Collections.synchronizedMap(new HashMap());
> I will let you know if that fixes the problem. Any insight or assistance you can offer concerning this problem is appreciated. This is a show-stopper problem for us.
> Regards,
> - Ron

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


[jira] Updated: (TUSCANY-1006) ChangeSummaryImpl.cachedSDOObjectChanges appears to not be thread safe

Posted by "Kelvin Goodson (JIRA)" <tu...@ws.apache.org>.
     [ https://issues.apache.org/jira/browse/TUSCANY-1006?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kelvin Goodson updated TUSCANY-1006:
------------------------------------

    Fix Version/s:     (was: Java-SDO-Mx)
                   Java-SDO-M3

> ChangeSummaryImpl.cachedSDOObjectChanges appears to not be thread safe
> ----------------------------------------------------------------------
>
>                 Key: TUSCANY-1006
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1006
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SDO Implementation
>    Affects Versions: Java-SDO-M3
>         Environment: Sun JDK 1.4.2_11, 2-CPU server
>            Reporter: Ron Gavlin
>            Priority: Critical
>             Fix For: Java-SDO-M3
>
>
> I have an application in which multiple threads access a shared ChangeSummaryImpl. Each thread invokes ChangeSummaryImpl.getOldValues() repeatedly. This causes one or more of the threads to enter an infinite "while (true) -" loop in HashMap.get(Object) with the following stack trace:
> HashMap.get(Object) line: 323
> ChangeSummaryImpl.getOldValues(DataObject) line: 481
> ...
> I suspect this occurs because the access to HashMap cachedSDOObjectChanges is not synchronized. 
> I have been unable as of yet to create a simple test case that demonstrates the problem. In the meantime, I will try to implement a short-term fix by changing line 93 of ChangeSummaryImpl 
> from
> protected HashMap cachedSDOObjectChanges = new HashMap();
> to
> protected Map cachedSDOObjectChanges = Collections.synchronizedMap(new HashMap());
> I will let you know if that fixes the problem. Any insight or assistance you can offer concerning this problem is appreciated. This is a show-stopper problem for us.
> Regards,
> - Ron

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


[jira] Commented: (TUSCANY-1006) ChangeSummaryImpl.cachedSDOObjectChanges appears to not be thread safe

Posted by "Kelvin Goodson (JIRA)" <tu...@ws.apache.org>.
    [ https://issues.apache.org/jira/browse/TUSCANY-1006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12518185 ] 

Kelvin Goodson commented on TUSCANY-1006:
-----------------------------------------

My inclination would be
1) to make a soft dependency on the backport library,  such that if the java 1.5 ConcurrentHashMap was available then use that,  otherwise use the backport version.  This would mean that there would be no need to deploy the backport jar to a 1.5 environment.  (I have taken a look at the javadoc for the backport code,  but the web server that holds the license is not working properly at the moment,  so I am getting a server timeout on looking at the license.)
and in parallel 2) to fix TUSCANY-1182 so that we have the GroboUtils test environment in place and that we adopt the test case that you are running locally into the test suite. 


> ChangeSummaryImpl.cachedSDOObjectChanges appears to not be thread safe
> ----------------------------------------------------------------------
>
>                 Key: TUSCANY-1006
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1006
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SDO Implementation
>    Affects Versions: Java-SDO-beta1
>         Environment: Sun JDK 1.4.2_11, 2-CPU server
>            Reporter: Ron Gavlin
>            Priority: Critical
>             Fix For: Java-SDO-beta1
>
>
> I have an application in which multiple threads access a shared ChangeSummaryImpl. Each thread invokes ChangeSummaryImpl.getOldValues() repeatedly. This causes one or more of the threads to enter an infinite "while (true) -" loop in HashMap.get(Object) with the following stack trace:
> HashMap.get(Object) line: 323
> ChangeSummaryImpl.getOldValues(DataObject) line: 481
> ...
> I suspect this occurs because the access to HashMap cachedSDOObjectChanges is not synchronized. 
> I have been unable as of yet to create a simple test case that demonstrates the problem. In the meantime, I will try to implement a short-term fix by changing line 93 of ChangeSummaryImpl 
> from
> protected HashMap cachedSDOObjectChanges = new HashMap();
> to
> protected Map cachedSDOObjectChanges = Collections.synchronizedMap(new HashMap());
> I will let you know if that fixes the problem. Any insight or assistance you can offer concerning this problem is appreciated. This is a show-stopper problem for us.
> Regards,
> - Ron

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


[jira] Commented: (TUSCANY-1006) ChangeSummaryImpl.cachedSDOObjectChanges appears to not be thread safe

Posted by "Kelvin Goodson (JIRA)" <tu...@ws.apache.org>.
    [ https://issues.apache.org/jira/browse/TUSCANY-1006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12518496 ] 

Kelvin Goodson commented on TUSCANY-1006:
-----------------------------------------

Before we get too far down the line with using the backport ConcurrentHashMap I have finally been able to access a page that refers to a license and I think there may be an issue

Info from ....
http://www.mvnrepository.com/artifact/backport-util-concurrent/backport-util-concurrent/3.0

maven artifacts are available from maven repo at http://ibiblio.org/pub/packages/maven2/backport-util-concurrent/backport-util-concurrent/
the jars there do not contain license files

but the web page says the license is http://creativecommons.org/licenses/publicdomain

this license isn't directly mentioned in http://people.apache.org/~cliffs/3party.html
and the discussion in ....
http://mail-archives.apache.org/mod_mbox/www-legal-discuss/200610.mbox/%3cc5e632550610270807qad46ffaodc4d65703676608f@mail.gmail.com%3e
doesn't lead me to a firm conclusion either,  but it certainly doesn't give me a warm feeling

> ChangeSummaryImpl.cachedSDOObjectChanges appears to not be thread safe
> ----------------------------------------------------------------------
>
>                 Key: TUSCANY-1006
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1006
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SDO Implementation
>    Affects Versions: Java-SDO-beta1
>         Environment: Sun JDK 1.4.2_11, 2-CPU server
>            Reporter: Ron Gavlin
>            Priority: Critical
>             Fix For: Java-SDO-beta1
>
>
> I have an application in which multiple threads access a shared ChangeSummaryImpl. Each thread invokes ChangeSummaryImpl.getOldValues() repeatedly. This causes one or more of the threads to enter an infinite "while (true) -" loop in HashMap.get(Object) with the following stack trace:
> HashMap.get(Object) line: 323
> ChangeSummaryImpl.getOldValues(DataObject) line: 481
> ...
> I suspect this occurs because the access to HashMap cachedSDOObjectChanges is not synchronized. 
> I have been unable as of yet to create a simple test case that demonstrates the problem. In the meantime, I will try to implement a short-term fix by changing line 93 of ChangeSummaryImpl 
> from
> protected HashMap cachedSDOObjectChanges = new HashMap();
> to
> protected Map cachedSDOObjectChanges = Collections.synchronizedMap(new HashMap());
> I will let you know if that fixes the problem. Any insight or assistance you can offer concerning this problem is appreciated. This is a show-stopper problem for us.
> Regards,
> - Ron

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


[jira] Commented: (TUSCANY-1006) ChangeSummaryImpl.cachedSDOObjectChanges appears to not be thread safe

Posted by "Ron Gavlin (JIRA)" <tu...@ws.apache.org>.
    [ https://issues.apache.org/jira/browse/TUSCANY-1006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12518331 ] 

Ron Gavlin commented on TUSCANY-1006:
-------------------------------------

Agreed. I am planning to submit a patch for this issue in the near future.

Thanks,

- Ron

> ChangeSummaryImpl.cachedSDOObjectChanges appears to not be thread safe
> ----------------------------------------------------------------------
>
>                 Key: TUSCANY-1006
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1006
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SDO Implementation
>    Affects Versions: Java-SDO-beta1
>         Environment: Sun JDK 1.4.2_11, 2-CPU server
>            Reporter: Ron Gavlin
>            Priority: Critical
>             Fix For: Java-SDO-beta1
>
>
> I have an application in which multiple threads access a shared ChangeSummaryImpl. Each thread invokes ChangeSummaryImpl.getOldValues() repeatedly. This causes one or more of the threads to enter an infinite "while (true) -" loop in HashMap.get(Object) with the following stack trace:
> HashMap.get(Object) line: 323
> ChangeSummaryImpl.getOldValues(DataObject) line: 481
> ...
> I suspect this occurs because the access to HashMap cachedSDOObjectChanges is not synchronized. 
> I have been unable as of yet to create a simple test case that demonstrates the problem. In the meantime, I will try to implement a short-term fix by changing line 93 of ChangeSummaryImpl 
> from
> protected HashMap cachedSDOObjectChanges = new HashMap();
> to
> protected Map cachedSDOObjectChanges = Collections.synchronizedMap(new HashMap());
> I will let you know if that fixes the problem. Any insight or assistance you can offer concerning this problem is appreciated. This is a show-stopper problem for us.
> Regards,
> - Ron

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


[jira] Commented: (TUSCANY-1006) ChangeSummaryImpl.cachedSDOObjectChanges appears to not be thread safe

Posted by "Ron Gavlin (JIRA)" <tu...@ws.apache.org>.
    [ https://issues.apache.org/jira/browse/TUSCANY-1006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12518507 ] 

Ron Gavlin commented on TUSCANY-1006:
-------------------------------------

Kelvin,

FWIW, the current release of Apache ActiveMQ (version 4.1.1) (http://activemq.apache.org/activemq-411-release.html) bundles the backport-util-concurrent-2.1.jar in its binary distribution.


> ChangeSummaryImpl.cachedSDOObjectChanges appears to not be thread safe
> ----------------------------------------------------------------------
>
>                 Key: TUSCANY-1006
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1006
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SDO Implementation
>    Affects Versions: Java-SDO-beta1
>         Environment: Sun JDK 1.4.2_11, 2-CPU server
>            Reporter: Ron Gavlin
>            Priority: Critical
>             Fix For: Java-SDO-beta1
>
>
> I have an application in which multiple threads access a shared ChangeSummaryImpl. Each thread invokes ChangeSummaryImpl.getOldValues() repeatedly. This causes one or more of the threads to enter an infinite "while (true) -" loop in HashMap.get(Object) with the following stack trace:
> HashMap.get(Object) line: 323
> ChangeSummaryImpl.getOldValues(DataObject) line: 481
> ...
> I suspect this occurs because the access to HashMap cachedSDOObjectChanges is not synchronized. 
> I have been unable as of yet to create a simple test case that demonstrates the problem. In the meantime, I will try to implement a short-term fix by changing line 93 of ChangeSummaryImpl 
> from
> protected HashMap cachedSDOObjectChanges = new HashMap();
> to
> protected Map cachedSDOObjectChanges = Collections.synchronizedMap(new HashMap());
> I will let you know if that fixes the problem. Any insight or assistance you can offer concerning this problem is appreciated. This is a show-stopper problem for us.
> Regards,
> - Ron

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


[jira] Commented: (TUSCANY-1006) ChangeSummaryImpl.cachedSDOObjectChanges appears to not be thread safe

Posted by "Ron Gavlin (JIRA)" <tu...@ws.apache.org>.
    [ http://issues.apache.org/jira/browse/TUSCANY-1006?page=comments#action_12460043 ] 
            
Ron Gavlin commented on TUSCANY-1006:
-------------------------------------

I will give that a try and let you know. 

The synchronized HashMap I proposed synchronizes on reads which introduces lots of overhead (see article http://www.informit.com/guides/content.asp?g=java&seqNum=246&rl=1). Your approach is much preferred, especially since ConcurrentHashMap is only available in Java 5.

I suspect we need synchronized blocks around the two cachedSDOObjectChanges.clear() invocations as well. Do you agree?

- Ron

> ChangeSummaryImpl.cachedSDOObjectChanges appears to not be thread safe
> ----------------------------------------------------------------------
>
>                 Key: TUSCANY-1006
>                 URL: http://issues.apache.org/jira/browse/TUSCANY-1006
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SDO Implementation
>    Affects Versions: Java-M2
>         Environment: Sun JDK 1.4.2_11, 2-CPU server
>            Reporter: Ron Gavlin
>            Priority: Critical
>
> I have an application in which multiple threads access a shared ChangeSummaryImpl. Each thread invokes ChangeSummaryImpl.getOldValues() repeatedly. This causes one or more of the threads to enter an infinite "while (true) -" loop in HashMap.get(Object) with the following stack trace:
> HashMap.get(Object) line: 323
> ChangeSummaryImpl.getOldValues(DataObject) line: 481
> ...
> I suspect this occurs because the access to HashMap cachedSDOObjectChanges is not synchronized. 
> I have been unable as of yet to create a simple test case that demonstrates the problem. In the meantime, I will try to implement a short-term fix by changing line 93 of ChangeSummaryImpl 
> from
> protected HashMap cachedSDOObjectChanges = new HashMap();
> to
> protected Map cachedSDOObjectChanges = Collections.synchronizedMap(new HashMap());
> I will let you know if that fixes the problem. Any insight or assistance you can offer concerning this problem is appreciated. This is a show-stopper problem for us.
> Regards,
> - Ron

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org