This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hello
I am trying to use lightspeed with a web application that needs to ensure that concurrent transactions don't affect the same value incorrectly. So I figure I need locking - I was interested in doing this at database level but I not sure how LightSpeed copes with that, I see that there is "Optimistic Concurrency Control" - is this as reliable as row locking? Can LightSpeed cope with row locking? I am really looking for a place to get started with this. Does anybody have any hints, tips or examples of dealing with concurrency? I am hoping to use MySQL. Thanks |
|
|
Hi exm: My research on 'Optimistic Concurrency Control' lead me to the help page on transactions where it describes how to implement optimistic concurrency: I'll certainly be giving it a try shortly. Although as stated in your OP it would be interesting to see if/how to utilize other concurrency strategies in LightSpeed. Matthew |
|
|
Hi Matthew, I have given that a try and it works. Its quite slow and performance intensive - I reckon database row level locking may be more efficient but need to find out if lightspeed supports database level locking.
Any way to implement pessimistic concurrency or database level locking? Thanks, Scott |
|
|
Hi Scott: I'm just a LightSpeed beginer myself but perhaps by overriding the OnPropertyChanged ( See http://www.mindscape.co.nz/products/lightspeed/Help/html/AllMembers_T_Mindscape_LightSpeed_Entity.htm) you can then make the call to the database to lock the row. Then I believe you could use a LightSpeed query to lock the row? Is that possible? Not sure... |
|
|
Hi Matthew,
I have been reading into locking a bit more - seems I misunderstood the methods. Definitely want to be using optimistic. Seems quite slow, but I think maybe my stress test to reproduce concurrency was maybe a bit ferocious. http://www.agiledata.org/essays/concurrencyControl.html So I think I happy to use LightSpeeds optimistic concurrency now. Thanks for looking into this too. Cheers, Scott
|
|