Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 10 of 10 total
Thread Some guidance if you would..
Thu, Jan 24 2019 4:16 PMPermanent Link

Ian Branch

Avatar

Hi Team,
   I have the following piece of code..
{code}
 TJobTicketsForm.Create(Nil).ShowModal;
 //
 dmC.DBC1.CloseDataSets;
{code}

   I have a tool to monitor the open Apps & tables.
   When the JT form is opened there are 10 or so tables opened, including the Jobtickets table.

   After closing the JobTickets form and the CloseDatasets above, the JobTickets table is still open.

   If I do this..
{code}
 TJobTicketsForm.Create(Nil).ShowModal;
 //
 dmC.DBC1.CloseDataSets;
 dmC.DBC1.Close;
 dmC.DBC1.Open;
{code}
   the JT table is still left 'open'.

   If I do this..
{code}
 TJobTicketsForm.Create(Nil).ShowModal;
 //
 dmC.DBC1.CloseDataSets;
 dmC.DBE1.Close;
 dmC.DBE1.Open;
{code}
   then the jobtickets table is closed.

   What could possibly be holding open or opening the JT table after the first & second cases??

Regards & TIA,
Ian
Thu, Jan 24 2019 6:08 PMPermanent Link

Ian Branch

Avatar

I just had a thoughty...
The Jobtickets table is the only one opened ina Query, the remainder are Tables.
Wonder if there is a connection there??
Fri, Jan 25 2019 4:04 AMPermanent Link

Matthew Jones

Ian Branch wrote:

>   dmC.DBC1.CloseDataSets;
>   dmC.DBE1.Close;
>   dmC.DBE1.Open;

I don't think I understand what your code is showing fully here, but in the first example you are closing and then opening DBC1, and the table is open, and in the second you are closing DBC1 and opening DB*E*1 and it stays closed. So they are doing different things, and perhaps the table is attached to DBC1 and not DBE1?

--

Matthew Jones
Fri, Jan 25 2019 4:12 AMPermanent Link

Ian Branch

Avatar

Ahhh.  Sorry.  My Bad.
DBC1 is a TEDBDatabase.
DBE1 is a TEDBEngine.

Apologies.
Fri, Jan 25 2019 7:36 AMPermanent Link

Raul

Team Elevate Team Elevate

On 1/24/2019 4:16 PM, Ian Branch wrote:

> {code}
>    TJobTicketsForm.Create(Nil).ShowModal;
>    //
>    dmC.DBC1.CloseDataSets;
>    dmC.DBC1.Close;
>    dmC.DBC1.Open;
> {code}
>    the JT table is still left 'open'.

That seems to indicate the table is not open thru the DBC1 (database)

>    If I do this..
> {code}
>    TJobTicketsForm.Create(Nil).ShowModal;
>    //
>    dmC.DBC1.CloseDataSets;
>    dmC.DBE1.Close;
>    dmC.DBE1.Open;
> {code}
>    then the jobtickets table is closed.

This does an engine stop and start so that makes sense since everything
is disconnected

>
>    What could possibly be holding open or opening the JT table after the first & second cases??
>

Since everything else closes i don't think it's KeepTables open setting
so i'm thinking you have JT open thru some other connection as well - do
you use any IDE components that don't use DBC1 etc.

Raul
Fri, Jan 25 2019 3:41 PMPermanent Link

Ian Branch

Avatar

Raul wrote:

> Since everything else closes i don't think it's KeepTables open setting so i'm thinking you have JT open thru some
> other connection as well - do you use any IDE components that don't use DBC1 etc

Hi Raul,
   There is only one Engine/Session/Database in the App.
   I wasn't aware that a Query could be open without connection to a Database.
   What sort of IDE components could open/keep open a Query?
Ian
Fri, Jan 25 2019 3:44 PMPermanent Link

Ian Branch

Avatar

It occurred to me that when you refer to 'IDE components' I may not be thinkingthe same thing as you??
Tue, Jan 29 2019 10:49 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Ian,

<< I wasn't aware that a Query could be open without connection to a Database. >>

It can - you can have a TEDBQuery component that is attached to a session via its SessionName property, but is specifying a DatabaseName property that refers to an existing EDB database (by name), but not an existing TEDBDatabase component.  In such a case, EDB will silently use a *temporary* TEDBDatabase component that is different from your explicit TEDBDatabase component.

An easy way to test this is to call this method on your TEDBSession component instance:

https://www.elevatesoft.com/manual?action=viewmethod&id=edb2&product=rsdelphiwin32&version=10R&comp=TEDBSession&method=DropConnections

If that closes the table, then what I described above is what is happening.

Tim Young
Elevate Software
www.elevatesoft.com
Tue, Jan 29 2019 4:07 PMPermanent Link

Ian Branch

Avatar

Hi Tim,
   I tried the EDBSession.DropConnections, it didn't work.
   I also turned off EDBSession.KeepConnections, same result.
   I then tried turning off EDBDatabase.KeepConnections, same result.
   Any other thoughts?
Regards,
Ian
Tue, Jan 29 2019 6:18 PMPermanent Link

Raul

Team Elevate Team Elevate

On 1/29/2019 4:07 PM, Ian Branch wrote:
>    I tried the EDBSession.DropConnections, it didn't work.
>    I also turned off EDBSession.KeepConnections, same result.
>    I then tried turning off EDBDatabase.KeepConnections, same result.
>    Any other thoughts?

How about just looping thru and brute force finding it ?

Start with Engine.Sessions
- for each session in engine
-- for each databases in session
--- loop thru each dataset  and check if it's open
--- if you find open one just log the session and database

Raul
Image