Adam Retter | 2 Oct 2005 19:00
Picon
Favicon

Added request:get-session-id()


I have added a quick function to the XQuery request namespace called
get-session-id().
It returns the ID of the current session or an empty sequence if there is no
session.

Others may need this also, but I needed this functionality specificaly so
that -

I have some XQuery's that generate HTML pages, behind a username and
password login box (members only area), the session is used to secure the
pages and keep details of the logged in user etc.
I have a Java Applet embedded in the HTML generated by one of those
XQuery's, the applet needs to do a HTTP request to eXist to call a members
only XQuery. To access the members only XQuery from the Java Applet I have
to send the JSESSIONID in the HTTP Request and so I need to know the session
id. I set this using a <param name="sessionid"
value="{request:get-session-id()}"/> in the HTML code generated by the
xquery to load the applet.

Thanks

Adam Retter

-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
Cédric Meier | 3 Oct 2005 15:40
Picon

XQuery with indexes performances

Hi all,

With the help of all your answers about my XQuery performances problems I started to search a way to accelerate my queries.

Trying eXist's indexes that specifiy types of elements (xs:string, xs:integer, etc.) (http://exist.sourceforge.net/indexing.html) I found something strange:

With the actual CVS version of eXist (last checkout: 2005-09-28) I've got worst results using indexes than without indexes. I know that my XQuery is not generic or typical but it's really strange that it's slower with indexes than without. So I ask you if you think there is not a small problem using such indexes...

I attached a PDF with my results and the test's descriptions.
In addition you can find a backup of my db here: http://www.ced-web.ch/db-xquery-indexes.zip
and I attached the XQuery and the xconf in this mail if someone is interested in testing too.

I can do further tests if you need more informations or more results.

Thanks for your help or comments!
Cédric Meier


Attachment (tests_xquery_indexes.pdf): application/acrobat, 93 KiB
Attachment (collection.xconf): text/xml, 640 bytes
Attachment (xquery_exemple.xq): text/xml, 1154 bytes
Wolfgang Meier | 3 Oct 2005 16:33
Picon

Re: XmlRpc > Permissions, Authentication?

> Permissions:
> No matter how I set the permissions of collections or xml documents (via
> the java client) any user accessing the database via xml rpc can do
> arbitrary modifications to collections or documnts.

This should not be possible if you pass the correct user credentials
on the client side. I'm quite sure that access control in eXist does
work and permissions are respected. The Java client also uses xmlrpc
for communication. For example, if you restrict read permissions to
the owner, all other users will get an exception.

So please re-check what credentials are passed in by your python code.
You should also set a password for the admin user. As long as no
password is set for admin, the other users can (mostly) do what they
want.

Wolfgang

-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
Øyvind Vestavik | 3 Oct 2005 14:09
Picon
Picon
Favicon

On migration from eXist-1.0b2-build-1107 to eXist-snapshot-20050805


Hi everybody

This is probably something stupid alltogether but I can't seem to migrate 
my data from eXist-1.0b2-build-1107 to eXist-snapshot-20050805

What I did was to move my the data dir out of the eXist-1.0b2-build-1107 
catalogue and install the eXist-snapshot-20050805 as recommended on the download page.
I modified the config.xml of the snapshot to read:

         <db-connection database="native" files="/home/oyvindve/Documents/forskningsrelatert/datagrunnlag/eXistData"
                 pageSize="4096" cacheSize="48M" free_mem_min="5">

The only change here to the "default"/original entry in config.xml should 
be the path to the data catalogue which holds the following files:

-rw-r--r--  1 root root  36K 2005-10-03 13:31 collections.dbx
-rw-r--r--  1 root root 743M 2005-10-03 13:31 dom.dbx
-rw-r--r--  1 root root 196M 2005-10-03 13:31 elements.dbx
-rw-r--r--  1 root root   69 2005-09-30 13:42 README
-rw-r--r--  1 root root 2.9K 2005-09-30 13:42 symbols.dbx
-rw-r--r--  1 root root 266M 2005-10-03 13:31 words.dbx

When I startup eXist-1.0b2-build-1107 (startup.sh and server.sh) this 
directory is read fine, but with eXist-snapshot-20050805 i get an 
ArrayOutOfBoundsException. I also get

03 Oct 2005 13:55:01,136 [main] DEBUG (NativeBroker.java [<init>]:246) - 
failed to initialize database: Error opening elements.dbx
org.exist.storage.btree.DBException: Error opening elements.dbx

Should it be possible to migrate the data, and if so, what do I have to 
migrate my data? I see the snapshot has additional files in its 
data directory.

