The Controller.java file when doing the secondary events. (autoupdates)
is doing it too many times. We have a double while loop.....it tends to do
the
updates many many times. It ignores the inner dbforms autoupdate tags if set
to "false".
(I use inner dbforms sometimes to do lookups....I think a different feature
would be
nice like a textField with fieldName=" "  to a link up the chain. ie:
fieldName="child_table.parent_table_id(parent_table.id).description"


The outside loop below does every table once but this is looped again during
engine's
generation of secondary events. (below this snip of Controller.java)

                Enumeration tableEnum = engine.getInvolvedTables().elements();


                while (tableEnum.hasMoreElements())
                {
                        Table t = (Table) tableEnum.nextElement();
                        Enumeration eventEnum = engine.generateSecundaryEvents(e);
                        logCat.debug("processing:"+t.getName());

                        while (eventEnum.hasMoreElements())
                        {

....

....
                        }
                }

EventEngine.java

                for (int i = 0; i < vAc.size(); i++)
                {
                        String param = (String) vAc.elementAt(i);
                        logCat.warn("Doing autoupdate UpdateEvents for:"+param);
                        // auto-updating may be disabled, so we have to check:
                        if (ParseUtil.getParameter(request, 
param).equalsIgnoreCase("true"))
                        {
                                // let's find the id of the next table we may update
                                int tableId = 
Integer.parseInt(param.substring("autoupdate_".length()));
                                // we can only update existing rowsets. so we just 
look for key-values
                                String paramStub = "k_" + tableId + "_";
                                Enumeration keysOfCurrentTable =
                                        ParseUtil.getParametersStartingWith(request, 
paramStub).elements();
                                while (keysOfCurrentTable.hasMoreElements())
                                {
                                        String aKeyParam = (String) 
keysOfCurrentTable.nextElement();
                                        String keyId = 
aKeyParam.substring(paramStub.length());
                                        logCat.info(
                                                "autoaupdate debug info: keyId=" + 
keyId + " excludeKeyId=" +
excludeKeyId);

                                        //this level of checking is not good enough. 
we also run through
interceptors too much.
                                        if (!collissionDanger
                                                || excludeTableId != tableId
                                                || !keyId.equals(excludeKeyId))
                                        {

                                                UpdateEvent e = new 
UpdateEvent(tableId, keyId, request, config);
                                                result.addElement(e);
                                        }//if no collision danger or excluded tables 
or keys.

                                }//while

                        }//if autoupdate is true.

                }//for each element in our vAc vector.




-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone?  Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
_______________________________________________
DbForms Mailing List

http://www.wap-force.net/dbforms

Reply via email to