[Mulgara-general] Transactions

David dsiegel at acm.org
Tue Jun 1 23:15:37 UTC 2010


Alex Hall <alexhall at revelytix.com> writes:

> Because you're talking about logical consistency, I'm not convinced that
> a transactional solution with locking is necessarily your best approach
> here.  If your application expects certain invariants, such as
> dateOfBirth being a functional property, then it's up to you to enforce
> them.

That's what I've been after all along. I hope my most recent reply
to Paul cleared that up.

> Basically, what you're trying to do is describe a change to an RDF
> graph, and communicate this change to the graph service.  If you're
> concerned about logical consistency of the graph, then you need to
> describe the change logically in a way that maintains that consistency. 
> I've found the following paper to be extremely helpful in thinking about
> applying modifications to graphs:
>
> http://www.w3.org/DesignIssues/Diff

This looks interesting.

> What you're looking for is essentially a strong delta -- a change
> description that carries enough information to accomplish the desired
> logical outcome regardless of the input graph.
>
> Going back to the dateOfBirth example, the logical outcome you're trying
> to accomplish isn't the insertion of a particular statement.  The
> logical outcome is that Joe has exactly one birth date, with the given
> value.  If he previously had a different one, then it needs to be
> removed.

No, this is _not_ what I want.  I'm trying to protect against the
case where a "parallel" transaction has asserted inconsistent
information.

Transaction A reads the database, sees that there is no statement
:Joe :dateOfBirth ?dob
and asserts
:Joe :dateOfBirth "Jan-01-2000"^^xsd:date

At more or less the same time, Transaction B reads the database, also sees
that there is no statement
:Joe :dateOfBirth ?dob
and asserts
:Joe :dateOfBirth "Dec-31-1999"^^xsd:date

I want whichever of these transactions is executed by Mulgara second to
detect that its precondition (no preexisting statement :Joe :dateOfBirth
?dob) no longer holds, and FAIL.

To accomplish this, I need to send a transaction packet that coordinates
re-establishing the precondition and executing the delta.

Doing it your way does leave the database in a consistent condition,
but at the cost of a lost update.

-dms


More information about the Mulgara-general mailing list