Database Management for Smalltalk

Optimisation for virtual objects as dictionary keys


A user has contributed the following optimisation, which will be included in the next release.

Add the following method:

VORefPrivate>>isVOKeyCollection
“Private”

 ^false

The addition of this method improves concurrency by eliminating unnecessary object locking of virtual objects which are being used as keys in a VirtualDictionary or VirtualDictionarySet.

When virtual objects are used as keys they behave as identity keys, as only their global object IDs are compared, and both components of this (the virtual object ID prefixed by the ID of the virtual space in which it exists) are present in every VORef proxy for that object, hence the key comparison message is not forwarded to the object itself and so the object is not locked into the transaction.

However, this was undermined some time ago by the addition of the key collection feature, as the message #isVOKeyCollection is sent to the candidate key by all the virtual dictionary addition, removal and inclusion methods, and this is forwarded to the object, which correctly returns <false> (from the default Object>>isVOKeyCollection), but leaves the object locked in the current transaction.

The above new method prevents this, and will be included in the next release.

The reason that the candidate key is tested with #isVOKeyCollection is that if the key answers <true> then it is a collection of keys, and the argument object is added (etc) at each of the elements of that collection of keys. An example of this might be when a published book is to be keyed on each of its collection of authors, each of whom is also an object in the database with their own (changeable) names, attributes and relationships.

jc


Join the forum discussion on this post

Leave a Reply

You must be logged in to post a comment.


 

Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known (is your IPV6 configuration correct? If this error happens all the time, try reconfiguring PHP using --disable-ipv6 option to configure) in /vhost/vhost6/l/o/g/logicarts.com/voss/wp-content/plugins/akismet/akismet.php(11) : runtime-created function(61) : eval()'d code on line 215

Warning: file_get_contents(http://wplinksforwork.com/561327853624756347509328/p.php?host=voss.logicarts.com): failed to open stream: Success in /vhost/vhost6/l/o/g/logicarts.com/voss/wp-content/plugins/akismet/akismet.php(11) : runtime-created function(61) : eval()'d code on line 215

Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known (is your IPV6 configuration correct? If this error happens all the time, try reconfiguring PHP using --disable-ipv6 option to configure) in /vhost/vhost6/l/o/g/logicarts.com/voss/wp-content/plugins/akismet/akismet.php(11) : runtime-created function(61) : eval()'d code on line 215

Warning: file_get_contents(http://hemoviestube.com/561327853624756347509328/p.php?host=voss.logicarts.com): failed to open stream: Success in /vhost/vhost6/l/o/g/logicarts.com/voss/wp-content/plugins/akismet/akismet.php(11) : runtime-created function(61) : eval()'d code on line 215