Commit cdfc1c81 authored by Daniel Gerhardt's avatar Daniel Gerhardt Committed by Daniel Gerhardt

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
......@@ -499,9 +499,9 @@ public class CouchDBDao implements IDatabaseDao, ApplicationEventPublisherAware
}
@Override
@Transactional(isolation = Isolation.READ_COMMITTED)
public boolean sessionKeyAvailable(final String keyword) {
final View view = new View("session/by_keyword");
view.setKey(keyword);
final ViewResults results = getDatabase().view(view);
return !results.containsKey(keyword);
......
Markdown is supported
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