We are getting duplicate facts in our fact-base.  The same
fact-id appears twice when we run (facts) and is output
twice in a (save-facts). Specific rules to examine the
facts; however, only see the fact once.  One of each pair can
be retracted, but attempts to retract the remaining one fail
with no message.

The facts are dynamic definstances of java objects.  The
definstance and modification are done in a separate thread
from the rules execution.  No specific hashcode or equals
method has been defined.

The problem seems to be centered around modification of a
specific bean property which has given us problems in the past.
An earlier question (6/20) on a related issue got us this
response.

Furthermore, be sure that the hashCodes of the Beans, and of the
objects they contain in their slots, do not change except as reported
in a property change event. A common problem is having a container
like a Set, Map or List as a Bean property. If data is added to the
Set, Map, or List, its hashCode will likely change. Since the hashCode
may have been used by Jess to organize facts in the Rete network, such
a change will corrupt Jess's data structures, and so from that point
on anything can happen. Bean properties should be simple value objects
like Strings and Integers.


The property is stored as a Map but passed as an array in its get
method and propertychange event. The set method is not implemented. We 
thought it was taken care of at the time since it seemed to work but
recent code changes have brought it back.

I am not sure what questions to ask at this point. It seems that our use 
of the Map may be causing our problems. Can we use the map as a bean
property at all?  Do we have to define our own  hashcode and equals
method for the bean? How does Jess use the slot hashcodes?

                      - Tim Good

--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list
(use your own address!) List problems? Notify [EMAIL PROTECTED]
--------------------------------------------------------------------

Reply via email to