Wolfgang Meier | 1 Feb 12:23 2004
Picon

Re: eXist MODS XQuery example

> Can you send me a XQuery example that should work with MODS data in the  
> Java client?  Say I want to return all titles  where the record has a  
> topic element value of "riot". 
>  
> Nothing I do works! 

OK. The shortest formulation would be: 

declare default element namespace "http://www.loc.gov/mods/v3"; 

//mods[subject/topic = 'riots']/titleInfo 

If you would like to return additional elements, for example, the name fields: 

declare default element namespace "http://www.loc.gov/mods/v3"; 

for $hit in //mods[subject/topic = 'riots'] 
return 
	<mods>{($hit/titleInfo, $hit/name)}</mods> 

The for loop iterates through each of the items matching the XPath expression 
//mods[subject/topic = 'riots']. For each iteration, the current item is placed
into 
variable $hit and the return clause is called once. The result of the return
clause is then 
copied to the output sequence. 

Inside the return clause, you can construct new XML nodes using pseudo-XML
syntax (it 
looks like XML but is actually translated into an expression tree). You may
(Continue reading)

Brian McCallister | 1 Feb 16:24 2004
Picon

XPath and Namespaces

I cannot seem to figure out how to handle namespaces in xpath. As far 
as I can tell the XPathQueryService#setNamespace is the "right" way to 
specify namespace prefixes for queries (so the database can use 
whatever prefix it likes) but it looks like that is not implemented in 
eXist presently.

Is there another way to specify a prefix for a given namespace so that 
I can query without having to guess the namespace eXist will apply to 
an element?

Thanks!

-Brian

ps: as I haven't posted here before, thank you for the work on eXist! 
It looks like it will be awesome.

-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
Brian McCallister | 1 Feb 19:59 2004
Picon

Re: XPath and Namespaces

It seems that eXist latches on to a prefix for a given namespace the 
first time it encounters it, then when anything in that namespace is 
retrieved the initial namespace used for that element/attribute is 
specified in the namespace declaration, however the namespace prefix 
used when the document was stored is used on the elements.

Take for example a new database and the following two documents:

<ns:feed version="0.3" xmlns:ns="http://purl.org/atom/ns#">
   <ns:title>Test Feed</ns:title>
   <ns:author>
     <ns:name>Brian McCallister</ns:name>
     <ns:url>http://kasparov.skife.org/blog/</ns:url>
     <ns:email>brianm <at> apache.org</ns:email>
   </ns:author>
   <ns:id>http://kasparov.skife.org/blog/test.atom</ns:id>
   <ns:copyright>copyright 2004 BMc</ns:copyright>
   <ns:modified>2004-02-01T13:02:25.673-05:00</ns:modified>
</ns:feed>

<atom:feed version="0.3" xmlns:atom="http://purl.org/atom/ns#">
   <atom:title>Test Feed</atom:title>
   <atom:author>
     <atom:name>Brian McCallister</atom:name>
     <atom:url>http://kasparov.skife.org/blog/</atom:url>
     <atom:email>brianm <at> apache.org</atom:email>
   </atom:author>
   <atom:id>http://kasparov.skife.org/blog/test.atom</atom:id>
   <atom:copyright>copyright 2004 BMc</atom:copyright>
   <atom:modified>2004-02-01T13:02:25.673-05:00</atom:modified>
(Continue reading)

tizo | 2 Feb 06:39 2004
Picon
Picon

about connections

I would like to know some information about how the connection works through
xml:db api. For example, I'd like to know how much idle time a connection
(an open collection) remains actived, and if it is needed to close the collection
after using it (they are not closed in the examples). Where can I find that
information?

Thanks very much,

Tizo

-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
tizo | 2 Feb 06:39 2004
Picon
Picon

about connections

I would like to know some information about how the connection works through
xml:db api. For example, I'd like to know how much idle time a connection
(an open collection) remains actived, and if it is needed to close the collection
after using it (they are not closed in the examples). Where can I find that
information?

Thanks very much,

Tizo

-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
Christofer Dutz | 2 Feb 10:55 2004
Picon

Re: -X mx variable error

Now you are geting a different error. I think the first error was indeed 
related to the speces in your path, but this one is realy strange.
Can it be that you don't have enough free memory available. It seems 
that not even the Java Virtual-Machine was able to be started.
What JDK version are you using? Is the JAVA_HOME environment variable 
set to the correct directory?
It looks as you have no problems form eXists side. It seems the error is 
on the side of the Java VM.

Chris

Pathma Rathinavelu wrote:

>Hi Chris,
>
>Thanks for your reply. I treid to get rid of the spaces in the path and
>tried to call the startup.bat file. However no luck. I installed the
>application by "java -jar eXist-0.9.2-install.jar" command. It created
>shortcuts and successfully installed the program. I called the startup.bat
>file available in the \bin folder by double clicking on it . I also tried
>calling it from the dos prompt. ( I don't think I can do anything more
>simpler. :-) )  Nonetheless I get the same error.
>
>G:\eXist\bin>startup.bat
>Invalid initial heap
>size: -Xms64000k -Xmx256000k -Dfile.encoding=UTF-8 -Djava.e
>ndorsed.dirs="G:\eXist\lib\endorsed"
>Could not create the Java virtual machine.
>G:\eXist\bin>
>
(Continue reading)

Christofer Dutz | 2 Feb 10:54 2004
Picon

Re: -X mx variable error