I could reload the data in a batch, but that takes app. 6 
hours using xmlrpc with current memory settings.

The full readout of startup.sh is given below.

kind regards
Øyvind Vestavik

root <at> oyvindve1:/usr/local/eXist/eXist-snapshot-20050805/bin# ./startup.sh
Configuring eXist from /usr/local/eXist/eXist-snapshot-20050805/conf.xml
03 Oct 2005 14:03:31,751 [main] DEBUG (IndexSpec.java [read]:92) - Reading 
configuration ...
Loading catalog: 
/usr/local/eXist/eXist-snapshot-20050805/webapp/WEB-INF/catalog
03 Oct 2005 14:03:31,788 [main] INFO  (Configuration.java 
[configureBackend]:310) - data directory = 
/home/oyvindve/Documents/forskningsrelatert/datagrunnlag/eXistData
03 Oct 2005 14:03:31,790 [main] DEBUG (BrokerPool.java [configure]:116) - 
configuring database instance 'exist' ...
03 Oct 2005 14:03:31,799 [main] INFO  (BrokerPool.java [<init>]:323) - 
Max. wait during shutdown: 120000
03 Oct 2005 14:03:31,800 [main] INFO  (BrokerPool.java [<init>]:325) - 
Instances: min = 1; max = 20; sync = 120000
03 Oct 2005 14:03:31,810 [main] DEBUG (BrokerPool.java [initialize]:544) - 
initializing database exist
03 Oct 2005 14:03:31,815 [main] INFO  (CacheManager.java [<init>]:103) - 
Cache settings: totalPages: 12288; maxCacheSize: 9216
03 Oct 2005 14:03:31,823 [main] INFO  (XQueryPool.java [<init>]:93) - 
QueryPool: maxStackSize = 5; timeout = 120000; timeoutCheckInterval = 
30000
03 Oct 2005 14:03:31,853 [main] DEBUG (Journal.java [<init>]:140) - 
SyncOnCommit = false
03 Oct 2005 14:03:31,855 [main] DEBUG (Journal.java [<init>]:167) - Using 
directory for the journal: 
/usr/local/eXist/eXist-snapshot-20050805/webapp/WEB-INF/data
03 Oct 2005 14:03:31,951 [main] DEBUG (DBBroker.java [<init>]:166) - 
Loading symbol table from 
/home/oyvindve/Documents/forskningsrelatert/datagrunnlag/eXistData/symbols.dbx
03 Oct 2005 14:03:31,979 [main] DEBUG (DBBroker.java [<init>]:181) - 
fragmentation = 20
03 Oct 2005 14:03:32,026 [main] DEBUG (NativeBroker.java [<init>]:196) - 
Initializing broker 3916375
java.lang.ArrayIndexOutOfBoundsException: 4096
         at org.exist.util.ByteConversion.byteToInt(ByteConversion.java:36)
         at org.exist.storage.index.FreeList.read(FreeList.java:161)
         at org.exist.storage.index.BFile$BFileHeader.read(BFile.java:1480)
         at org.exist.storage.btree.Paged$FileHeader.read(Paged.java:653)
         at org.exist.storage.btree.Paged.open(Paged.java:308)
         at org.exist.storage.btree.BTree.open(BTree.java:173)
         at org.exist.storage.index.BFile.open(BFile.java:596)
         at org.exist.storage.index.BFile.<init>(BFile.java:151)
         at 
org.exist.storage.NativeBroker.createValueIndexFile(NativeBroker.java:298)
         at 
org.exist.storage.NativeBroker.createIndexFiles(NativeBroker.java:259)
         at org.exist.storage.NativeBroker.<init>(NativeBroker.java:211)
         at 
org.exist.storage.BrokerFactory.getInstance(BrokerFactory.java:34)
         at org.exist.storage.BrokerPool.createBroker(BrokerPool.java:437)
         at org.exist.storage.BrokerPool.initialize(BrokerPool.java:566)
         at org.exist.storage.BrokerPool.<init>(BrokerPool.java:330)
         at org.exist.storage.BrokerPool.configure(BrokerPool.java:117)
         at org.exist.storage.BrokerPool.configure(BrokerPool.java:95)
         at org.exist.JettyStart.run(JettyStart.java:71)
         at org.exist.JettyStart.main(JettyStart.java:45)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at org.exist.start.Main.invokeMain(Main.java:119)
         at org.exist.start.Main.run(Main.java:375)
         at org.exist.start.Main.main(Main.java:48)
         at org.exist.start.Main.main(Main.java:48)
