openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Patrick Linskey (JIRA)" <j...@apache.org>
Subject [jira] Updated: (OPENJPA-161) Overuse of synchronization in AbstractBrokerFactory
Date Thu, 22 Feb 2007 22:09:05 GMT

     [ https://issues.apache.org/jira/browse/OPENJPA-161?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Patrick Linskey updated OPENJPA-161:
------------------------------------

    Attachment: openjpa-161-patch.txt

This patch removes the synchronization on _transactional, replacing it with a ConcurrentHashMap
and using the ConcurrentHashMap.putIfAbsent() call to safely handle concurrent access. My
analysis is that we do not need to synchronize on the lists inside _transactional, since the
key that we look up the collection with is a JTA transaction, and JTA does not allow a transaction
to be used concurrently in multiple threads.

Barring any objections, I plan to commit this change in the next day or so.

> Overuse of synchronization in AbstractBrokerFactory
> ---------------------------------------------------
>
>                 Key: OPENJPA-161
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-161
>             Project: OpenJPA
>          Issue Type: Improvement
>          Components: kernel
>            Reporter: Patrick Linskey
>         Attachments: openjpa-161-patch.txt
>
>
> AbstractBrokerFactory maintains a Map<Transaction,List<Broker>> that is guarded
by synchronized blocks. These synchronized blocks should be removed if possible.

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


Mime
View raw message