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.

Sort Order: Ascending order - Click to sort in descending order
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

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.