Hi,
the problem is that you call the session2.close() method before all items are printed out in the for loop in the notify method of the notifier. This closes the session2 before all items from the event are received.
Just implement a mechanism, which is waiting for all items of the event before closing the session.
-- Andreas
Am 23.02.2012 um 11:52 schrieb Dimitar Popov:
Hi,
The problem is that the event listener in ClientSession does not buffer the input from the server correctly, i.e. asynchronously.
Anyway, if you implement a simple producer-consumer pattern[1] in your code, you should get correct results. But, of course, this should be implemented by the ClientSession and not by you.
Dimitar
[1] http://en.wikipedia.org/wiki/Producer-consumer_problem
Am Donnerstag, den 23.02.2012, 10:18 +0100 schrieb truc.cam@emotive.de:
Dear BaseX team, I'd like to ask you why my class not run properly. I'm using EVENT to notify changes from xquery. It must print numbers from 1 to 10, 50 times for each number. Why does it skip some numbers in a random manner? How can I do to correct it? Please see my attachment. Thanks in advance. _______________________________________________ BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk