- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2016 01:01 PM
Hi all
I've seen the setCategory method being used in few places in ServiceNow scripts, but never figured out what it does.
For example,
<g2:evaluate var="jvar_inc">
var inc = new GlideRecord('incident');
inc.addActiveQuery();
inc.addQuery('priority',1);
inc.setCategory('homepage');
inc.query();
</g2:evaluate>
This is part of the UI page 'render_gadget_priority_incidents'.
I couldn't find any reference to the 'setCategory' method used in the above script.
Does anyone know what it does?
Thanks
Regards
Kevin
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2016 12:36 AM
Hi Kevin,
The setCategory and getCategory methods are available in GlideRecord for working with query categories when routing to secondary database pools, known as read replicas.
setCategory(String)
Sets the category, which determines how the query is routed to a secondary database pool.
getCategory()
Determines whether a category is set for a query
A read replica is a 100% copy of an instance's database (DB) that can be only queried against with the goal to reduce load on the primary database. It's a paid feature and requires an extra plugin that can only be activated by ServiceNow. With setCategory you can route some categories to the read replica, so queries for them will not go to primary database anymore (effectively reducing load on primary database).
Hope this helps.
Regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2016 12:36 AM
Hi Kevin,
The setCategory and getCategory methods are available in GlideRecord for working with query categories when routing to secondary database pools, known as read replicas.
setCategory(String)
Sets the category, which determines how the query is routed to a secondary database pool.
getCategory()
Determines whether a category is set for a query
A read replica is a 100% copy of an instance's database (DB) that can be only queried against with the goal to reduce load on the primary database. It's a paid feature and requires an extra plugin that can only be activated by ServiceNow. With setCategory you can route some categories to the read replica, so queries for them will not go to primary database anymore (effectively reducing load on primary database).
Hope this helps.
Regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2017 11:19 AM
Hi Sergiu, thank you for the great information (as usual missing on the wiki). Do you know the exact name of this plugin?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2017 12:14 PM
Hi Artur
This can be enabled by activating the secondary database pool plugin. As Sergiu mentioned, this can be enabled by request only.
This plugin can be found in the linked page below:
Regards
Kevin