[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Antw: Strange Problem submitting data to WO [5.2.5, W2K]
- Subject: Antw: Strange Problem submitting data to WO [5.2.5, W2K]
- From: COAST at cedes.com (COAST)
- Date: Mon Aug 14 02:31:38 2006
Hi list
thanks for your answers. No we debugged a little bit further on.
What we can say now, is that the submit story is working properly!
But it seems, that the EditingContext does not recognize that the object
has really changed! And therefore the EditingContext won't do any savings !!
Still I have to tell:
1. This happens only from time to time (let's say once per 20 or 30 tries,
otherwise it's working properly).
2. TILL NOW we have seen this behaviour only running the app via direct connect (developing)
(but there is very bad feeling about the deployment...!!!!)
3. It's not a problem of a different EditingContext (see also below)
Here what we debugged:
Lets try to change the value int the from from 2 to 8
*****************************************************
awake
=====
selectedObject.vat() : 2.0000
selectedObject.vat_oldValue() : 2.0000
selectedObject.vat_hasChanged(): false
ec.updatedObjects().count() : 0
ec.hasChanged() : false
Analysis: everything as expected.
takeValuesFromRequest:
======================
ec : XTEditingContext@18eb7b8
selectedObject.editingContext(): XTEditingContext@18eb7b8
selectedObject.vat() : 8.0000
selectedObject.vat_oldValue() : 2.0000
selectedObject.vat_hasChanged(): false
ec.updatedObjects().count() : 0
ec.hasChanged() : false
Analysis:
The value has changed, but the ec / object does not know it !?!?!?
This happens from time to time ?!?!?!?!? (Our actual problem)
(If everything is working:
selectedObject.vat_hasChanged(): true
ec.updatedObjects().count() : 1
ec.hasChanged() : true)
save action:
============
selectedObject.vat() : 8.0000
selectedObject.vat_oldValue() : 2.0000
selectedObject.vat_hasChanged(): false
ec.updatedObjects().count() : 0
ec.hasChanged() : false
ec : XTEditingContext@18eb7b8
selectedObject.editingContext(): XTEditingContext@18eb7b8
ec.saveChanges();
Analysis:
The ec thinks, there is no change, therefore the ec won't save (of course).
selectedObject.vat() : 8.0000
selectedObject.vat_oldValue() : 2.0000
selectedObject.vat_hasChanged(): false
ec.updatedObjects().count() : 0
ec.hasChanged() : false
ec.refaultObjects();
Analysis:
The ec thinks there is no change, the ec reloads the old value (of course).
selectedObject.vat() : 2.0000
selectedObject.vat_oldValue() : 2.0000
selectedObject.vat_hasChanged(): false
ec.updatedObjects().count() : 0
ec.hasChanged() : false
Here are the methods used to debug:
public boolean vat_hasChanged() {
if (editingContext().hasChanges() == false) {
//we can believe that
return false;
}
//but we can't believe true, let's check for ourself.
boolean hasChanges = false;
if (editingContext().insertedObjects().count() != 0 || editingContext().deletedObjects().count() != 0) {
hasChanges = true;
}
else if (editingContext().updatedObjects().count() != 0) {
if (changesFromSnapshot(editingContext().committedSnapshotForObject(this)).count() != 0) {
if (changesFromSnapshot(editingContext().committedSnapshotForObject(this)).objectForKey("vat") == NullValue) {
if (vat_old() == null) {
hasChanges = false;
}
else {
hasChanges = true;
}
}
else {
BigDecimal changedValue = (BigDecimal)changesFromSnapshot(editingContext().committedSnapshotForObject(this)).objectForKey("vat");
if (changedValue != null) {
if (vat_old() == null) {
hasChanges = true;
}
else {
if (changedValue.compareTo(vat_old()) == 0) {
hasChanges = false;
}
else {
hasChanges = true;
}
}
}
else {
hasChanges = false;
}
}
}
}
return hasChanges;
}
public BigDecimal vat_old() {
if (editingContext().committedSnapshotForObject(this).objectForKey("vat") == NullValue) {
return null;
}
else {
return (BigDecimal)editingContext().committedSnapshotForObject(this).objectForKey("vat");
}
}
>>> "COAST" <COAST@xxxxxxxxx> 08.08.2006 13:25:11 >>>
Hi list
we have a strange problem submitting data to the WO app.
Filling in a form with changes, the changes sometimes are not submitted to WO.
The "sometimes" is the big problem.
You can do about 20 changes everything is working, then suddenly
the form seems not to be submitted to the server. The next time: Everything is o.k.
We checked different things like "multiple submit = yes", the submit button placed
on the form for sure etc.
We have to say that this strange behaviour seems to occur only if doing a direct conntect
to the app (developing) . We have not seen the problem via the Web Server IIS (deployment).
But we have a really bad feeling about this...
We debuged the story by printing the following in takesValueFromRequest
(just after super):
ec.updatedObjects().count()
if everything is o.k. count = 1 (one object has changed)
if it goes wrong count = 0 (which is telling that no changes have been submitted ?!)
What could be the problem ?
Where to go further on with debuging ?
Is it really only a problem with direct connect ?
Thanks
Peter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: /mailman/archive/webobjects-dev/attachments/20060814/c2832002/attachment.html