Many XML with the same path

Thursday, 7 June 2012 · 7 messages · last reply 21 Jun 2012
CG
Christian Grünin reply to Henrique Oliveira, 7 Jun 2012, 03:377 Jun 2012 01:43 #
Quoted text · Henrique Oliveira · 1 line
> Why am I able to add/store several XML with the same path?
The REPLACE command [1,2] will remove existing versions of a document. Christian [1] http://docs.basex.org/wiki/Commands#REPLACE [2] http://docs.basex.org/wiki/Database_Module#db:replace
HO
Henrique Oliveira7 Jun 2012 03:37 #
Hi guys, Why am I able to add/store several XML with the same path?
<rest:database xmlns:rest="http://basex.org/rest" name="TRADES" resources="9
">
<rest:resource type="xml" content-type="application/xml" size="3">
henrique.xml</rest:resource>
<rest:resource type="xml" content-type="application/xml" size="3">
henrique.xml</rest:resource>
<rest:resource type="xml" content-type="application/xml" size="3">
henrique.xml</rest:resource>
<rest:resource type="xml" content-type="application/xml" size="3">
henrique.xml</rest:resource>
<rest:resource type="xml" content-type="application/xml" size="3">
henrique.xml</rest:resource>
<rest:resource type="xml" content-type="application/xml" size="3">
henrique1.xml</rest:resource>
<rest:resource type="xml" content-type="application/xml" size="3">
henrique2.xml</rest:resource>
<rest:resource type="raw" content-type="application/xml" size="21">
henrique2.xml</rest:resource>
<rest:resource type="raw" content-type="application/xml" size="21">
henrique3.xml</rest:resource>
</rest:database>
-- Henrique Oliveira
CG
Christian Grünin reply to Henrique Oliveira, 20 Jun 2012, 21:4220 Jun 2012 19:48 #
Quoted text · Henrique Oliveira · 3 lines
> Shouldn't have a 'constraint' to avoid replacing a file? > so if the path exists you can use REPLACE but not > ADD or STORE cmd
I'm sorry I'm not sure what you want to know. Could you give more details? Christian
CG
Christian Grünin reply to Henrique Oliveira, 20 Jun 2012, 21:5520 Jun 2012 20:12 #
Quoted text · Henrique Oliveira · 1 line
> Shouldn't be BaseX block it?
You mean that BaseX should not allow adding multiple resources with the same path? There is indeed one open GitHub issue for that: https://github.com/BaseXdb/basex/issues/429 One advantage of the current solution is that new documents can be added extremely fast – exactly because of the missing duplicate check. The main challenge of resolving issue 429 will be to ensure that performance won't suffer too much.
HO
Henrique Oliveirain reply to Christian Grün, 7 Jun 2012, 01:4320 Jun 2012 21:42 #
Shouldn't have a 'constraint' to avoid replacing a file? so if the path exists you can use REPLACE but not ADD or STORE cmd 2012/6/6 Christian Grün <christian.gruen at gmail.com>
Quoted text · Christian Grün · 8 lines
> > Why am I able to add/store several XML with the same path? > > The REPLACE command [1,2] will remove existing versions of a document. > Christian > > [1] http://docs.basex.org/wiki/Commands#REPLACE > [2] http://docs.basex.org/wiki/Database_Module#db:replace >
-- Henrique Oliveira
HO
Henrique Oliveirain reply to Christian Grün, 20 Jun 2012, 19:4820 Jun 2012 21:55 #
Why am I able to add/store several XML with the same path?
<rest:database xmlns:rest="http://basex.org/rest" name="TRADES" resources="9
">
<rest:resource type="xml" content-type="application/xml" size="3">
henrique.xml</rest:resource>
<rest:resource type="xml" content-type="application/xml" size="3">
henrique.xml</rest:resource>
<rest:resource type="xml" content-type="application/xml" size="3">
henrique.xml</rest:resource>
<rest:resource type="xml" content-type="application/xml" size="3">
henrique.xml</rest:resource>
<rest:resource type="xml" content-type="application/xml" size="3">
henrique.xml</rest:resource>
<rest:resource type="xml" content-type="application/xml" size="3">
henrique1.xml</rest:resource>
<rest:resource type="xml" content-type="application/xml" size="3">
henrique2.xml</rest:resource>
<rest:resource type="raw" content-type="application/xml" size="21">
henrique2.xml</rest:resource>
<rest:resource type="raw" content-type="application/xml" size="21">
henrique3.xml</rest:resource>
</rest:database>
Shouldn't be BaseX block it? 2012/6/20 Christian Grün <christian.gruen at gmail.com>
Quoted text · Christian Grün · 7 lines
> > Shouldn't have a 'constraint' to avoid replacing a file? > > so if the path exists you can use REPLACE but not > > ADD or STORE cmd > > I'm sorry I'm not sure what you want to know. Could you give more details? > Christian >
-- Henrique Oliveira
HO
Henrique Oliveirain reply to Christian Grün, 20 Jun 2012, 20:1221 Jun 2012 04:23 #
In my opinion it is a critical issue.. should have a way to avoid this.. Regards 2012/6/20 Christian Grün <christian.gruen at gmail.com>
Quoted text · Christian Grün · 12 lines
> > Shouldn't be BaseX block it? > > You mean that BaseX should not allow adding multiple resources with > the same path? There is indeed one open GitHub issue for that: > > https://github.com/BaseXdb/basex/issues/429 > > One advantage of the current solution is that new documents can be > added extremely fast – exactly because of the missing duplicate check. > The main challenge of resolving issue 429 will be to ensure that > performance won't suffer too much. >
-- Henrique Oliveira

⚡Generated with XQuery