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

Setting isolation-level through rdf4j 3.7.4 client side is not compatible with server side from another version #4230

Closed
DenitsaStoianova opened this issue Oct 12, 2022 · 2 comments · Fixed by #4231
Assignees
Labels
🐞 bug issue is a bug
Milestone

Comments

@DenitsaStoianova
Copy link

DenitsaStoianova commented Oct 12, 2022

Current Behavior

Trying to set isolation-level through rdf4j 3.7.4 client side leads to java.lang.IllegalArgumentException: Unknown isolation-level setting http://www.openrdf.org/schema/sesame#READ_COMMITTED when server side version is >= 4.1.3

Expected Behavior

Isolation-level must be successfully set regardless of client or server side versions.

Steps To Reproduce

  1. Connect to remote repository and begin a new transaction with READ_COMMITTED isolation-level.
    Notes: client side rdf4j version is 3.7.4 while server side is >= 4.1.3
HTTPRepository repository = new HTTPRepository("remote_repository_url");

try (RepositoryConnection conn = repository.getConnection()) {
    conn.begin(IsolationLevels.READ_COMMITTED);
} 
  1. IllegalArgumentException is thrown:
java.lang.IllegalArgumentException: Unknown isolation-level setting http://www.openrdf.org/schema/sesame#READ_COMMITTED
	at org.eclipse.rdf4j.http.server.repository.transaction.TransactionStartController.getIsolationLevel(TransactionStartController.java:92)
	at org.eclipse.rdf4j.http.server.repository.transaction.TransactionStartController.startTransaction(TransactionStartController.java:129)
	at org.eclipse.rdf4j.http.server.repository.transaction.TransactionStartController.handleRequestInternal(TransactionStartController.java:68)
	at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:177)

Version

4.2.0

Are you interested in contributing a solution yourself?

Yes

Anything else?

No response

@DenitsaStoianova DenitsaStoianova added the 🐞 bug issue is a bug label Oct 12, 2022
@hmottestad
Copy link
Contributor

Maybe this is caused by #4185 ?

It is also possible that this didn't work correctly before 4.1.3, but that there was no error message which made the bug go unnoticed.

@DenitsaStoianova
Copy link
Author

DenitsaStoianova commented Oct 12, 2022

Yes, the problem comes from fixes for REST Isolation-level settings in #4185 where IllegalArgumentException for Unknown isolation-level setting is introduced.

Also, there are another problems with isolation-level settings in versions before 4.1.3:

rdf4j client 3.7.4 adds the following properties to the request:

isolation-level=http://www.openrdf.org/schema/sesame#READ_COMMITTED
transaction-setting__org.eclipse.rdf4j.IsolationLevel=READ_COMMITTED

When the request is processed in TransactionStartController none of the isolation-level parameters are set to the transaction because it cannot find the appropriate matches due to the following problems:

  1. The first parameter isolation-level=http://www.openrdf.org/schema/sesame#READ_COMMITTED is not used in the correct way because it try to compare the value http://www.openrdf.org/schema/sesame#READ_COMMITTED with READ_COMMITTED.

  2. In rdf4j 4.0.0 IsolationLevel interface is moved in another package which changes the second request parameter to the following one: transaction-setting__org.eclipse.rdf4j.common.transaction.IsolationLevel=READ_COMMITTED which is not the same as the expected one.

As a result, setting the isolation-level through client side versions < 4.0.0 is not compatible with server side versions >= 4.0.0

DenitsaStoianova added a commit to DenitsaStoianova/rdf4j that referenced this issue Oct 12, 2022
…nStartController in order to check the correct request parameter
@barthanssens barthanssens added this to the 4.2.1 milestone Oct 17, 2022
hmottestad added a commit that referenced this issue Oct 28, 2022
…-level_setting_to_be_compatible_with_different_versions_of_client_or_server_side

GH-4230 Make isolation-level setting to be compatible with different versions of client and server side
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug issue is a bug
Projects
None yet
3 participants