kazu2012 / persevere-framework

Automatically exported from code.google.com/p/persevere-framework
0 stars 0 forks source link

Duplicate indexes for entries when changes are made from a Thread #251

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Add an onSet function to a class and within that function, spawn a thread, 
which itself makes 
a change to the instance
2. Change a class instance attribute to cause the onset function be called
3. A duplicate index is created for that instance

What version of the product are you using? On what operating system?
I am running on a MAC, using a version of Persevere from around a month ago.

Please provide any additional information below.
Here is some sample code that reproduces the problem.  My real code is much 
more complex 
and the new Thread is a piece of Java code that already exists prior to the 
invocation of onSet but 
the onSet wakens this thread.  So the problem is not specific to the Javascript 
"new Thread" 
function.

This works fine :-

                        myattribute: { 
                            default:false,
                            "onSet":function(value,name,propertyDefinition) {
                                var p=load("/MyClass/1");
                                p.status="Ready";
                                    return value; 
                            }

This causes duplicate indexes :-
                        myattribute: { 
                            default:false,
                            "onSet":function(value,name,propertyDefinition) {
                                        new Thread(function() {
                                    var p=load("/MyClass/1");
                                    p.status="Ready";
                                        });
                                    return value; 
                            }

Original issue reported on code.google.com by pvolkaer...@gmail.com on 17 Sep 2009 at 7:46

GoogleCodeExporter commented 8 years ago
I checked in a fix on the 1.0 branch (will be in the nightly). Let me know if 
this 
fixes it for you.

Original comment by kris...@gmail.com on 23 Sep 2009 at 2:26

GoogleCodeExporter commented 8 years ago
Just tested it and yes this fixes my duplication issue; thanks Kris.

Original comment by pvolkaer...@gmail.com on 25 Sep 2009 at 11:04