[aida] concurrency, locking

Janko Mivšek janko.mivsek at eranova.si
Fri Aug 12 21:56:08 CEST 2011


Hi Paul, welcome to the mailing list!

S, paul-- na arcor.de piše:
> Hello List and Janko Mivšek,
> 
> thank you for making the framework available.
> 
> How to deal with concurrency?
> Example: the adressbook from  http://www.aidaweb.si/tutorial
> Many user can start editing the same dataset without information the dataset is already in use. And without a kind of recordlocking.
> 
> Are there "helpermethods" in the framework? (and if so, which?)
> Any pointer where I should read up on the topic.

If you load Scribo as well, there is a locking support in class
Document, implemented in subclases WikiPage and presentation class
WikiPageApp.

In short: when page is edited, an Ajax polling in background keeps
server informing that this page is editing. If someone else try to edit
it, a warning is shown with a name of the editor. By Ajax polling again
this warning disappears when original editor finish editing.

Here are classes and methods to look at:

  Document category 'locking':

	aidaIsLockedOn: aSession,
	aidaLockOn: aSession,
	aidaUnlock, ...

  WikiPageApp category 'access rights':

	setLock
	regrantLock
  	isLockedBySomeoneElse

  WikiPageApp

	viewEdit "to see how it is used"
	lockElement  "to refresh document lock periodically"
	viewWait "to wait until page is unlocked"


You can load Scribo simply by this script:

  Gofer new
    squeaksource: 'MetacelloRepository';
    package: 'ConfigurationOfScribo';
    load.

 (Smalltalk at: #ConfigurationOfScribo) load.	


Hope this helps
Janko

-- 
Janko Mivšek
Aida/Web
Smalltalk Web Application Server
http://www.aidaweb.si


More information about the Aida mailing list