How to work without transactions

Fedora has no concept of transactions. There are situations where this is simply not good enough for the DOMS system. To get around this, we have built a system which gives us the most nessesary benefits of transactions.

Each data object must have a STATE datastream. This datastream has just one element, having one of three values.

The transition between these three states can be seen here

attachment:StateTransition.jpeg

Multiobject transactions

To emulate a transaction, follow these steps:

  1. Ingest any new objects, with STATE=draft
  2. change the STATE of all involved objects with STATE=published to STATE=intermediate
  3. Perform all changes that must be performed
  4. Change the objects back to STATE=published. This will provoke a validation of the objects by the DOMS system. If the objects failed the validation, the STATE will not change.

DOMS only try to enforce a structure on objects with STATE=published.

The STATE datastream

The schema for the STATE datastream can be seen here

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance#"
            targetNamespace="http://doms.statsbiblioteket.dk/properties/state/0/1/#"
            xmlns="http://doms.statsbiblioteket.dk/properties/state/0/1/#"
            elementFormDefault="qualified"
            attributeFormDefault="unqualified">

    <xsd:element name="state" type="extpropertiesType"/>

    <xsd:complexType name="extpropertiesType">
        <xsd:attribute name="value" type="valuesType"/>
    </xsd:complexType>

    <xsd:simpleType name="valuesType">
        <xsd:restriction base="xsd:string">
            <xsd:enumeration value="published"/>
            <xsd:enumeration value="intermediate"/>
            <xsd:enumeration value="draft"/>
        </xsd:restriction>
    </xsd:simpleType>
</xsd:schema>

It is defined in the datastream STATE_SCHEMA in ContentModel_DOMS.

The STATE datastream will therefore look like

<s:state value="published" xmlns:s="http://doms.statsbiblioteket.dk/properties/state/0/1/#"/>

or

<s:state value="intermediate" xmlns:s="http://doms.statsbiblioteket.dk/properties/state/0/1/#"/>

or

<s:state value="draft" xmlns:s="http://doms.statsbiblioteket.dk/properties/state/0/1/#"/>