SourceForge.net | 8 Nov 2010 15:38
Picon
Favicon

[ sedna-Bugs-3105299 ] Update functions can break XDM consistency!

Bugs item #3105299, was opened at 2010-11-08 17:38
Message generated for change (Tracker Item Submitted) made by mozinsur
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=713730&aid=3105299&group_id=129076

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Update Language
Group: Sedna (current)
Status: Open
Resolution: None
Priority: 6
Private: No
Submitted By: Ilya Taranov (mozinsur)
Assigned to: Nobody/Anonymous (nobody)
Summary: Update functions can break XDM consistency!

Initial Comment:
The following code:

[code]
create document "a"&
update insert <a a="1" c="2" /> into doc("a")&
update replace doc("a")/a/ <at> a with (attribute b {"1.5"}, <x />)&
[/code]

leads to a broken data model. This can be told by 

[code]
(Continue reading)

Zoltán Zörgő | 6 Nov 2010 21:37
Picon

Creating index on document in a collection

Dear all!
 
I am newbie in Sedna, and I am trying to create a value-index on a document in a collection. The statement is:
create index "book-title" on doc("books.xml", "testcollection")/catalog/book by title as xs:string
But I get the folowing error:
SEDNA Message: ERROR SE5049 Not a structural XPath supplied. Details: at (1:30), document-in-collection is not permitted in on-XPath
But doc("books.xml","testcollection")/catalog/book/title runs correctly.
 
I found no example in the documentation on this.
The index creation in collection is not permitted, not implemented or I am doing something wrong?
 
Thank You
Zoltan
------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
Sedna-discussion mailing list
Sedna-discussion@...
https://lists.sourceforge.net/lists/listinfo/sedna-discussion
Mario Trojan | 19 Nov 2010 21:16

Handling of large XML files / performance

Hello,

i just wanted to know if it is also possible to load (and manipule)
large files, which can be hundreds of megabytes, or even multiple
gigabytes. I tried to load a file into sedna via php api (240 MB), and
it took 463 seconds to import it (on win 64). I recognized that the
se_sm.exe process was working all the time, but only using about 14MB of
memory.

How can the import be accelerated? Couldn't find anything in the
documentation about that topic.

I also noticed that there is only one function for loading xml
documents, and thats "sedna_load", where you need to pass the whole
document as a string. Meaning it is necessary to parse the whole 240MB
into a string (-> into memory), so that you can pass it to the function.
Or is there a better way to do this?

Best regards,
Mario

------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
Ivan Shcheklein | 19 Nov 2010 21:41
Picon
Gravatar

Re: Handling of large XML files / performance

Hi Mario,


i just wanted to know if it is also possible to load (and manipule)
large files, which can be hundreds of megabytes, or even multiple
gigabytes. I tried to load a file into sedna via php api (240 MB), and
it took 463 seconds to import it (on win 64). I recognized that the
se_sm.exe process was working all the time, but only using about 14MB of
memory.

Yes, it's possible. See wikixmldb.org for example - 36Gb XML file. And works pretty fine. 
 
How can the import be accelerated? Couldn't find anything in the
documentation about that topic.

There are two things you can do:

