Charles, Michele,
We've analyzed logs, reproduced the situation on our side and determined the
following problems:
1. There are very strange "(SE3007) Failed to recieve a message." errors.
Usually this message means that connection was not properly closed.
Meanwhile close() is definitely called on every opened session. Charles,
it's seems that Sedna doesn't get se_CloseConnection message. Is it
possible?
2. Considering the problem of rollbacks, this is neither a bug of Sedna nor
a bug of XML:DB API implementaion. According to event log XML:DB API works
as follows in this case:
- Tests if document exists by requesting '$documents'. Since
'$documents' contains full metadata list, transaction acquires a shared lock
(S) on entire database.
- Then transaction is going to DROP or LOAD document (depends on the
result of the first step). Naturally it intends to acquire an exclusive lock
(X) (actually, IX but it doesn't matter) on database.
Now let's assume we have two transaction, namely T1 and T2. Both transaction
successfully acquired S on the first step. Then they try to acquire X. Since
it's not compatible with S we have classical deadlock - T1 waits for T2 and
T2 waits for T1. One of them is rollbacked.
There are a few ways to solve the problem:
- Leave everything the way it is. In this case we suppose that
application must handle rollbacks and restart transactions appropriately.
- Make some XML:DB API methods synchronized. In this case we lose updates
concurrency.
- We implement some way to get locks explicitly (like
http://publib.boulder.ibm.com/infocenter/cscv/v10r1/index.jsp?topic=/com.ibm.cloudscape.doc/rrefsqlj40506.html).
In this case Charles will be able to call something like
*se:test-if-doc-exsits-and-set-lock("name")* which returns *'false'* if
there is no such document. Consequently, we don't have problems neither with
deadlocks, nor with concurrency.
I believe, that the third way is the best one. However it'll take some time
to implement this solution in Sedna and in XML:DB API.
Charles, Michele, what do you think?
Ivan Shcheklein,
Sedna Team
------------------------------------------------------------------------------
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