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

GH-4802: Fix setting isolation level in SailRepositoryConnection #4803

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ public void begin() throws RepositoryException {

@Override
public void begin(IsolationLevel level) throws RepositoryException {
super.begin(level);
try {
// always call receiveTransactionSettings(...) before calling begin();
sailConnection.setTransactionSettings(new TransactionSetting[0]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.rdf4j.repository.sail;

import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyBoolean;
import static org.mockito.ArgumentMatchers.eq;
Expand All @@ -20,6 +21,7 @@
import java.util.Optional;

import org.eclipse.rdf4j.common.iteration.EmptyIteration;
import org.eclipse.rdf4j.common.transaction.IsolationLevels;
import org.eclipse.rdf4j.query.BooleanQuery;
import org.eclipse.rdf4j.query.GraphQuery;
import org.eclipse.rdf4j.query.Query;
Expand Down Expand Up @@ -148,4 +150,11 @@ public void testPrepareBooleanQuery_bypassed() throws Exception {
verify(sailConnection).evaluate(eq(expr), any(), any(), anyBoolean());
}

@Test
public void testIsolationLevelIsSet() throws Exception {
IsolationLevels isolationLevel = IsolationLevels.SERIALIZABLE;
subject.begin(isolationLevel);
assertThat(subject.getIsolationLevel()).isEqualTo(isolationLevel);
}

}
Loading