[Helma-user] Suggestion for Transactor.java

Kris Leite kleite at imcsoftware.com
Mon Apr 23 19:09:10 CEST 2007


I found that in using the new 'onPersist' feature that if I added or updated
another persisted HopObject, that HopObject was not being written out
to the database (either embedded or relational).

It would appear that in 'commit()' method in Transactor.java makes a
copy of the dirtyNodes map once and processes all the nodes.  Anything
done in the 'onPersist' calls will be ignored.

I would like to suggest that the routine is changed slightly to continue
looking into the dirtyNodes list for any addition Nodes that need to be
updated.  The change is very simple and can be implemented on just
a couple lines:

1) Around line 260 in Transactor.java which contains:

       if (!dirtyNodes.isEmpty()) {

change to:

    while (!dirtyNodes.isEmpty()) {

2) Add a new line after line 261

     Object[] dirty = dirtyNodes.values().toArray();

insert:

    dirtyNodes = new HashMap();

If you would like a patch for this change, I can provide one.

Thanks,
Kris



More information about the Helma-user mailing list