Bug 38450 - problems with create and edit in less than a second
Summary: problems with create and edit in less than a second
Status: NEW
Alias: None
Product: Lenya
Classification: Unclassified
Component: Miscellaneous (show other bugs)
Version: 1.2.5
Hardware: Other other
: P2 normal
Target Milestone: 1.2.6
Assignee: Lenya Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-30 16:35 UTC by Simon Litwan
Modified: 2007-04-23 02:33 UTC (History)
0 users



Attachments
workaround fot this bug (1.27 KB, patch)
2006-01-31 14:05 UTC, Simon Litwan
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Litwan 2006-01-30 16:35:43 UTC
if you create a document it gets its lastmodified entry. now if you call
for editing in the same second as it was created the last modified entry
won't get updated because the lastmodified entry just uses seconds and
not milliseconds. so for the cache the the fresh created document is
still the one with the newest lastmodified entry so the cache won't look
for some changes and delivers the outdated document.

a possible way to get around this would be to add

Packages.java.lang.Thread.currentThread().sleep(1000);

in the editDocument function of edit-document.js.

does anyone have a better idea?


cache           |     new    |     |    still    |      |   still   |   
                |   doc 000  |--¬  |   doc 000   |      |  doc 000  |
----------------------------------------------------------------------   
timeline 000    |     010    |   | |     020     |      |   030     |
----------------------------------------------------------------------
action           create new doc  | request for edit       save doc
                                 |
                                 |
                                 |
                                 |
                                 ------------------------ 
                                                         |
                                                         V            
                                               request some time later.
Comment 1 Simon Litwan 2006-01-31 14:05:58 UTC
Created attachment 17547 [details]
workaround fot this bug

waits before saving the doc untill it's in the next second.
Comment 2 Josias Thoeny 2006-02-01 09:36:39 UTC
Thanks for the patch.
I have one question: the patch uses "active waiting", that means the cpu load
will be high during the waiting period. Is there nothing like sleep() in flowscript?
(Maybe an easier workaround would be to wait 1 second in your test before you
click the save button.)
Comment 3 Andreas Hartmann 2006-02-01 09:43:46 UTC
(In reply to comment #2)
> Thanks for the patch.
> I have one question: the patch uses "active waiting", that means the cpu load
> will be high during the waiting period. Is there nothing like sleep() in
flowscript?

I guess you can just create an object and invoke sleep() on it ...

> (Maybe an easier workaround would be to wait 1 second in your test before you
> click the save button.)
 
+1, since the patch is also just a workaround.