Hello,
I implemented a program that inserts into database users from an active directory through JDBC..
That is, the rows are added to CWD_USER , CWD_MEMBERSHIP and CWD_GROUPS (only sometimes) tables.
But these changes are not reflected in JIRA until the server is restarted.
How I can do other than to restart so that one user can login afterwards inserted in CWD_USERS and enter?
I guess it's because of some cache, as I can clean or refresh programmatically?
Thank you very much.
Greetings.
Community moderators have prevented the ability to post new answers.
I've tried this with the script runner plugin - https://jamieechlin.atlassian.net/wiki/display/GRV/Built-In+Scripts#Built-InScripts-ClearJIRAorGroovyCaches
You'll notice though that it says "clear caches that can be cleared" - I don't know if that includes the crowd/CWD cache. I also stopped using it because it didn't seem reliable (although I really don't know if that was down to the cache I wanted to clear was one of the ones that would respond to the cache clear event).
Thank you very much for your answer.
But it is not what I need, because it clears the cache. My program is done in Java and would like to use any official api.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This clears all caches that respond to a ClearCacheEvent:
ComponentManager.getComponentInstanceOfType(EventPublisher.class).publish(ClearCacheEvent.INSTANCE);
But this clears all caches, you might want to just find the one that you need.
Not sure what you mean by official API, I believe .publish is @PublicApi.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'd like to be able to clear the Groovy cache programmatically (e.g. from within a "make" rule). I saw this post but it looks a bit complicated, so I'd like first to try creating my own ScriptRunner REST endpoint and clearing the Groovy cache from within it.
However, I don't know the Java (or Groovy) incantation to clear the Groovy cache, and I wondered whether it might be possible to see the source of (or an appropriate fragment from the source of) the ClearCaches.groovy built-in script? From the disassembled ClearCaches.class if appears that the code quoted above is used for clearing the Java caches but not the Groovy caches.
Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.