Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-dev] Bug 341261 - User should be able to add descriptor to connected session while threads doing CRUD operations concurrently.

A new patch is ready for review.

Compared to the previous version of the patch:

- added addSequence method to DatabaseSession so that sequences could be added to connected session in a safe way (by copying the whole map, adding the sequence, then overriding the original map - just like in descriptors case);

- BatchWritingMechanism was changed to hold its maxSize; maxBatchWritingSize attribute DatabasePlatform now initialized to 0; if not set by the user then default value is used (different for each subclass);

- added comments to Platform and Login that addSequences not to be used while session is connected;

- removed shalowClone method (that I introduced in the prev. version of the patch) from DatasourceLogin. Sequencemanager and ConnectionPool now don't clone the login that used for SequenceConnectionPool and built accessor respectively;

- introduced sequencesLock and descriptorsLock to synchronized access to
methods that add / remove sequences on DatasourcePlatform and methods that add descriptors in Project class (except Project.adDescriptor that doesn't take session as a a parameter).


On 4/1/2011 5:40 PM, Andrei Ilitchev wrote:
Updated patch is ready for review.

Added two multithreaded tests: in both the main thread adds new
descriptors with either default, or native, or table sequences; while
several concurrent tests in one case preallocate sequence numbers; in
another insert objects:

Updated AbstractTransactionController so that adding descriptors never
cause calling clearSequencingListeners method that may derail
concurrently committed transaction;

In DatasourcePlatform change sequences map from HashMap to
Also got rid of iterating directly on sequences map - now clone first
then iterate the clone.

Cloning of Login done on several occasions
(ConnectionPool.buildConnection, in
ConnectionPolicy, in SequencingManager) but none of these cases
interested in cloned Platform to be underneath the login.
Cloning of Platform cause deep cloning of sequences - each one is
recreated on the clone platform.
Therefore introduced a new method Login.shalowClone and used it in all
three places in core code where Login.clone was used.

On 3/30/2011 5:26 PM, Andrei Ilitchev wrote:
The patch is ready

eclipselink-dev mailing list
eclipselink-dev mailing list

Back to the top