03 Oct 2005 14:03:32,142 [main] DEBUG (NativeBroker.java [<init>]:246) - 
failed to initialize database: Error opening elements.dbx
org.exist.storage.btree.DBException: Error opening elements.dbx
         at org.exist.storage.btree.Paged.open(Paged.java:318)
         at org.exist.storage.btree.BTree.open(BTree.java:173)
         at org.exist.storage.index.BFile.open(BFile.java:596)
         at org.exist.storage.index.BFile.<init>(BFile.java:151)
         at 
org.exist.storage.NativeBroker.createValueIndexFile(NativeBroker.java:298)
         at 
org.exist.storage.NativeBroker.createIndexFiles(NativeBroker.java:259)
         at org.exist.storage.NativeBroker.<init>(NativeBroker.java:211)
         at 
org.exist.storage.BrokerFactory.getInstance(BrokerFactory.java:34)
         at org.exist.storage.BrokerPool.createBroker(BrokerPool.java:437)
         at org.exist.storage.BrokerPool.initialize(BrokerPool.java:566)
         at org.exist.storage.BrokerPool.<init>(BrokerPool.java:330)
         at org.exist.storage.BrokerPool.configure(BrokerPool.java:117)
         at org.exist.storage.BrokerPool.configure(BrokerPool.java:95)
         at org.exist.JettyStart.run(JettyStart.java:71)
         at org.exist.JettyStart.main(JettyStart.java:45)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at org.exist.start.Main.invokeMain(Main.java:119)
         at org.exist.start.Main.run(Main.java:375)
         at org.exist.start.Main.main(Main.java:48)
configuration error: org.exist.storage.btree.DBException: Error opening 
elements.dbx
org.exist.EXistException: org.exist.storage.btree.DBException: Error 
opening elements.dbx
         at org.exist.storage.NativeBroker.<init>(NativeBroker.java:247)
         at 
org.exist.storage.BrokerFactory.getInstance(BrokerFactory.java:34)
         at org.exist.storage.BrokerPool.createBroker(BrokerPool.java:437)
         at org.exist.storage.BrokerPool.initialize(BrokerPool.java:566)
         at org.exist.storage.BrokerPool.<init>(BrokerPool.java:330)
         at org.exist.storage.BrokerPool.configure(BrokerPool.java:117)
         at org.exist.storage.BrokerPool.configure(BrokerPool.java:95)
         at org.exist.JettyStart.run(JettyStart.java:71)
         at org.exist.JettyStart.main(JettyStart.java:45)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at org.exist.start.Main.invokeMain(Main.java:119)
         at org.exist.start.Main.run(Main.java:375)
         at org.exist.start.Main.main(Main.java:48)
Caused by: org.exist.storage.btree.DBException: Error opening elements.dbx
         at org.exist.storage.btree.Paged.open(Paged.java:318)
         at org.exist.storage.btree.BTree.open(BTree.java:173)
         at org.exist.storage.index.BFile.open(BFile.java:596)
         at org.exist.storage.index.BFile.<init>(BFile.java:151)
         at 
org.exist.storage.NativeBroker.createValueIndexFile(NativeBroker.java:298)
         at 
org.exist.storage.NativeBroker.createIndexFiles(NativeBroker.java:259)
         at org.exist.storage.NativeBroker.<init>(NativeBroker.java:211)
         ... 15 more
Pierrick Brihaye | 3 Oct 2005 17:12
Picon
Favicon

Re: On migration from eXist-1.0b2-build-1107 to eXist-snapshot-20050805

Hi,

Øyvind Vestavik wrote:

> This is probably something stupid alltogether but I can't seem to 
> migrate my data from eXist-1.0b2-build-1107 to eXist-snapshot-20050805
> 
> What I did was to move my the data dir out of the eXist-1.0b2-build-1107 
> catalogue and install the eXist-snapshot-20050805 as recommended on the 
> download page.
> I modified the config.xml of the snapshot to read:
> 
>         <db-connection database="native" 
> files="/home/oyvindve/Documents/forskningsrelatert/datagrunnlag/eXistData"
>                 pageSize="4096" cacheSize="48M" free_mem_min="5">
> 
> The only change here to the "default"/original entry in config.xml 
> should be the path to the data catalogue which holds the following files:
> 
> -rw-r--r--  1 root root  36K 2005-10-03 13:31 collections.dbx
> -rw-r--r--  1 root root 743M 2005-10-03 13:31 dom.dbx
> -rw-r--r--  1 root root 196M 2005-10-03 13:31 elements.dbx
> -rw-r--r--  1 root root   69 2005-09-30 13:42 README
> -rw-r--r--  1 root root 2.9K 2005-09-30 13:42 symbols.dbx
> -rw-r--r--  1 root root 266M 2005-10-03 13:31 words.dbx
> 
> When I startup eXist-1.0b2-build-1107 (startup.sh and server.sh) this 
> directory is read fine, but with eXist-snapshot-20050805 i get an 
> ArrayOutOfBoundsException.

