Q.: safety/concurrent access to BaseX database

Tuesday, 17 August 2010 · 7 messages · last reply 18 Aug 2010
GB
Godmar Back17 Aug 2010 18:27 #
Hi, I just wanted to confirm some assumptions about the safety of accessing a single BaseX instance from multiple JVMs, or from multiple org.basex.api.xqj.BXQDataSource class instances loaded by different class loaders in the same VM. Am I correct that it is safe to access the same database via XQJ in such situations? By "safety," I mean that a) the database protects its internal data structures in the face of such concurrency and b) there is a serializable schedule of individual XQJ executions that produces the final database state. Is this true? Please note that I'm not asking for transactions across multiple XQJ executions here. - Godmar
CG
Christian Grün17 Aug 2010 23:06 #
Hi Godmar,
Quoted text · Godmar Back · 4 lines
> I just wanted to confirm some assumptions about the safety of accessing a > single BaseX instance from multiple JVMs, or from multiple > org.basex.api.xqj.BXQDataSource class instances loaded by different class > loaders in the same VM.
All read-only operations are safe and can be run via multiple JVMs and threads. Christian
Quoted text · Godmar Back · 17 lines
> Am I correct that it is safe to access the same database via XQJ in such > situations? > By "safety," I mean that > a) the database protects its internal data structures in the face of such > concurrency and > b) there is a serializable schedule of individual XQJ executions that > produces the final database state. > Is this true? > Please note that I'm not asking for transactions across multiple XQJ > executions here. > - Godmar > _______________________________________________ > BaseX-Talk mailing list > BaseX-Talk at mailman.uni-konstanz.de > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk > >
CG
Christian Grünin reply to Godmar Back, 18 Aug 2010, 01:5618 Aug 2010 00:15 #
If you want to perform updates, you won't get happy using XQJ. You'll need to switch to our own API for that, or have (quite) some patience until this will be on our todo list. Christian
Quoted text · Godmar Back · 25 lines
On Tue, Aug 17, 2010 at 11:57 PM, Godmar Back <godmar at gmail.com> wrote: > On Tue, Aug 17, 2010 at 5:06 PM, Christian Grün <christian.gruen at gmail.com> > wrote: >> >> Hi Godmar, >> >> > I just wanted to confirm some assumptions about the safety of accessing >> > a >> > single BaseX instance from multiple JVMs, or from multiple >> > org.basex.api.xqj.BXQDataSource class instances loaded by different >> > class >> > loaders in the same VM. >> >> All read-only operations are safe and can be run via multiple JVMs and >> threads. >> > > What's the safety and semantics of modifying XQuery update operations? > > What's the safety and semantics of multiple read-only operations in the > presence of a single instance that performs modifying updates? > > - Godmar > >
CG
Christian Grünin reply to Godmar Back, 18 Aug 2010, 02:2318 Aug 2010 00:32 #
Quoted text · Godmar Back · 3 lines
> In particular, I'm wondering if multiple concurrent updates are unsafe (that > is, lead to internal inconsistencies in BaseX that prevent further use of > the database)
dito.
Quoted text · Godmar Back · 2 lines
> What does 'this' in your sentence refer to? Safety? Serializability? > Transactions?
it simply means we have no free resources to put more effort on XQJ update issues. sorry. christian
GB
Godmar Backin reply to Christian Grün, 17 Aug 2010, 23:0618 Aug 2010 01:56 #
On Tue, Aug 17, 2010 at 5:06 PM, Christian Grün <christian.gruen at gmail.com>wrote:
Quoted text · Christian Grün · 11 lines
> Hi Godmar, > > > I just wanted to confirm some assumptions about the safety of accessing a > > single BaseX instance from multiple JVMs, or from multiple > > org.basex.api.xqj.BXQDataSource class instances loaded by different class > > loaders in the same VM. > > All read-only operations are safe and can be run via multiple JVMs and > threads. > >
What's the safety and semantics of modifying XQuery update operations? What's the safety and semantics of multiple read-only operations in the presence of a single instance that performs modifying updates? - Godmar
GB
Godmar Backin reply to Christian Grün, 18 Aug 2010, 00:1518 Aug 2010 02:23 #
On Tue, Aug 17, 2010 at 6:15 PM, Christian Grün <christian.gruen at gmail.com>wrote:
Quoted text · Christian Grün · 2 lines
> If you want to perform updates, you won't get happy using XQJ. >
Could you elaborate? In particular, I'm wondering if multiple concurrent updates are unsafe (that is, lead to internal inconsistencies in BaseX that prevent further use of the database) or merely lead to undefined results (that is, the resulting XML may not result from any serialization of the individual update requests).
Quoted text · Christian Grün · 4 lines
> You'll need to switch to our own API for that, or have (quite) > some patience until this will be on our todo list. > >
What does 'this' in your sentence refer to? Safety? Serializability? Transactions? - Godmar
GB
Godmar Backin reply to Christian Grün, 18 Aug 2010, 00:3218 Aug 2010 06:00 #
On Tue, Aug 17, 2010 at 6:32 PM, Christian Grün <christian.gruen at gmail.com>wrote:
Quoted text · Christian Grün · 14 lines
> > In particular, I'm wondering if multiple concurrent updates are unsafe > (that > > is, lead to internal inconsistencies in BaseX that prevent further use of > > the database) > > dito. > > > What does 'this' in your sentence refer to? Safety? Serializability? > > Transactions? > > it simply means we have no free resources to put more effort on XQJ > update issues. sorry. > >
I'm slow and I'm sorry I don't distinguish between XQJ, XQJ updates, and BaseX. Is it possible to use BaseX as a library and have multiple JVMs access and update the same database in a way that is safe? If so, how? As I've stated before, I would prefer a non-BaseX-specific way of interacting with it, such as XQJ, but if that's not possible because XQJ is in essence a standard never adopted and soon to be abandoned, then I'm also fine with any robust method that allows me to link my in-memory, org.w3c.dom* implementation-based model to the database. (I had sent out an email about this previously, with no resonance.) - Godmar

⚡Generated with XQuery