Skip to content

Isolation level is always null, if queried from the RepositoryConnection #4802

@hmottestad

Description

@hmottestad

Discussed in #4798

Originally posted by domkun October 6, 2023
Hi there,

I had a problem with concurrent transactions, so I wanted to log the isolation level of the current connection using RepositoryConnection#getIsolationLevel method. However it always returns null. The underlying sailConnection property of the SailRepositoryConnection shows the set isolation level. Is this intended?

I am a bit confused about this. Here is a short reproducer:

import org.eclipse.rdf4j.common.transaction.IsolationLevels;
import org.eclipse.rdf4j.repository.Repository;
import org.eclipse.rdf4j.repository.RepositoryConnection;
import org.eclipse.rdf4j.repository.sail.SailRepository;
import org.eclipse.rdf4j.sail.memory.MemoryStore;

class Scratch {
    public static void main(String[] args) {
        Repository sailRepository = new SailRepository(new MemoryStore());

        try (RepositoryConnection connection = sailRepository.getConnection()) {
            connection.begin(IsolationLevels.SERIALIZABLE);
            System.out.println(connection.getIsolationLevel());
            connection.commit();
        }
    }
}

Edit: Screenshot of the debugger window attached

image

Metadata

Metadata

Assignees

Labels

🐞 bugissue is a bug📦 repositoryissues affecting the Repository API

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions