Multiple Request Handling by BaseX

Monday, 8 March 2010 · 6 messages · last reply 9 Mar 2010
SS
Swaminathan S8 Mar 2010 09:18 #
Hi, Suppose BaseX receives several requests(updates/queries) (on same or different xml) almost simultaneously, how will BaseX handle this? I mean does BaseX queue all requests and process one by one or the application querying BaseX needs to ensure that a second request does not reach BaseX till the first request is completed by BaseX? Since I am working on an application that handles operations for multiple xmls parallely, I need to design the concurrency aspect. Thanks and regards, Swaminathan S
AW
Andreas Weiler8 Mar 2010 12:05 #
Hi Swaminathan, BaseX is handling requests as multiple reader and single writers. All update queries will be queued and then processed one by one (doesnt mather on same or different xml). Read queries will be processed simultaneous.
Quoted text · Swaminathan S · 1 line
> I need to design the concurrency aspect.
We would be pleased about your results. Kind regards, Andreas (BaseX Team)
Quoted text · Swaminathan S · 22 lines
Swaminathan S schrieb: > Hi, > > Suppose BaseX receives several requests(updates/queries) (on same or > different xml) almost simultaneously, how will BaseX handle this? I > mean does BaseX queue all requests and process one by one or the > application querying BaseX needs to ensure that a second request does > not reach BaseX till the first request is completed by BaseX? > > Since I am working on an application that handles operations for > multiple xmls parallely, I need to design the concurrency aspect. > > Thanks and regards, > > Swaminathan S > ------------------------------------------------------------------------ > > _______________________________________________ > BaseX-Talk mailing list > BaseX-Talk at mailman.uni-konstanz.de > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk >
SS
Swaminathan S8 Mar 2010 15:50 #
Hi Andreas, Please find attached a test program (Please substitute the xml file and xquery- I had used my application data which is about 1.5MB xml file and it is confidential). I got a BaseX error (attached) while doing both reads and writes parallely. But, It worked fine when I did reads only parallely or writes only parallely. Thanks and regards, Swaminathan S
Quoted text · Andreas Weiler · 42 lines
On Mon, Mar 8, 2010 at 4:35 PM, Andreas Weiler < andreas.weiler at uni-konstanz.de> wrote: > Hi Swaminathan, > > BaseX is handling requests as multiple reader and single writers. All > update queries will be queued and then processed one by one (doesnt mather > on same or different xml). > Read queries will be processed simultaneous. > > I need to design the concurrency aspect. >> > We would be pleased about your results. > > Kind regards, > Andreas (BaseX Team) > > Swaminathan S schrieb: > >> Hi, >> >> Suppose BaseX receives several requests(updates/queries) (on same or >> different xml) almost simultaneously, how will BaseX handle this? I mean >> does BaseX queue all requests and process one by one or the application >> querying BaseX needs to ensure that a second request does not reach BaseX >> till the first request is completed by BaseX? >> >> Since I am working on an application that handles operations for multiple >> xmls parallely, I need to design the concurrency aspect. >> >> Thanks and regards, >> >> Swaminathan S >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> BaseX-Talk mailing list >> BaseX-Talk at mailman.uni-konstanz.de >> https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk >> >> > >
AW
Andreas Weiler8 Mar 2010 16:11 #
Hi Swaminathan, as i see, you are not using the server. Multiple request handling is only supported by the server-client architecture. You should try it like in this example: http://www.inf.uni-konstanz.de/dbis/basex/code.php?code=ServerConcurrencyExample Kind regards, Andreas
Quoted text · Swaminathan S · 65 lines
Swaminathan S schrieb: > Hi Andreas, > > Please find attached a test program (Please substitute the xml file > and xquery- I had used my application data which is about 1.5MB xml > file and it is confidential). > > I got a BaseX error (attached) while doing both reads and writes > parallely. But, It worked fine when I did reads only parallely or > writes only parallely. > > > Thanks and regards, > > Swaminathan S > > > > On Mon, Mar 8, 2010 at 4:35 PM, Andreas Weiler > <andreas.weiler at uni-konstanz.de > <mailto:andreas.weiler at uni-konstanz.de>> wrote: > > Hi Swaminathan, > > BaseX is handling requests as multiple reader and single writers. > All update queries will be queued and then processed one by one > (doesnt mather on same or different xml). > Read queries will be processed simultaneous. > > I need to design the concurrency aspect. > > We would be pleased about your results. > > Kind regards, > Andreas (BaseX Team) > > Swaminathan S schrieb: > > Hi, > > Suppose BaseX receives several requests(updates/queries) (on > same or different xml) almost simultaneously, how will BaseX > handle this? I mean does BaseX queue all requests and process > one by one or the application querying BaseX needs to ensure > that a second request does not reach BaseX till the first > request is completed by BaseX? > > Since I am working on an application that handles operations > for multiple xmls parallely, I need to design the concurrency > aspect. > > Thanks and regards, > > Swaminathan S > ------------------------------------------------------------------------ > > _______________________________________________ > BaseX-Talk mailing list > BaseX-Talk at mailman.uni-konstanz.de > <mailto:BaseX-Talk at mailman.uni-konstanz.de> > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk > > > >
SS
Swaminathan Sin reply to Andreas Weiler, 8 Mar 2010, 12:059 Mar 2010 10:22 #
Hi Andreas, You said: "All update queries will be queued and then processed one by one (doesnt mather on same or different xml)." Ideally, update queries on different xmls should be designed to run parallely? One of the reason I ask this is: Suppose I do not use server-client architecture(I use BaseX classes directly) and I introduce concurrency controls myself, should I expect any problems if I do concurrent writes on different XML? Thanks, Swaminathan Sahiram
Quoted text · Andreas Weiler · 17 lines
On Mon, Mar 8, 2010 at 4:35 PM, Andreas Weiler < andreas.weiler at uni-konstanz.de> wrote: > Hi Swaminathan, > > BaseX is handling requests as multiple reader and single writers. All > update queries will be queued and then processed one by one (doesnt mather > on same or different xml). > Read queries will be processed simultaneous. > > I need to design the concurrency aspect. >> > We would be pleased about your results. > > Kind regards, > Andreas (BaseX Team) > >
AW
Andreas Weiler9 Mar 2010 12:23 #
Hi Swaminathan, in XQuery Update you can define and use a large number of xml's in an update, so it's pretty hard to define a good concurrency control which keeps up the good speed of BaseX and secures the queries too. So we decided to implement it as single writer. Maybe it will be enhanced to multiple writers in future releases. If you create your own concurrency controls, there shouldnt be any problems with updating different XMLs. Kind regards, Andreas
Quoted text · Swaminathan S · 35 lines
Swaminathan S schrieb: > Hi Andreas, > > You said: "All update queries will be queued and then processed one > by one (doesnt mather on same or different xml)." > Ideally, update queries on different xmls should be designed to run > parallely? One of the reason I ask this is: Suppose I do not use > server-client architecture(I use BaseX classes directly) and I > introduce concurrency controls myself, should I expect any problems if > I do concurrent writes on different XML? > > Thanks, > > Swaminathan Sahiram > > > On Mon, Mar 8, 2010 at 4:35 PM, Andreas Weiler > <andreas.weiler at uni-konstanz.de > <mailto:andreas.weiler at uni-konstanz.de>> wrote: > > Hi Swaminathan, > > BaseX is handling requests as multiple reader and single writers. > All update queries will be queued and then processed one by one > (doesnt mather on same or different xml). > Read queries will be processed simultaneous. > > I need to design the concurrency aspect. > > We would be pleased about your results. > > Kind regards, > Andreas (BaseX Team) > >

⚡Generated with XQuery