#1  
Old 23rd February 2024, 11:29 PM
JackT JackT is offline
Junior Member
 
Join Date: Jul 2023
Posts: 6
Default TnxWinsockTransport closing

I am having a problem with a TnxWinSockTransport closing, during the execution of my program. My NexusDB Database server 4.70 closes it's connection to my TnxWinSockTransport control in a data module inside my program.
I think this is happening because my program is doing a lot of number, crunching, processing a data stream and computing FFTs on the fly and displaying them graphically so the TnxWinSockTransport does not get enough time to send it's heart beat signal.
However all the number crunching and drawing is going on a separate thread.

With regards to the TnxWinSock transport

I read the OnConnectionLost event is not fired because it's a legacy feature that is not hooked up in code.

Also I am checking that the TnxWinSock transport is open by testing the Connected property which returns True, but the program promptly throws an exception the next time I try to perform a database operation saying the remote host closed the connection.

Is there a way to check if the connection is still open before attempting to run a database query ?
  #2  
Old 24th February 2024, 12:59 AM
David Rose
 
Posts: n/a
Default Re: TnxWinsockTransport closing

On 23/02/2024 13:29, JackT wrote:

Have you tried setting

nxWinsockTransport1.Heartbeatinterval := 0;

in the client - i.e no Heartbeat and see if the same issue occurs.

David
>


  #3  
Old 24th February 2024, 01:59 AM
JackT JackT is offline
Junior Member
 
Join Date: Jul 2023
Posts: 6
Default

At the moment I am running the database server on the same PC as the client because I am developing my software. If the database is deployed to a server there might a legitimate reason for a disconnection so I need to handle that situation as well. I am just looking for a command or function that can refresh the server status and report back whether it is still connected.
  #4  
Old 24th February 2024, 02:40 AM
David Rose
 
Posts: n/a
Default Re: TnxWinsockTransport closing

On 23/02/2024 15:59, JackT wrote:
I am just looking for a command
> or function that can refresh the server status and report back whether
> it is still connected.
>

OIC.

We do it via Exceptions i.e we use MadExcept and in the default global
exception handler

if EnxDatabaseError(exceptIntf.ExceptObject).ErrorCod e =
DBIERR_SERVERCOMMLOST then

  #5  
Old 24th February 2024, 02:54 AM
JackT JackT is offline
Junior Member
 
Join Date: Jul 2023
Posts: 6
Default

Thanks - It looks like it has to be handled in a global exception handler. I have tried opening and closing the session and the engine but the error persists so it looks like I will have to destroy the data module with all the TNX components inside it and recreate it. It doesn't seem like a very elegant solution.
  #6  
Old 24th February 2024, 01:09 PM
Eivind
 
Posts: n/a
Default Re: TnxWinsockTransport closing

> Is there a way to check if the connection is still open before
> attempting to run a database query ?


It is pointless to do so, as the connection can drop between the time
you check and running the query.

--
Eivind Bakkestuen [NDD]
  #7  
Old 24th February 2024, 01:13 PM
Eivind
 
Posts: n/a
Default Re: TnxWinsockTransport closing

> Thanks - It looks like it has to be handled in a global exception
> handler. I have tried opening and closing the session and the engine
> but the error persists so it looks like I will have to destroy the
> data module with all the TNX components inside it and recreate it. It
> doesn't seem like a very elegant solution.


If the connection drops, the safest way to recover is to treat it the
same as a fresh program start, because the server may have discarded
query results, table filters and ranges, etc.

Having said that, since you are mentioning testing client and server on
the same machine and still losing connection, I'd suggest a closer look
at the use of threads in the client.

--
Eivind Bakkestuen [NDD]
  #8  
Old 26th February 2024, 07:59 PM
David Rose
 
Posts: n/a
Default Re: TnxWinsockTransport closing

On 24/02/2024 03:09, Eivind wrote:
>> Is there a way to check if the connection is still open before
>> attempting to run a database query ?

>
> It is pointless to do so, as the connection can drop between the time
> you check and running the query.
>


We have 100's of NX user around the world running 24 x7 for the past 10
years and I don't think I've ever come across a connection lost issue
other than a genuine error e.g server has crashed, someone pulled the
network cable etc.
If you're getting it in your application then either you have a bug in
your code or you're exposing a bug in the Nexus code. Either way might
be good to try and build a small app that reproduces the issue.

David
  #9  
Old 26th February 2024, 09:10 PM
Thorsten Engler [NDA]
 
Posts: n/a
Default Re: TnxWinsockTransport closing

Or... and hear me out here... there may actually be a network issue... hard to
believe, I know.

David Rose wrote:

> We have 100's of NX user around the world running 24 x7 for the past 10 years
> and I don't think I've ever come across a connection lost issue other than a
> genuine error e.g server has crashed, someone pulled the network cable etc.
> If you're getting it in your application then either you have a bug in your
> code or you're exposing a bug in the Nexus code. Either way might be good to
> try and build a small app that reproduces the issue.

  #10  
Old 26th February 2024, 11:04 PM
David Rose
 
Posts: n/a
Default Re: TnxWinsockTransport closing

On 26/02/2024 11:10, Thorsten Engler [NDA] wrote:
> Or... and hear me out here... there may actually be a network issue... hard to
> believe, I know.


Nah. Those kind of things never happen....

David



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Get my local IP from an active TnxWinsockTransport HugoGalindo nexusdb.public.support 6 27th May 2015 01:32 PM
TnxWinsockTransport hangs Stephen Craig nexusdb.public.support 1 24th September 2008 07:20 AM
TnxWinsockTransport.OnConnectionLost Dennis Landi nexusdb.public.support 6 23rd October 2007 06:57 AM
TnxWinsockTransport - enable access by IP Alexander Telegin nexusdb.public.support 5 20th December 2005 10:19 PM
TnxWinsockTransport property Germain Cassiere nexusdb.public.discussions 1 1st September 2003 11:38 AM


All times are GMT +11. The time now is 06:10 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.