Now you are geting a different error. I think the first error was indeed 
related to the speces in your path, but this one is realy strange.
Can it be that you don't have enough free memory available. It seems 
that not even the Java Virtual-Machine was able to be started.
What JDK version are you using? Is the JAVA_HOME environment variable 
set to the correct directory?
It looks as you have no problems form eXists side. It seems the error is 
on the side of the Java VM.

Chris

Pathma Rathinavelu wrote:

>Hi Chris,
>
>Thanks for your reply. I treid to get rid of the spaces in the path and
>tried to call the startup.bat file. However no luck. I installed the
>application by "java -jar eXist-0.9.2-install.jar" command. It created
>shortcuts and successfully installed the program. I called the startup.bat
>file available in the \bin folder by double clicking on it . I also tried
>calling it from the dos prompt. ( I don't think I can do anything more
>simpler. :-) )  Nonetheless I get the same error.
>
>G:\eXist\bin>startup.bat
>Invalid initial heap
>size: -Xms64000k -Xmx256000k -Dfile.encoding=UTF-8 -Djava.e
>ndorsed.dirs="G:\eXist\lib\endorsed"
>Could not create the Java virtual machine.
>G:\eXist\bin>
>
(Continue reading)

Martin Holz | 2 Feb 14:42 2004
Picon

Re: Deadlock

Hello Wolfgang, 

I had the same problem but a somewhat different stacktrace sending
SIGQUIT to tomcat.

Java stack information for the threads listed above:
===================================================
"TP-Processor15":
	at org.exist.collections.Collection.getDocuments(Collection.java:255)
	- waiting to lock <0x5479eba0> (a org.exist.collections.Collection)
	at org.exist.collections.Collection.allDocs(Collection.java:241)
	at org.exist.collections.Collection.allDocs(Collection.java:225)
	- locked <0x57028188> (a org.exist.collections.Collection)
	at org.exist.xmldb.LocalXPathQueryService.query(LocalXPathQueryService.java:88)
	at org.exist.cocoon.XMLDBTransformer.startForEach(XMLDBTransformer.java:321)
	at org.exist.cocoon.XMLDBTransformer.startElement(XMLDBTransformer.java:131)
[Snipped more stacktrace ]

"Thread-5":
	at org.exist.collections.Collection.update(Collection.java:158)
	- waiting to lock <0x57028188> (a org.exist.collections.Collection)
	at org.exist.storage.NativeBroker.saveCollection(NativeBroker.java:1726)
	at org.exist.collections.Collection.removeDocument(Collection.java:465)
	- locked <0x5479eba0> (a org.exist.collections.Collection)
	at org.exist.xmldb.LocalCollection.removeResource(LocalCollection.java:405)
	at de.vs_c.slide.store.AsynchronousXMLIndexer.doRemove(AsynchronousXMLIndexer.java:159)
	at de.vs_c.slide.store.AsynchronousXMLIndexer.run(AsynchronousXMLIndexer.java:99)
	at java.lang.Thread.run(Thread.java:536)

Found 1 deadlock.
(Continue reading)

Greenwood,Tony | 2 Feb 15:53 2004
Picon

(Newbie) Namespace for prefix 'xmldb' has not been declared

Hi folks,
Maybe this is a newbie FAQ but with
eXist-0.9.2.war
Tomcat 5.0.16
j2sdk-1.4.2_03
RedHat Linux 8.0
I can use client.sh and I can see localhost:8080/exist but if I try to use
the examples there (such as Xquery.xsp) I get "Namespace for prefix 'xmldb'
has not been declared".
What should I do next?

Tony.

*****  CONFIDENTIALITY & SECURITY DISCLAIMER  ***** 
Please note the contents of this e-mail do not necessarily represent the
policies or views of St Martins College. This e-mail message and any
attachments may contain confidential information and should only be accessed
by the intended recipient. If they have come to you in error please advise
the sender by replying to this email and copy your reply to
postmaster <at> ucsm.ac.uk. In this circumstance you must not disclose, copy,
distribute, use or rely on this email and you should permanently delete it. 
Security Warning: Please note that this e-mail has been created in the
knowledge that Internet e-mail is not a 100% secure communications medium.
It is advised that you understand and observe this lack of security when
emailing us. 
Viruses: Although we have taken steps to ensure that this email and
attachments are free from any virus, we cannot accept responsibility for
email once it has left us. You should ensure that you have a suitable anti
virus system in place and check the email upon receipt.

(Continue reading)

Martin Holz | 2 Feb 16:36 2004
Picon

Re: Deadlock

Martin Holz <holz <at> fiz-chemie.de> writes:

Hello Wolfgang, 

I am far from understanding the eXist internals but the deadlock seems
to occur like this.

Thread 15 does a recursive allDocs on collection /db/a, thereby acquiring 
a (synchronized) lock on this collection. B

Thread 5 acquires a lock on a child collection /db/a/b/c/d/e
for removing a resource. It is not stopped by the  lock
on /db/a.

Now Thread 15 recursive fetches child collections until it reaches
/db/a/b/c/d/e. The lock hold by Thread 5 will stop it.

Thread 5 removes a document from /db/a/b/c/d/e and the broker tries to 
save the collection. For doing so it must update the parent collection.
But Thread 15 already holds a lock. Result is a Deadlock :-(.

> I had the same problem but a somewhat different stacktrace sending
> SIGQUIT to tomcat.
> 
> 
> Java stack information for the threads listed above:
> ===================================================
> "TP-Processor15":
> 	at org.exist.collections.Collection.getDocuments(Collection.java:255)
> 	- waiting to lock <0x5479eba0> (a org.exist.collections.Collection)
(Continue reading)


Gmane