Denodo community Q&A RSS feed Latest Denodo community questions Issue with rolling back transaction from exception in VQL Stored procedure 2024-04-23T19:52:28Z 2024-04-23T19:52:28Z I am creating a VQL stored procedure, but it is not rolling back when I catch an exception. I am following the example provided here: https://community.denodo.com/docs/html/browse/8.0/en/vdp/developer/developing_extensions/developing_stored_procedures/developing_vql_stored_procedures Here is the specific example I am following: CREATE OR REPLACE VQL PROCEDURE testTransactionsExceptionsHandling(paramName IN INTEGER) AS ( // Procedure variables varName VARCHAR; ) BEGIN // Procedure body BEGIN_TRANSACTION; // If insert fails (for whatever reason), EXCEPTION part will be executed INSERT INTO testnvarchar_1 (id,charfield) VALUES (3, 'Test'); COMMIT; EXCEPTION WHEN OTHERS THEN ROLLBACK; END; For my test I set the database up to fail on insert to test the rollback. In this example the one of the fields is too small, forcing an insert failure. Here is some simplified code that throws the exception: CREATE OR REPLACE VQL PROCEDURE sp_simple_rollback_exeption FOLDER = '/stored procedures'(varout out varchar) --output parameter isn't used. AS ( lvar varchar; -- exc1 exception; ) BEGIN BEGIN_TRANSACTION; delete from bv_targetexc; Execute 'insert into bv_targetexc select * from bv_source4'; commit; EXCEPTION WHEN others THEN -- when exc1 then return row (varout) values ('Error on insert'); ROLLBACK; END; Exception: SP_SIMPLE_ROLLBACK_EXEPTION [STORED PROCEDURE] [ERROR] Received exception with message 'Cannot rollback if transaction is not started.' Received exception with message 'java.lang.NullPointerException' I also set up a second version to catch the exception differently. This creates and exception variable instead of using "others". VQL SP Code CREATE OR REPLACE VQL PROCEDURE sp_simple_rollback_exeption FOLDER = '/stored procedures'(varout out varchar) --output parameter isn't used. AS ( lvar varchar; exc1 exception; ) BEGIN BEGIN_TRANSACTION; delete from bv_targetexc; Execute 'insert into bv_targetexc select * from bv_source4'; commit; EXCEPTION -- WHEN others THEN when exc1 then return row (varout) values ('Error on insert'); ROLLBACK; END; Exception: SP_SIMPLE_ROLLBACK_EXEPTION [STORED PROCEDURE] [ERROR] Received exception with message 'Error executing data movement from view _p_17d113c7-c86f-4faa-968e-1f646ee9e86d_2943d3b8-6968-4db9-947e-3b1cef9291b8 to source ds_pg_target Exception of plan _p_17d113c7-c86f-4faa-968e-1f646ee9e86d_2943d3b8-6968-4db9-947e-3b1cef9291b8: com.denodo.vdb.util.tablemanagement.TableManagerException: There was an error during a batch insertion: Batch entry 0 INSERT INTO "public".targetexc(customer_name, customer_address, phone_number, customer_code, job_title) VALUES ('Laura Gutierrez', '7751 Larry Junction', '356-(361)254-1886', 'qHzxXA0S', 'Web Designer IV') was aborted: ERROR: value too long for type character(10) Call getNextException to see other errors in the batch.' Note: The transaction will eventually roll back in both versions after it times out. This creates the following message in the logs [JotmBatch] ERROR 2024-04-23T13:49:38.562 com.denodo.vdb.engine.session.DBSession [] - executing rollback due inactivity timeout on session #395, transaction bb14:38:0:018c8f4f655f4db6ab...0a109e: I am looking to get the VQL Stored procedured to rollback immediately upon catching the exception and to return a graceful message to the caller. 2024-04-23T19:52:28Z Migrating from SSIS to Denodo 2024-04-23T07:18:46Z 2024-04-23T07:18:46Z Hi Team, Please note that i am part of Denodo migration from SSIS. Kindly need some support on create a denodo package based on SSIS package. I am starting my new package in production, need some assistance. 2024-04-23T07:18:46Z Unable to establish connection : IO Error: The Network Adapter could not establish the connection 2024-04-22T23:27:08Z 2024-04-22T23:27:08Z hi team (Unable to establish connection: IO Error: The Network Adapter could not establish the connection)it shows the previous error when trying to test connection in the training database it is not loading the data from oracle,the database url is jdbc:oracle:thin:@data-server:1521:xe which is a correct format 2024-04-22T23:27:08Z Denodo server is not starting 2024-04-22T10:28:15Z 2024-04-22T10:28:15Z Hi team I am unable to start most of the servers it says stopped when i start it(Data catalog and web tool servers) ,how can i fix this issue? 2024-04-22T10:28:15Z Check for other data sources type 2024-04-22T10:01:39Z 2024-04-22T10:01:39Z Hello, This is very interesting but unfortunately it doesn't cover all Denodo data sources types. Would it be possible to check other sources such as: JSON WS XML CUSTOM (this includes Excel data sources). DF (delimited files) WWW 2024-04-22T10:01:39Z Denodo Solution manager roles 2024-04-20T03:41:19Z 2024-04-20T03:41:19Z Hi Denodo experts, Scenario below: In the Denodo Dev and Stage environments we have a developer called db_1_admin who is an admin on a specific Denodo db called db_1. In the Solution manager, we have provided the stage promotion admin role. Because of this , the db_1_admin user is able to deploy VQL to the Stage environment to any database. That means, if the CONNECT DB db_1 command is missing from the VQL, then the solman automatically executes the VQL on the 1st available db in Stage , which this user should not have access to. Is there any role in Sol man that will allow a user to deploy only to their own dbs and not to other Denodo Dbs? Thanks. 2024-04-20T03:41:19Z Hiding columns that users cannot execute 2024-04-19T16:24:35Z 2024-04-19T16:24:35Z I have implemented column level security on a view. As expected when the restricted uers executes select * from the view they get an error message that says that they do not have privileges on certain columns. However, the user can see the columns that they do not have access to. Is there a way to prevent the user from seeing the columns that they do not have access to? 2024-04-19T16:24:35Z Returning a Select Statement in a VQL Stored Procedure 2024-04-19T16:01:32Z 2024-04-19T16:01:32Z Hi everyone. Simple question here. I want to create a VQL Stored Procedure that returns a Select Statement, how do I do it? I have searched through the Denodo documentation for this but haven't found any reference about it. Thanks in advance 2024-04-19T16:01:32Z Vdp-queries log generation 2024-04-19T09:18:03Z 2024-04-19T09:18:03Z Hello Team, We are aware that Denodo logs are produced in two directories: DENODO_HOME/logs/vdp and DENODO_HOME/tools/monitor/denodo-monitor/logs (when Denodo Monitor is running). The file "vdp-queries.log" exists in both locations mentioned above. However, vdp-requests.log is only generated in the Denodo Monitor directory and not in DENODO_HOME/logs/vdp. Please advise on in which case entries are generated in DENODO_HOME/logs/vdp/vdp-queries.log as well. Additionally, could you confirm if there is a log4j2.xml file for logs in DENODO_HOME/tools/monitor/denodo-monitor/logs? 2024-04-19T09:18:03Z VQL STORED PROCEDURE/INTERFACE VIEW 2024-04-19T08:53:31Z 2024-04-19T08:53:31Z Hi everyone, this is the SP that creates the view interface and it's intended to be created in the indicated database specified in the parameter. How can I do that? [quarta-feira 17:22] Diogo Goncalves - Passio Consulting CREATE OR REPLACE PROCEDURE create_interface_view ( vdb_name IN VARCHAR, derived_view_name IN VARCHAR, interface_name IN VARCHAR, prt OUT VARCHAR ) AS ( vdb VARCHAR; d_name VARCHAR; i_name VARCHAR; frst VARCHAR; decimals VARCHAR; radix VARCHAR; size VARCHAR; remarks VARCHAR; code VARCHAR; result VARCHAR; max_rows INTEGER; max_linha INTEGER; rown INTEGER; vql_inter VARCHAR; prt VARCHAR; CURSOR get_max_rows IS 'SELECT COUNT(*) FROM GET_VIEW_COLUMNS() WHERE input_database_name = :vdb AND input_view_name = :d_name'; CURSOR get_data IS 'SELECT CONCAT(column_name, '':'', column_vdp_type), column_decimals, column_radix, column_size, column_remarks, column_sql_type_code FROM GET_VIEW_COLUMNS() WHERE input_database_name = :vdb AND input_view_name = :d_name'; ) BEGIN vdb := vdb_name; d_name := derived_view_name; i_name := interface_name; max_linha := 1; vql_inter := '('; OPEN get_max_rows PARAMETERS (vdb, d_name) VALUES (vdb_name, derived_view_name); FETCH get_max_rows INTO max_rows; CLOSE get_max_rows; RETURN ROW (prt) VALUES (max_rows); OPEN get_data PARAMETERS (vdb, d_name) VALUES (vdb_name, derived_view_name); LOOP FETCH get_data INTO frst, decimals, radix, size, remarks, code; result := CONCAT(frst, ' (sourcetypedecimals = ''', decimals, ''', sourcetyperadix = ''', radix, ''', sourcetypesize = ''', size, ''', description = ''', remarks, ''', sourcetypeid = ''', code, ''')'); IF max_linha < max_rows THEN vql_inter := CONCAT(vql_inter, result, ','); ELSE vql_inter := CONCAT(vql_inter, result, ')'); END IF; max_linha := max_linha + 1; EXIT WHEN max_linha > max_rows; END LOOP; CLOSE get_data; vql_inter := CONCAT(interface_name, ' ', vql_inter, ' SET IMPLEMENTATION ', derived_view_name, ' FOLDER = ''/03 - business entities'''); RETURN ROW (prt) VALUES (vql_inter); EXECUTE 'CREATE OR REPLACE INTERFACE VIEW :param' PARAMETERS (param) VALUES(vql_inter); END 2024-04-19T08:53:31Z