Skip to content
Snippets Groups Projects
Commit cdfc1c81 authored by Daniel Gerhardt's avatar Daniel Gerhardt Committed by Daniel Gerhardt
Browse files

Filter sessions on the DB side to check if key is available

This should massively reduce the time needed for session creation.
Additionally, the `Transactional` annotation has been removed because
it did not have any effect in this case.
parent f80d2eab
Branches
Tags
1 merge request!58Filter sessions on the DB side to check if key is available
Pipeline #8179 passed with stages
in 3 minutes and 32 seconds
...@@ -499,9 +499,9 @@ public class CouchDBDao implements IDatabaseDao, ApplicationEventPublisherAware ...@@ -499,9 +499,9 @@ public class CouchDBDao implements IDatabaseDao, ApplicationEventPublisherAware
} }
@Override @Override
@Transactional(isolation = Isolation.READ_COMMITTED)
public boolean sessionKeyAvailable(final String keyword) { public boolean sessionKeyAvailable(final String keyword) {
final View view = new View("session/by_keyword"); final View view = new View("session/by_keyword");
view.setKey(keyword);
final ViewResults results = getDatabase().view(view); final ViewResults results = getDatabase().view(view);
return !results.containsKey(keyword); return !results.containsKey(keyword);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment