Jump to content

Cancel spotfire session in Vertica DB with IronPython script


Aleksey Makarenko

Recommended Posts

Hello Support,

 

I'd like to be able to stop a long running report task.

I have found a solution to stop report's background tasks there:

https://community.spotfire.com/wiki/ironpython-script-cancel-background-tas...

Problem is that session remains open on the database side, which may affect performance.

I need to find a way to execute 2SQL queries from the same IronPython script:1-st to get current session ID and 2nd - to stop the session with this id.

Please calrify if it is possible to establish a connection to Vertica DB from anIronPython script.

 

Thank you.

Link to comment
Share on other sites

  • 2 weeks later...

Hello,

It is possible to communicate with a vertica database from python using an information link or the vertica odbc driver.

You can write a stored procedure to retrieve the session id based on the username or some other argument and then kill that session in the same stored procedure ,but just trigger this stored procedure from python with the required input.

 

Here is an article on how this can be achieved for reference-

 

http://analyticstipsntricks.blogspot.com/2014/02/spotfire-writing-back-to-database.html

 

Here is an example of database writeback/update using the odbc driver. This example used ms sql server as the backend database but you will need to customize it for vertica-

 

https://community.spotfire.com/wiki/how-write-back-database-tibco-spotfirer-using-ironpython-scripting

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...