Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 [PyQt] SSH port forwarding and connection to SQL Server in separate threads freezes
#21
(Nov-25-2019, 09:02 PM)Denni Wrote: Okay but I first wanted to take this one bite at time and make sure we are on the same page as we move forward -- if what I provided creates a solid usable connection to an sqlite3 database on your end -- and then you can use this class to connect to your database (since I cannot duplicate that specific aspect) -- then we will have that base stuff in place -- and then can move to the next piece
Using the code you have provided I opened the connection to SQL Server database and was able to retrieve data from a table. Of course I have made some small modification (uncommenting import of SQLAlchemy and duplicating CheckConnection method so it fits SQL Server environment).

Nevertheless the connection has been established but one again I must underline that in order to do it I have created a SSH Tunnel using PuTTY and then forward the SQL Server port so the connection is to localhost:1433.
Quote
#22
Okay so can you post your MUC so I can examine it -- or is the PuTTY stuff external to your code base?
silly American kah-nig-hit
Quote
#23
(Nov-27-2019, 04:23 PM)Denni Wrote: Okay so can you post your MUC so I can examine it -- or is the PuTTY stuff external to your code base?

PuTTY is external stuff. Using your code and mine to establish ssh connection and port forwarding and then establishing connection fails. As I said in my very first post. When I am trying to establish the connection to SQL Server with SSH connection and port forwarding running in separate thread the GUI freezes.
Quote
#24
okay so how are you implementing
1) The PuTTY connection (which establishes the SSH connection to the database?)
2) The communication from the program to the database via the PuTTY connection

Also have you tested this as a standalone process without a Thread -- aka you run the program it talks to the database through PuTTY and gets a reply? Nothing complicated and no GUI just straight python

Again just trying to make sure we are on the same page and just crossing my I's and dotting my T's
silly American kah-nig-hit
Quote
#25
(Dec-02-2019, 06:51 PM)Denni Wrote: okay so how are you implementing
1) The PuTTY connection (which establishes the SSH connection to the database?)
2) The communication from the program to the database via the PuTTY connection
The connection via PuTTY established port forwarding over SSH so the in order to talk to SQL Server I need to establish connection to localhost at 1433 port (PuTTY is forwarding remote port on which SQL Server listens to localhost)

(Dec-02-2019, 06:51 PM)Denni Wrote: Also have you tested this as a standalone process without a Thread -- aka you run the program it talks to the database through PuTTY and gets a reply? Nothing complicated and no GUI just straight python
Yes I did and it works without problem. The only thing I have not tried is to establish port forwarding over SSH and then connection to SQL Server without GUI. However I guess it should also use threading.
Quote
#26
(Dec-03-2019, 01:17 PM)jan_pips Wrote: Yes I did and it works without problem. The only thing I have not tried is to establish port forwarding over SSH and then connection to SQL Server without GUI. However I guess it should also use threading.

Okay I would suggest testing this without Threading and see if it works without a hitch then share the MUC (Minimal Usable Code) you used along with the MUC version of how you plan to implement the QThread as I think you are implementing the QThread incorrectly which is no fault of your own because Qt's Documentation is currently wrong on that as it is still showing PyQt4 way versus PyQt5 way
silly American kah-nig-hit
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  GUI freezes while executing a callback funtion when a button is pressed abi17124 5 850 Jul-10-2019, 12:48 AM
Last Post: FullOfHelp
  [Tkinter] tkinter freezes by clicking button Zatox11 33 7,618 Apr-10-2018, 09:03 AM
Last Post: Zatox11
  Running telnet loop freezes GUI reedhallen 1 1,175 Jan-27-2018, 10:24 PM
Last Post: j.crater
  Clock freezes - wx.python glib problem strongheart 3 1,642 Oct-10-2017, 03:36 AM
Last Post: strongheart

Forum Jump:


Users browsing this thread: 1 Guest(s)