Problem with xforms-value-changed, incremental="true" and replace="instance"

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem with xforms-value-changed, incremental="true" and replace="instance"

Henrik Pettersen
Hi,

I'm having some problem with infinite loops with the attached source code. Here is my current system configuration:

OS:                             Ubuntu Linux Feisty Fawn
Application Server:    apache-tomcat-5.5.23
Browser:                     Mozilla Firefox 2.0.0.4
Java:                           1.5.0_12-b04
Orbeon:                      ops-3.6.0beta.200707131717

Here is the log outputs from what is happening:
...
2007-07-16 22:10:12,469 http-8080-Processor15 INFO  webapp.ProcessorService  - /test-update - Timing: 10 - Cache hits: 251, fault: 16, adds: 0, success rate: 94%
2007-07-16 22:10:12,477 http-8080-Processor17 INFO   webapp.ProcessorService  - /test-update - Received request
2007-07-16 22:10:12,485 http-8080-Processor24 INFO  webapp.ProcessorService  - /test-update - Timing: 55 - Cache hits: 251, fault: 16, adds: 0, success rate: 94%
2007-07-16 22:10:12,489 http-8080-Processor17 INFO  webapp.ProcessorService  - /test-update - Timing: 13 - Cache hits: 251, fault: 16, adds: 0, success rate: 94%
2007-07-16 22:10:12,497 http-8080-Processor13 INFO   webapp.ProcessorService  - /test-update - Received request
2007-07-16 22:10:12,514 http-8080-Processor13 INFO  webapp.ProcessorService  - /test-update - Timing: 17 - Cache hits: 251, fault: 16, adds: 0, success rate: 94%
2007-07-16 22:10:12,522 http-8080-Processor19 INFO  webapp.ProcessorService  - /test-update - Received request
2007-07-16 22:10:12,537 http-8080-Processor19 INFO  webapp.ProcessorService  - /test-update - Timing: 15 - Cache hits: 251, fault: 16, adds: 0, success rate: 94%
2007-07-16 22:10:12,546 http-8080-Processor15 INFO  webapp.ProcessorService  - /test-update - Received request
2007-07-16 22:10:12,567 http-8080-Processor24 INFO  webapp.ProcessorService  - /test-update - Received request
2007-07-16 22:10:12,584 http-8080-Processor24 INFO  webapp.ProcessorService  - /test-update - Timing: 17 - Cache hits: 251, fault: 16, adds: 0, success rate: 94%
2007-07-16 22:10:12,596 http-8080-Processor15 INFO   webapp.ProcessorService  - /test-update - Timing: 50 - Cache hits: 251, fault: 16, adds: 0, success rate: 94%
2007-07-16 22:10:12,598 http-8080-Processor17 INFO  webapp.ProcessorService  - /test-update - Received request
2007-07-16 22:10:12,619 http-8080-Processor15 INFO  webapp.ProcessorService  - /test-update - Received request
2007-07-16 22:10:12,632 http-8080-Processor17 INFO  webapp.ProcessorService  - /test-update - Timing: 33 - Cache hits: 251, fault: 16, adds: 0, success rate: 94%
2007-07-16 22:10:12,641 http-8080-Processor13 INFO  webapp.ProcessorService  - /test-update - Received request
2007-07-16 22:10:12,660 http-8080-Processor13 INFO  webapp.ProcessorService  - /test-update - Timing: 19 - Cache hits: 251, fault: 16, adds: 0, success rate: 94%
2007-07-16 22:10:12,667 http-8080-Processor15 INFO  webapp.ProcessorService  - /test-update - Timing: 48 - Cache hits: 251, fault: 16, adds: 0, success rate: 94%
2007-07-16 22:10:12,672 http-8080-Processor19 INFO   webapp.ProcessorService  - /test-update - Received request
2007-07-16 22:10:12,682 http-8080-Processor19 INFO  webapp.ProcessorService  - /test-update - Timing: 10 - Cache hits: 251, fault: 16, adds: 0, success rate: 94%
2007-07-16 22:10:12,690 http-8080-Processor15 INFO  webapp.ProcessorService  - /test-update - Received request
2007-07-16 22:10:12,699 http-8080-Processor15 INFO  webapp.ProcessorService  - /test-update - Timing: 9 - Cache hits: 251, fault: 16, adds: 0, success rate: 94%
2007-07-16 22:10:12,717 http-8080-Processor24 INFO  webapp.ProcessorService  - /test-update - Received request
...

Infinite loop.

Now, I'm not sure if this is a bug or a change in how the xforms-value-changed gets fired, but this problem seems to have been introduced some time between my last update (ab. 3-4 mnths ago) and ops-3.6.0beta.200707131717.

Has anyone else seen this problem? How can I get my form to save itself (i.e. submit my instance to 'save.xpl') asynchronously whenever a user changes a field value?

