DataNucleus JIRA is now in read-only mode. Raise any new issues in GitHub against the plugin that it applies to. DataNucleus JIRA will remain for the foreseeable future but will eventually be discontinued
Issue Details (XML | Word | Printable)

Key: NUCCORE-606
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Andy Jefferson
Reporter: Andy Jefferson
Votes: 0
Watchers: 0

If you were logged in you would be able to see more operations.
DataNucleus Core

Improve multithreaded handling, e.g subclass ObjectManagerImpl

Created: 28/Nov/10 12:52 PM   Updated: 03/Oct/11 07:37 AM   Resolved: 02/Aug/11 07:33 PM
Component/s: Code Structure, Persistence
Affects Version/s: None
Fix Version/s: 3.0.1

 Description  « Hide
If the PMF has the persistence property "Multithreaded" set, we should create an instance of a ThreadedObjectManagerImpl (extends ObjectManagerImpl). This subclass will simply override the client (PM/EM) facing method and add "synchronized(readWriteLock)". Means we can more easily separate the locking code from the work code

In addition we need to list all entry points to ObjectManager so we can assess what needs locking and when. We currently have
1. ObjectManager readWriteLock
2. ObjectManager some methods synchronized
3. StateManager some methods synchronized

ObjectManager has access methods like commit(), rollback(), findObject(), persistObject() etc and StateManager has access methods like setXXXField()

Sort Order: Ascending order - Click to sort in descending order
Andy Jefferson added a comment - 02/Aug/11 07:33 PM
SVN trunk removes all "synchronized" and adds use of Lock.lock()/Lock.unlock() to ObjectManager and StateManager, and only when "multithreaded" is enabled. Means that the majority of usage will not see any locking