When the internal binary format changes, you need to backup then restore 
your data.

See http://exist.sourceforge.net/client.html#N10318
or use the interactiveClient

Cheers,

--

-- 
Pierrick Brihaye, informaticien
Service régional de l'Inventaire
DRAC Bretagne
mailto:pierrick.brihaye <at> culture.gouv.fr
+33 (0)2 99 29 67 78

-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
Wolfgang Meier | 3 Oct 2005 17:20
Gravatar

Re: On migration from eXist-1.0b2-build-1107 to eXist-snapshot-20050805

> When the internal binary format changes, you need to backup then restore
> your data.

Just a note: using the 20050805 snapshot, restoring from a backup is extremely 
slow. I just fixed this yesterday. Also, the binary format will change again 
for the next snapshot. It might thus be a good idea to get the CVS version 
instead of going through that trouble twice.

Wolfgang

-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
Christin Hoepfner | 3 Oct 2005 18:34
Picon
Picon

Problems embedding latest eXist - Cocoon 2.1.7.

Hello,

 

I am currently using Cocoon 2.1.7. and I am trying to embed the latest eXist snapshot into the cocoon installation.I followed the instruction „CocoonInstall” from the eXist-Homepage, but I am having problems with the examples provided with the installation. I always get a Java Null Pointer Exception and XSP won’t work at all. Can anybody help me with this? Maybe I am using wrong paths or my exist is installed in the wrong place. I would be very grateful if anybody can help out, because I need eXist for my diploma thesis. Thanks in advance.

 

Christin

Wolfgang Meier | 4 Oct 2005 15:25
Picon

XUpdate performance fixes

I just committed a few improvements that will be of interest to all
those making heavy use of xupdate update/replace/remove operations or
their XQuery equivalents: removing/replacing a larger node tree from a
document used to be very slow. I redesigned the code today, which
leads to a real boost in performance. Giulio (who reported the issue)
saw a speed up in his application from 70 seconds to 320 ms (for
replacing a large, deep structured section within a document).

Wolfgang

-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
Adam Retter | 4 Oct 2005 17:02
Picon
Favicon

xmldb:remove() useage?

Hi Guys,

I have the document "doc1.xml" in a collection called "collection1.xml".

The collection and document are owned by admin:communitydirectory.

Now I have a user called "adam" who is in the "communitydirectory"
group. What I am wandering is what permissions should be applied on the
collection and the document to enable deletion of it by "adam".

I am calling -

let $null := xmldb:login("xmldb:exist:///db/collection1", "adam",
"adamspass"),
$null := xmldb:remove("xmldb:exist:///db/collection1", "doc1.xml")
return <b>Document may or may not have been deleted?!?</b>

The reason I think its the permissions is that the above does nothing!
My current permissions on "collection1" are rwurwur--.
My current permissions on "doc1.xml" are rwur-ur-u

Thanks Adam.

-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
Timo Boehme | 4 Oct 2005 21:52
Picon
Favicon

Non standard behaviour with attribute kind test

Hi,

I tested some rather weird queries with the eXist demo server and found 
that the treatment of the attribute kind test does not correspond to the 
XQuery standard.

For the following queries I used document doc('/db/library/biblio.rdf') 
and defined the rdf namespace.

The query
   //attribute(id)
results in the content of the 57 id attributes - ok.

The same with
   /rdf:RDF/rdf:Description/attribute(id) - ok

But
   /rdf:RDF/rdf:Description/child::attribute(id)
returns the attributes as well

as does
   /rdf:RDF//descendant::attribute(id)

only
   /rdf:RDF/descendant::attribute(id)
returns correctly the empty sequence.

In general all XPath expressions with an attribute kind test and an axis 
which is or is derived from child axis (descendant, descendant-or-self, 
following-sibling, preceding-sibling) must return an empty sequence. 
Only in case the context already contains attribute nodes and we have 
descendant-or-self axis the current attribute nodes might be returned 
(if name matches).

Looking only at the examples it seems to me that the error is simply 
that eXist ignores the axis specifier if an attribute test is given.

Kind regards,

Timo

-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl

Gmane