1. Increase buffers (use -bufs-num SM's option - http://modis.ispras.ru/sedna/adminguide/AdminGuidesu3.html#x7-130002.3.4). Default value 100Mb is small for complex and big data.
2. Use log less mode (to turn it on in se_term, see LOG_LESS_MODE here http://modis.ispras.ru/sedna/adminguide/AdminGuidesu4.html#x8-150002.4). This option is also available via php API: SE OPTID LOGLESS.  
 
I also noticed that there is only one function for loading xml
documents, and thats "sedna_load", where you need to pass the whole
document as a string. Meaning it is necessary to parse the whole 240MB
into a string (-> into memory), so that you can pass it to the function.
Or is there a better way to do this?

No, AFAIR. You should use some other way (se_term, C API, Java API) to perfrom initial bulk load of really big data.


Ivan Shcheklein,
Sedna Team
------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
Sedna-discussion mailing list
Sedna-discussion@...
https://lists.sourceforge.net/lists/listinfo/sedna-discussion
Ivan Shcheklein | 19 Nov 2010 21:48
Picon
Gravatar

Re: Creating index on document in a collection

Hi Zoltán,

 
I am newbie in Sedna, and I am trying to create a value-index on a document in a collection. The statement is:
create index "book-title" on doc("books.xml", "testcollection")/catalog/book by title as xs:string
But I get the folowing error:
SEDNA Message: ERROR SE5049 Not a structural XPath supplied. Details: at (1:30), document-in-collection is not permitted in on-XPath
But doc("books.xml","testcollection")/catalog/book/title runs correctly.

It's not possible to create index on a single document within a collection. It's only possible to create an index on the whole collection, like:

create index "book-title" on collection("testcollection")/catalog/book by title as xs:string

If you need to create indexes on individual documents don't load them into collection.


Ivan Shcheklein,
Sedna Team
 

------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
Sedna-discussion mailing list
Sedna-discussion@...
https://lists.sourceforge.net/lists/listinfo/sedna-discussion
Malcolm Davis | 19 Nov 2010 22:34

Java connection management & SE3007

From the FAQ section of Sedna website on Windows issues: "SE3007: Failed to receive a message" is blamed on Winsock2 issues. 

 

I was able to recreate the SE3007 problem using Sedna’s Java ConnectionManager in a multi thread application.

 

I was able to resolve the SE3007 by writing my own connection wrapper around the ConnectionManager.

 

I most have spent time investigating project/code at www.cfoster.net rather than writing my own.

 

Malcolm

 

------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
Sedna-discussion mailing list
Sedna-discussion@...
https://lists.sourceforge.net/lists/listinfo/sedna-discussion
Spencer Cheng | 21 Nov 2010 14:10

deadlock resolution procedure?

Could anyone point me to more documentation on the subject?

I have 2 Ruby processes accessing Sedna via the Ruby binding. After I run the processes for for a few minutes,
one of the process dies with "The transaction is a victim of deadlock resolution procedure
(Sedna::Exception)". 

Regards,
Spencer

------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
Ivan Shcheklein | 21 Nov 2010 14:37
Picon
Gravatar

Re: deadlock resolution procedure?

Hi Spencer,


Could anyone point me to more documentation on the subject?
I have 2 Ruby processes accessing Sedna via the Ruby binding. After I run the processes for for a few minutes, one of the process dies with "The transaction is a victim of deadlock resolution procedure (Sedna::Exception)".

See http://en.wikipedia.org/wiki/Two-phase_locking, Deadlocks in 2PL . Sedna aborts transaction using wait-for-graph as described in that article. You should manually restart it if you need.


Ivan Shcheklein,
Sedna Team

------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
Sedna-discussion mailing list
Sedna-discussion@...
https://lists.sourceforge.net/lists/listinfo/sedna-discussion
Ivan Shcheklein | 21 Nov 2010 14:40
Picon
Gravatar

Re: Java connection management & SE3007

Hi Malcolm,


>From the FAQ section of Sedna website on Windows issues: "SE3007: Failed to receive a message" is blamed on Winsock2 issues. 

I was able to recreate the SE3007 problem using Sedna’s Java ConnectionManager in a multi thread application.

I was able to resolve the SE3007 by writing my own connection wrapper around the ConnectionManager.

I most have spent time investigating project/code at www.cfoster.net rather than writing my own.



It this error still issue for you?
Most likely, you should just properly close connection in a finally { } block.

Ivan Shcheklein,
Sedna Team

------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
Sedna-discussion mailing list
Sedna-discussion@...
https://lists.sourceforge.net/lists/listinfo/sedna-discussion
Spencer Cheng | 21 Nov 2010 16:39

Re: deadlock resolution procedure?

Hi Ivan,

On Nov 21, 2010, at 8:37, Ivan Shcheklein wrote:
> 
> See http://en.wikipedia.org/wiki/Two-phase_locking, Deadlocks in 2PL . Sedna
> aborts transaction using wait-for-graph as described in that article. You
> should manually restart it if you need.
> 

I can't quite figure out why I am getting the deadlock though.

My (FIFO queue-like) code looks like this in ruby'esque code

Process 1
---------

sedna.execute("update insert <data>...</data> preceding doc('somedoc')/a/b/tail")

Process 2
----------

sedna.transaction {
  sedna.execute("doc('somedoc')/a/b/data[1]")
  sedna.execute("update delete doc('somedoc')/a/b/data[1]")
}

My assumption was that Process 1 using only a single query would be atomic and Process 2 requires the
transaction wrapper to maintain atomicity. If Process 2 gets context switched after the 1st query and
Process 1 tries to execute a query, Process 1 will block and Process 2 will get to run and complete the
transaction before Process 1 can execute it's query.

Is here an error in my logic?

Regards,
Spencer

------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev

Gmane