On Mon, Nov 9, 2009 at 8:40 PM, Ivan Shcheklein <[email protected]>wrote:
> Hi Pedro,
>
>
> My question is.... is it supposed to "lock" the entire collection when
>> storing a resource (inside a transaction)? Am I doing something wrong?
>
>
> Yes, the entire collection is locked (reading/writing) when it's being
> updated.
>
Well I wasn't expecting that, I assumed collections could have more
concurrent access, because locking an entire collection (with pottentially
lots of files) during a transaction that can take some time to execute can
make all clients that read files from that collection "hanging"
>
> How can I resolve this situation?
>>
>
> Unfortunately, the best solution - commit as soon as possible. You can also
> try to split your data into two or more collections. BTW, how many documents
> do you have in this collections? Why it's so important not to be locked?
>
In the moment I'm testing with a few thousand files (10.000 / 15.000) but I
was counting with having a lot more.
It's important for it not to be locked, because that collection is where my
files are kept, and I can have transactions that add a lot of a new files
(and thus, take some time to finish) and at the same time have clients that
are trying to read information (issuing queries against those files) which
basically makes them "hang" while waiting for the transaction to finish.
To explain more, you would have to know a little of my thesis (which I can
gladly explain, but maybe outside of the mailing list, as it serves no
purpose here).
>
> Sedna also supports "read only" transactions which never wait for other
> transactions
> (they do not have to acquire any document/collection locks). However they
> might
> access slightly obsolete state of the database (for example, they probably
> would not see the most recent committed updates). This is a very good
> option for highly concurent applications. Unfortunately, this option is
> not available in XML:DB API as far as I know. It's available only in C API
> at present.
>
I saw the "ready-only" transaction in the manual and could not use the
metacommand to create one, that's the reason I wrote the last part of the
e-mail.
If it's only available in the C API it's not good me :( As I'm using the
XML:DB API and my application is developed using Java :/
It would solve "some" of my problems it I could create those transactions to
read file while the collection is being updated.
My only option would be to request that feature to Charles Foster, (to have
it in Java), correct?
>
>
>
>> Another thing I'm interested.... I've tried using the metacommands in
>> se_term but the execution always fails giving me a syntax error ...
>>
>
> What version do you use? I can't reproduce this issue. That's what I got
> (Sedna 3.2.91 on Windows):
>
> $ ./se_term -file 2.xq x
>
> UPDATE is executed successfully
> UPDATE is executed successfully
> <?xml version="1.0" standalone="yes"?><test>test</test>
>
> Where 2.xq exactly contains the following:
>
>
> \nac
> CREATE DOCUMENT "test"&
> UPDATE INSERT <test>{"test"}</test> INTO fn:doc("test")&
> fn:doc("test")&
> \commit
>
> This is indeed weird, at work, using Windows Vista (32bit) and Sedna 3.2.91
I got that error.... at home I tried with Windows XP (also, 32 bit) and
Sedna 3.2.91 and it worked.... I'll try again tomorrow to see if I made some
kind of mistake
> Ivan Shcheklein,
> Sedna Team
>
Thanks for your time.
> Hi Pedro,
> You may notice in the XQJ's SednaXQDataSource there is the function to
state a property of a Read Only Connection/Set of Transactions. I was
planning on implementing this so it works exactly like the C/C++ API
within XQJ, but this does not work at the moment.
> This is on my to do list, but does not have much priority at the moment.
> Regards,
I see... thanks for your input.
At the time I'm using XML:DB (because I designed all my initial work with
it), but I you say that even changing to XQJ would not
work at the time being, than, it seems to me I have to rethink my choices.
Anyway thanks for the clarification
--
Pedro Pereira
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Sedna-discussion mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sedna-discussion