Search in sources :

Example 1 with NeoStoreTransaction

use of org.neo4j.kernel.impl.persistence.NeoStoreTransaction in project neo4j-mobile-android by neo4j-contrib.

the class NioNeoDbPersistenceSource method createTransaction.

public NeoStoreTransaction createTransaction(XaConnection connection) {
    if (xaDs.isReadOnly()) {
        throw new ReadOnlyDbException();
    }
    NeoStoreTransaction result = ((NeoStoreXaConnection) connection).getWriteTransaction();
    // This is not a very good solution. The XaConnection is only used when
    // delisting/releasing the nioneo xa resource. Maybe it should be stored
    // outside the ResourceConnection interface?
    result.setXaConnection(connection);
    return result;
}
Also used : ReadOnlyDbException(org.neo4j.kernel.impl.core.ReadOnlyDbException) NeoStoreTransaction(org.neo4j.kernel.impl.persistence.NeoStoreTransaction)

Aggregations

ReadOnlyDbException (org.neo4j.kernel.impl.core.ReadOnlyDbException)1 NeoStoreTransaction (org.neo4j.kernel.impl.persistence.NeoStoreTransaction)1