Ask about BaseX event for more than one context
Dear BaseX team, Please see the attachment. When I use events for 2 contexts, just the first one can notify.If the notification of the 2rd context happens, the result should be "1 2 3 4". If I replace "xquery2.execute(context2)" by "xquery2.execute(context1)", I will receive right result. But this is not what I want to do. Thanks in advance. Best regards
Hi truc, your method "GetContext" creates a new BaseX server on each call. Since you call it twice, you end up with 2 separate BaseX server instances. You should call the following code only once: Context context = new Context(); BaseXServer server = new BaseXServer(context); Then for each ClientSession, you can create a new context - it is not necessary (actually, it is not recommended) to use the server context in the client. You can also check the following articles in our wiki, if you already haven't: [1] and [2]. Regards, Dimitar [1] http://docs.basex.org/wiki/Events [2] http://docs.basex.org/wiki/Code_Examples On Mar 22, 2012, at 11:24 AM, truc.cam@emotive.de wrote:
Dear BaseX team, Please see the attachment. When I use events for 2 contexts, just the first one can notify.If the notification of the 2rd context happens, the result should be "1 2 3 4". If I replace "xquery2.execute(context2)" by "xquery2.execute(context1)", I will receive right result. But this is not what I want to do.
Thanks in advance.
Best regards <mainclass.java>_______________________________________________ BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
participants (2)
-
Dimitar Popov -
truc.cam@emotive.de