Issue Details (XML | Word | Printable)

Key: NUCRDBMS-566
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Andy Jefferson
Reporter: Andy Jefferson
Votes: 0
Watchers: 0
Operations

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

Add SchemaLock to restrict access while updating schema definition

Created: 21/Nov/11 11:57 AM   Updated: 09/Jul/12 12:39 PM   Resolved: 29/Jun/12 05:08 PM
Component/s: Schema
Affects Version/s: None
Fix Version/s: 3.1.0.m5


 Description  « Hide
When a user hasn't identified all of their schema at startup, we are dependent on no interactions between adding/updating tables and access to these tables. Would be preferable to introduce a level of locking. Obviously this locking should allow concurrent read access, but prevent read+write at the same time.

Could add a lock on each DatastoreTable maybe, but that on its own won't allow concurrent reads.

The current lock in RDBMSStoreManager doesn't prevent reads of the schema information, possibly part way through an update.

Andy Jefferson made changes - 21/Nov/11 12:02 PM
Field Original Value New Value
Summary Add locking of ClassTable with writes Add restrictions of access to DatastoreTable when updating schema definition
Description When a user hasn't identified all of their schema at startup, we are dependent on no interactions between adding/updating tables and access to these tables. Would be preferable to introduce a level of locking. Obviously this locking should allow concurrent read access, but prevent read+write at the same time.

Could add a lock on each DatastoreTable maybe, but that on its own won't allow concurrent reads.
When a user hasn't identified all of their schema at startup, we are dependent on no interactions between adding/updating tables and access to these tables. Would be preferable to introduce a level of locking. Obviously this locking should allow concurrent read access, but prevent read+write at the same time.

Could add a lock on each DatastoreTable maybe, but that on its own won't allow concurrent reads.

The current lock in RDBMSStoreManager doesn't prevent reads of the schema information, possibly part way through an update.
Andy Jefferson made changes - 29/Jun/12 05:04 PM
Summary Add restrictions of access to DatastoreTable when updating schema definition Add SchemaLock to restrict access while updating schema definition
Andy Jefferson added a comment - 29/Jun/12 05:08 PM
SVN trunk moves the lock down to MappedStoreManager as schemaLock, applying a read lock to accessors for DatastoreClass, and write lock to the class addition process

Andy Jefferson made changes - 29/Jun/12 05:08 PM
Status Open [ 1 ] Resolved [ 5 ]
Assignee Andy Jefferson [ andy ]
Fix Version/s 3.1.0.m5 [ 11599 ]
Resolution Fixed [ 1 ]
Chris Colman added a comment - 01/Jul/12 12:19 PM
I think I had a problem just like this the other day. I was letting the app start with an empty schema and built it as required but it got stuck on a particular class each time. I got around it by using the schematool to generate a full schema building SQL script and then running that script before starting the app. When the app started it ran without a problem.

Andy Jefferson made changes - 09/Jul/12 12:39 PM
Status Resolved [ 5 ] Closed [ 6 ]