Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Does BCP v5.0 offer asynchronous queries


This question is answered.


Permlink Replies: 3 - Last Post: Mar 3, 2017 3:44 AM Last Post By: Andy Stobirski
Andy Stobirski

Posts: 18
Registered: 6/12/16
Does BCP v5.0 offer asynchronous queries  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 6, 2016 4:27 AM
Hi All

I've started work on an old system written in C++ builder v 5, and am getting to grips with it.

My question is does v5 offer asynchronous queries: currently, the application "freezes" whilst a big db fetch is going on, and I would like to offer some kind of progress indicator and cancel button.

If this is not possibly, could anyone suggest how I might be able to give user feedback and a cancel option using a standard TQuery?

Cheers

Edited by: Andy Stobirski on Jul 6, 2016 5:47 AM
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: Does BCP v5.0 offer asynchronous queries [Edit]
Correct
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 6, 2016 10:17 AM   in response to: Andy Stobirski in response to: Andy Stobirski
Andy wrote:

My question is does v5 offer asynchronous queries: currently,
the application "freezes" whilst a big db fetch is going on

Move the query to a worker thread.

and I would like to offer some kind of progress indicator and cancel button.

You can't cancel a query while it is busy (short of closing the DB connection),
but if you have multiple queries then you can stop in between queries, as
well as update progress status.

--
Remy Lebeau (TeamB)
Andy Stobirski

Posts: 18
Registered: 6/12/16
Re: Does BCP v5.0 offer asynchronous queries [Edit]  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 11, 2016 8:32 AM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
That's extremely helpful. Thank you for taking the time to reply.
Andy Stobirski

Posts: 18
Registered: 6/12/16
Re: Does BCP v5.0 offer asynchronous queries [Edit]  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 3, 2017 3:36 AM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Hi

I've just gotten started with the thread based work (lots of other stuff cropped up) and am feeling my way around the subject.

Do I need to create a new thread each time I need to access data, or do I just create one thread and repeatedly execute it with the appropriate parameters when I need data access? The database access has a whole load of initialisation code required, so in the case of the former option it would mean calling this many times...?

Any advice or tips would be greatfully recieved.

Andy

Remy Lebeau (TeamB) wrote:

Andy wrote:

My question is does v5 offer asynchronous queries: currently,
the application "freezes" whilst a big db fetch is going on

Move the query to a worker thread.

and I would like to offer some kind of progress indicator and cancel button.

You can't cancel a query while it is busy (short of closing the DB connection),
but if you have multiple queries then you can stop in between queries, as
well as update progress status.

--
Remy Lebeau (TeamB)

Edited by: Andy Stobirski on Mar 3, 2017 3:37 AM

Edited by: Andy Stobirski on Mar 3, 2017 3:42 AM
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02