Database queries are running periodically

Kenny Deblaere asked on November 17, 2016 15:50

Hello

In my code I'm using the methods SelectSingleNodeand SelectSingleNodes from the class TreeProvider.

Is there a way to close the connection, after the query statement has been released.

I see also 2 statements returning periodically:

  1. SELECT TOP 1 * FROM CMS_Query WHERE (QueryName = N'generalselect' AND ClassID = 5084)
  2. SELECT TOP(1) [EventType], [InstanceType], [InstanceData], [InstanceName], [UserName], [Stamp], [Created] FROM [EventQueue] ORDER BY [Stamp] DESC

I don't know what these are doing, neither what the purpose is for running multiple times after each other.

Kind regards

Kenny

Recent Answers


Roman Hutnyk answered on November 17, 2016 16:15

  1. Kentico retrieves select query for a class with ID 5084. If you check CMS_Class table you'll find out what class is it. It looks like there is listing page for that class somewhere (I guess it is in Admin).

  2. This is select from non-Kentico table, so I can't speak to that.

I believe Kentico API closes DB connection, so no need to do that manually.

1 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on November 17, 2016 18:28

Roman is correct, the API and any internal calls close the db connection automatically so no need to attempt to close it manually unless you have some standard C# code you're writing and not using the Kentico API.

The first query is getting a generalselect query statement from the cms_query table. Based on the query statement, the generalselect query is non-existent in an out of the box version of Kentico so this has to be something created by you or your team and being called from within the API. The majority of those statements are dynamically built so the generalselect could be a property from a webpart or from an API call in something you or your team coded. Many possibilities.

Unless they are locking up the database or returning lots of data unnecessarily, I'd not worry much about them.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.