There are 2 attachments to this email:
1. A zip file containing a reproducible example
2. An extra copy of the view (also found in the zip), for easy access

Thanks!

Sincerely,
Henrik Pettersen


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws

inifinite-loop.zip (2K) Download Attachment
test.xsl (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Problem with xforms-value-changed, incremental="true" and replace="instance"

Alessandro Vernet
Administrator
Henrik,

On 7/16/07, Henrik Pettersen <[hidden email]> wrote:
> I'm having some problem with infinite loops with the attached source code.

Thank you for the test case. I managed to reproduce the problem; I
created a test that runs in the sandbox for this, and add this bug:

http://forge.objectweb.org/tracker/index.php?func=detail&aid=307307&group_id=168&atid=350207

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
http://www.orbeon.com/



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Problem with xforms-value-changed, incremental="true" and replace="instance"

Erik Bruchez
Administrator
In reply to this post by Henrik Pettersen
Henrik,

This is related to the whole question of what to do with UI events in
case of instance replacement. This question is pending in the XForms
Working Group at the moment. It also touches on the bigger issue of UI
events in general, which we at Orbeon think is broken in the current
XForms spec.

Now, in Orbeon Forms, and awaiting a better solution, we chose the
option of sending xforms-value-changed events for all controls bound
to an instance which has been replaced. We picked this over the
alternative of never sending those events.

This was implemented quite a while ago, but then got broken. We then
fixed it again. This explains why your application did not exhibit
this behavior at some point.

Unfortunately, this means that until a better implementation of UI
events is available, you will have to use a workaround. What about:

* Set flag before sending submission with instance replacement
* Clear flag upon xforms-submit-done AND xforms-submit-error
* Protect the event handler with an "if" condition, something like:

   <xforms:action ev:event="xforms-value-changed"
                  if="/my/submission/flag = 'false'">

-Erik

Henrik Pettersen wrote:
 > Hi,
 >
 > I'm having some problem with infinite loops with the attached source
 > code. Here is my current system configuration:
 >
 > OS:                             Ubuntu Linux Feisty Fawn
 > Application Server:    apache-tomcat-5.5.23
 > Browser:                     Mozilla Firefox 2.0.0.4 <http://2.0.0.4>
 > Java:                           1.5.0_12-b04
 > Orbeon:                      ops-3.6.0beta.200707131717
 >
 > Here is the log outputs from what is happening:
 > ...
 > 2007-07-16 22:10:12,469 http-8080-Processor15
 > INFO  webapp.ProcessorService  - /test-update - Timing: 10 - Cache hits:
 > 251, fault: 16, adds: 0, success rate: 94%
 > 2007-07-16 22:10:12,477 http-8080-Processor17 INFO
 > webapp.ProcessorService  - /test-update - Received request
 > 2007-07-16 22:10:12,485 http-8080-Processor24
 > INFO  webapp.ProcessorService  - /test-update - Timing: 55 - Cache hits:
 > 251, fault: 16, adds: 0, success rate: 94%
 > 2007-07-16 22:10:12,489 http-8080-Processor17
 > INFO  webapp.ProcessorService  - /test-update - Timing: 13 - Cache hits:
 > 251, fault: 16, adds: 0, success rate: 94%
 > 2007-07-16 22:10:12,497 http-8080-Processor13 INFO
 > webapp.ProcessorService  - /test-update - Received request
 > 2007-07-16 22:10:12,514 http-8080-Processor13
 > INFO  webapp.ProcessorService  - /test-update - Timing: 17 - Cache hits:
 > 251, fault: 16, adds: 0, success rate: 94%
 > 2007-07-16 22:10:12,522 http-8080-Processor19
 > INFO  webapp.ProcessorService  - /test-update - Received request
 > 2007-07-16 22:10:12,537 http-8080-Processor19
 > INFO  webapp.ProcessorService  - /test-update - Timing: 15 - Cache hits:
 > 251, fault: 16, adds: 0, success rate: 94%
 > 2007-07-16 22:10:12,546 http-8080-Processor15
 > INFO  webapp.ProcessorService  - /test-update - Received request
 > 2007-07-16 22:10:12,567 http-8080-Processor24
 > INFO  webapp.ProcessorService  - /test-update - Received request
 > 2007-07-16 22:10:12,584 http-8080-Processor24
 > INFO  webapp.ProcessorService  - /test-update - Timing: 17 - Cache hits:
 > 251, fault: 16, adds: 0, success rate: 94%
 > 2007-07-16 22:10:12,596 http-8080-Processor15 INFO
 > webapp.ProcessorService  - /test-update - Timing: 50 - Cache hits: 251,
 > fault: 16, adds: 0, success rate: 94%
 > 2007-07-16 22:10:12,598 http-8080-Processor17
 > INFO  webapp.ProcessorService  - /test-update - Received request
 > 2007-07-16 22:10:12,619 http-8080-Processor15
 > INFO  webapp.ProcessorService  - /test-update - Received request
 > 2007-07-16 22:10:12,632 http-8080-Processor17
 > INFO  webapp.ProcessorService  - /test-update - Timing: 33 - Cache hits:
 > 251, fault: 16, adds: 0, success rate: 94%
 > 2007-07-16 22:10:12,641 http-8080-Processor13
 > INFO  webapp.ProcessorService  - /test-update - Received request
 > 2007-07-16 22:10:12,660 http-8080-Processor13
 > INFO  webapp.ProcessorService  - /test-update - Timing: 19 - Cache hits:
 > 251, fault: 16, adds: 0, success rate: 94%
 > 2007-07-16 22:10:12,667 http-8080-Processor15
 > INFO  webapp.ProcessorService  - /test-update - Timing: 48 - Cache hits:
 > 251, fault: 16, adds: 0, success rate: 94%
 > 2007-07-16 22:10:12,672 http-8080-Processor19 INFO
 > webapp.ProcessorService  - /test-update - Received request
 > 2007-07-16 22:10:12,682 http-8080-Processor19
 > INFO  webapp.ProcessorService  - /test-update - Timing: 10 - Cache hits:
 > 251, fault: 16, adds: 0, success rate: 94%
 > 2007-07-16 22:10:12,690 http-8080-Processor15
 > INFO  webapp.ProcessorService  - /test-update - Received request
 > 2007-07-16 22:10:12,699 http-8080-Processor15
 > INFO  webapp.ProcessorService  - /test-update - Timing: 9 - Cache hits:
 > 251, fault: 16, adds: 0, success rate: 94%
 > 2007-07-16 22:10:12,717 http-8080-Processor24
 > INFO  webapp.ProcessorService  - /test-update - Received request
 > ...
 >
 > Infinite loop.
 >
 > Now, I'm not sure if this is a bug or a change in how the
 > xforms-value-changed gets fired, but this problem seems to have been
 > introduced some time between my last update (ab. 3-4 mnths ago) and
 > ops-3.6.0beta.200707131717.
 >
 > Has anyone else seen this problem? How can I get my form to save itself
 > (i.e. submit my instance to 'save.xpl') asynchronously whenever a user
 > changes a field value?
 >
 > There are 2 attachments to this email:
 > 1. A zip file containing a reproducible example
 > 2. An extra copy of the view (also found in the zip), for easy access
 >
 > Thanks!
 >
 > Sincerely,
 > Henrik Pettersen
 >


--
Orbeon Forms - Web Forms for the Enterprise Done the Right Way
http://www.orbeon.com/




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Problem with xforms-value-changed, incremental="true" and replace="instance"

Henrik Pettersen
Erik,

thank you for your feedback. I had a feeling this was a FNAB (Feature, Not A Bug)...

Your workaround seems very reasonable and should work. I'll be sure to report back with how I get on.

Thanks again!

Henrik

On 7/17/07, Erik Bruchez <[hidden email]> wrote:
Henrik,

This is related to the whole question of what to do with UI events in
case of instance replacement. This question is pending in the XForms
Working Group at the moment. It also touches on the bigger issue of UI
events in general, which we at Orbeon think is broken in the current
XForms spec.

Now, in Orbeon Forms, and awaiting a better solution, we chose the
option of sending xforms-value-changed events for all controls bound
to an instance which has been replaced. We picked this over the
alternative of never sending those events.

This was implemented quite a while ago, but then got broken. We then
fixed it again. This explains why your application did not exhibit
this behavior at some point.

Unfortunately, this means that until a better implementation of UI
events is available, you will have to use a workaround. What about:

* Set flag before sending submission with instance replacement
* Clear flag upon xforms-submit-done AND xforms-submit-error
* Protect the event handler with an "if" condition, something like:

   <xforms:action ev:event="xforms-value-changed"
                  if="/my/submission/flag = 'false'">

-Erik

Henrik Pettersen wrote:
> Hi,
>
> I'm having some problem with infinite loops with the attached source
> code. Here is my current system configuration:
>
> OS:                             Ubuntu Linux Feisty Fawn
> Application Server:    apache-tomcat-5.5.23
> Browser:                     Mozilla Firefox 2.0.0.4 <http://2.0.0.4>
> Java:                           1.5.0_12-b04
> Orbeon:                      ops-3.6.0beta.200707131717
>
> Here is the log outputs from what is happening:
> ...
> 2007-07-16 22:10:12,469 http-8080-Processor15
> INFO   webapp.ProcessorService  - /test-update - Timing: 10 - Cache hits:
> 251, fault: 16, adds: 0, success rate: 94%
> 2007-07-16 22:10:12,477 http-8080-Processor17 INFO
> webapp.ProcessorService  - /test-update - Received request
> 2007-07-16 22:10:12,485 http-8080-Processor24
> INFO  webapp.ProcessorService  - /test-update - Timing: 55 - Cache hits:
> 251, fault: 16, adds: 0, success rate: 94%
> 2007-07-16 22:10:12,489 http-8080-Processor17
> INFO  webapp.ProcessorService  - /test-update - Timing: 13 - Cache hits:
> 251, fault: 16, adds: 0, success rate: 94%
> 2007-07-16 22:10:12,497 http-8080-Processor13 INFO
> webapp.ProcessorService   - /test-update - Received request
> 2007-07-16 22:10:12,514 http-8080-Processor13
> INFO  webapp.ProcessorService  - /test-update - Timing: 17 - Cache hits:
> 251, fault: 16, adds: 0, success rate: 94%
> 2007-07-16 22:10:12,522 http-8080-Processor19
> INFO  webapp.ProcessorService  - /test-update - Received request
> 2007-07-16 22:10:12,537 http-8080-Processor19
> INFO  webapp.ProcessorService   - /test-update - Timing: 15 - Cache hits:
> 251, fault: 16, adds: 0, success rate: 94%
> 2007-07-16 22:10:12,546 http-8080-Processor15
> INFO  webapp.ProcessorService  - /test-update - Received request
> 2007-07-16 22:10:12,567 http-8080-Processor24
> INFO  webapp.ProcessorService  - /test-update - Received request
> 2007-07-16 22:10:12,584 http-8080-Processor24
> INFO  webapp.ProcessorService   - /test-update - Timing: 17 - Cache hits:
> 251, fault: 16, adds: 0, success rate: 94%
> 2007-07-16 22:10:12,596 http-8080-Processor15 INFO
> webapp.ProcessorService  - /test-update - Timing: 50 - Cache hits: 251,
> fault: 16, adds: 0, success rate: 94%
> 2007-07-16 22:10:12,598 http-8080-Processor17
> INFO  webapp.ProcessorService  - /test-update - Received request
> 2007-07-16 22:10:12,619 http-8080-Processor15
> INFO  webapp.ProcessorService  - /test-update - Received request
> 2007-07-16 22:10:12,632 http-8080-Processor17
> INFO  webapp.ProcessorService  - /test-update - Timing: 33 - Cache hits:
> 251, fault: 16, adds: 0, success rate: 94%
> 2007-07-16 22:10:12,641 http-8080-Processor13
> INFO  webapp.ProcessorService  - /test-update - Received request
> 2007-07-16 22:10:12,660 http-8080-Processor13
> INFO  webapp.ProcessorService   - /test-update - Timing: 19 - Cache hits:
> 251, fault: 16, adds: 0, success rate: 94%
> 2007-07-16 22:10:12,667 http-8080-Processor15
> INFO  webapp.ProcessorService  - /test-update - Timing: 48 - Cache hits:
> 251, fault: 16, adds: 0, success rate: 94%
> 2007-07-16 22:10:12,672 http-8080-Processor19 INFO
> webapp.ProcessorService  - /test-update - Received request
> 2007-07-16 22:10:12,682 http-8080-Processor19
> INFO  webapp.ProcessorService  - /test-update - Timing: 10 - Cache hits:
> 251, fault: 16, adds: 0, success rate: 94%
> 2007-07-16 22:10:12,690 http-8080-Processor15
> INFO  webapp.ProcessorService   - /test-update - Received request
> 2007-07-16 22:10:12,699 http-8080-Processor15
> INFO  webapp.ProcessorService  - /test-update - Timing: 9 - Cache hits:
> 251, fault: 16, adds: 0, success rate: 94%
> 2007-07-16 22:10:12,717 http-8080-Processor24
> INFO  webapp.ProcessorService  - /test-update - Received request
> ...
>
> Infinite loop.
>
> Now, I'm not sure if this is a bug or a change in how the
> xforms-value-changed gets fired, but this problem seems to have been
> introduced some time between my last update (ab. 3-4 mnths ago) and
> ops-3.6.0beta.200707131717.
>
> Has anyone else seen this problem? How can I get my form to save itself
> (i.e. submit my instance to 'save.xpl') asynchronously whenever a user
> changes a field value?
>
> There are 2 attachments to this email:
> 1. A zip file containing a reproducible example
> 2. An extra copy of the view (also found in the zip), for easy access
>
> Thanks!
>
> Sincerely,
> Henrik Pettersen
>


--
Orbeon Forms - Web Forms for the Enterprise Done the Right Way
http://www.orbeon.com/




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws


div


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws