You can translate the question and the replies:

queryTimeout parameter not work

Hello guys! i am trying to connect Denodo 6 using jdbc, and the JayDeBeApi python library. But from some reason the server just ignore this parameter, and even when time timeout exceeded, the query is still running. what should i do? Can this feature be enabled/disabled on the server side? (i am familiar only with the client side, but if it's some kind of configuration that could be setted in the server ill do that) the connection string looks like that: "jdbc:vdb://denodo-server/MyDb?queryTimeout=1 Thanks!

7 Answers

Hi, I have tested this and it worked for me fine. I would suggest to also try the following approaches for your scenario: 1. You can specify queryTimeout as a driver property instead of specifying it in the connection string. The article [How To Connect Denodo From Python - A Starter For Data Scientists](https://community.denodo.com/kb/en/view/document/How%20to%20connect%20to%20Denodo%20from%20Python%20-%20a%20starter%20for%20Data%20Scientists?tag=Consumers#:~:text=results%20%3D%20cur.fetchallnumpy() ) contains an example of adding the properties through the "driver_args" in the connect method. 2. You can add CONTEXT('QUERYTIMEOUT'='1') in the query you send through the parameter "query". This modifies the querytimeout for that specific query and can be of course also increased to a higher value as needed. You can find more information in the [CONTEXT Clause documentation](https://community.denodo.com/docs/html/browse/6.0/vdp/vql/queries_select_statement/context_clause/context_clause#:~:text=QUERYTIMEOUT.%20Maximum%20time,of%20the%20connection.). 3. You could try to use another access interface such as ODBC and set the property in the ODBC configuration (or in the DSN Less connection). The approach to connect via ODBC form Python is also highlighted in the same Knowledge Base article as from point 1. I hope this helps!
Denodo Team
07-03-2023 05:59:36 -0500
code
Thank you very much for your detailed answer! 1) I read this article serval of times. After your suggestion, i tried connect to the server, but now passing the "queryTimeout" parameter as driver_arg. it looks like that: ``` conn = jaydebeapi.connect("con.denodo.vdp.jdbc.Driver", <connection url>, driver_args={"queryTimeout": "10"}, jars=<driver path>) ``` And when i check the queryTimeout, it gives me the correct value: ``` print(conn.jconn.queryTimeout) > 10 ``` But still the same problem, and the server ignore this parameter. 2) the CONTEXT clause works for me, but i can't use it because im creating some kind of wrapping function for the user to make queries, and if they will have their own CONTEXT clause it will not work. 3) ODBC was the first thing i tried, but it seemed Denodo ODBC driver don't support the QueryTimeout attribute (when using Pyodbc, i get explicit Exception that this attribute not supported). So i left this approach, and moved to JDBC. Its all come ups to one conclusion: This problem reside on the server side. How should i debug this? the first thing i would like to check is if this feature has been disabled.
user
08-03-2023 03:22:14 -0500
Hi, I tried the querytimeout from a JDBC client and it worked fine on Denodo Platform 6.0 update 20201123, so it looks to be a client side issue. It is difficult to know why setting the parameter with your specific JDBC client doesn't work, but I have some notes when trying to set the queryTimeout with ODBC. The "queryTimeout" needs to be set within the **Connect Settings** as seen in the Knowledge Base article [Configuration of ODBC timeout in DSN](https://community.denodo.com/kb/en/view/document/Configuration%20of%20ODBC%20timeout%20in%20a%20DSN): `set queryTimeout to <number>` If you are using a connection string an example for setting the queryTimeout within the "ConnSettings" would be like this: `DRIVER={DenodoODBC Unicode(x64)};SERVER=<HOST>;DATABASE=<Database_name>;PORT=9996;ConnSettings=SET+queryTimeout+TO+2000` Finally, you can also set a server side ODBC queryTimeout in the VDP Server configuration. You can open this file, which is located in the folder `DENODO_HOME\conf\vdp\VDBConfiguration.properties` and search for` com.denodo.vdb.vdbinterface.server.odbc.connection.queryTimeout` and modify the value. After saving the file you need to restart the VDP Sevrer from Denodo Platform Control Center in order for the modification to be applied. Please note by doing this method all ODBC connections will be affected. I hope this helps!
Denodo Team
08-03-2023 07:20:05 -0500
code
Again, Thank you very much for your detailed answer. But i tried all the client side combinations for setting the query timeout - odb and jdbc, and i 100% sure this is server side problem. One of our server administrator played with the configuration or something like that serval of months ago, and not it's not work. My question is: Is it possible to re-enable this feature in the server side? i guess the answer is yes, becaues if it can be disabled it must be enabled too. Have a good day.
user
12-03-2023 07:28:53 -0400
Hi, The server property `com.denodo.vdb.vdbinterface.server.odbc.connection.queryTimeout` is a property to set a **different default timeout for ODBC clients** from server side. However, the clients can still override the default by sending a different value for the queryTimeout (through the different methods as in the URI, as driver property or context clause). In addition to that, there is not a server property side in the first place to disable the queryTimeout parameters being taken into account from the clients as you are asking about. Notice that it also worked for you for the **Context Clause**. If you have a valid support user, I would recommend you to check this topic with the [Denodo Support](https://support.denodo.com/), since this seems to be something that requires deeper analysis. Hope this helps!
Denodo Team
13-03-2023 05:27:02 -0400
code
Interesting. Do you know how can i set this java class value? I do it from the denodo server GUI or using java code? Anyway, im now contacing the supporot. Thank for the help!
user
13-03-2023 06:45:41 -0400
Hi, there are two possibilities to change the setting of the VDP Server. The first one is to directly change the `DENODO_HOME\conf\vdp\VDBConfiguration.properties` file by modifying the value of `com.denodo.vdb.vdbinterface.server.odbc.connection.queryTimeout`. After you save the modification you need to restart the VDP server in order for the changes to be applied. The second option is to user the command SET which can be done only by denodo administrators. The correct syntax for changing a value is: `SET <property name:literal> = <value:literal>` . You need to restart the VDP server to apply the changes. Example: ` SET 'com.denodo.vdb.vdbinterface.server.odbc.connection.queryTimeout'='10';` Note that the value for this property is in milliseconds For more information, you can read the document [Changing Settings of Virtual DataPort and the Web Container](https://community.denodo.com/docs/html/browse/7.0/vdp/vql/advanced_characteristics/changing_settings/changing_settings). I hope this helps!
Denodo Team
14-03-2023 06:24:42 -0400
code
You must sign in to add an answer. If you do not have an account, you can register here