Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
hmottestad opened this issue Oct 6, 2023 Discussed in #4798 · 1 comment · May be fixed by #4803
Open

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

hmottestad opened this issue Oct 6, 2023 Discussed in #4798 · 1 comment · May be fixed by #4803
Labels
🐞 bug issue is a bug 📦 repository issues affecting the Repository API
Milestone

Comments

@hmottestad
Copy link
Contributor

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

@hmottestad hmottestad added 🐞 bug issue is a bug 📦 repository issues affecting the Repository API labels Oct 6, 2023
@hmottestad hmottestad added this to the 4.3.8 milestone Oct 6, 2023
domkun added a commit to domkun/rdf4j that referenced this issue Oct 6, 2023
@domkun domkun linked a pull request Oct 6, 2023 that will close this issue
5 tasks
@domkun
Copy link
Contributor

domkun commented Oct 6, 2023

I had alook at it, I am not sure if this is all that is needed to fix it, I am pretty new to the RDF4J world.

@hmottestad hmottestad modified the milestones: 4.3.8, 4.3.9 Nov 7, 2023
@hmottestad hmottestad modified the milestones: 4.3.9, 4.3.10 Jan 21, 2024
@hmottestad hmottestad modified the milestones: 4.3.10, 4.3.11 Mar 6, 2024
@hmottestad hmottestad modified the milestones: 4.3.11, 4.3.12 Apr 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug issue is a bug 📦 repository issues affecting the Repository API
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants