Watch, Follow, &
Connect with Us

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


Welcome, Guest
Guest Settings
Help

Thread: Program hangs when post using firedac



Permlink Replies: 6 - Last Post: Nov 6, 2016 7:32 AM Last Post By: John MacDonald
Peter Bailliere

Posts: 2
Registered: 6/7/02
Program hangs when post using firedac
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 13, 2016 12:08 AM
Hi all,

Wrote program using Firedac to connect to my tables.
Now they are using that program on several computers and I get into problems.

When they click on button the following action is done :

MainForm->FDQBewerk1->SQL->Clear();
MainForm->FDQBewerk1->SQL->Add("Select * from Klanten where Klantnummer = " + QuotedStr(MemKlantnr));
MainForm->FDQBewerk1->Active = true;
if (!MainForm->FDQBewerk1->IsEmpty())
{
MainForm->FDQBewerk1->Edit();
MainForm->FDQBewerk1->FieldByName("Klantnummer")->AsString = TxtKnr->Text;
MainForm->FDQBewerk1->Post();
}

And as soon as the post is executed my program hangs ...
I think it has something to do with updatesettings but I'm quite new in this ...

Plse you advise ...

Thanks in advance !!!!
Regards,
Peter

Dmitry Arefiev

Posts: 1,406
Registered: 12/7/03
Re: Program hangs when post using firedac
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 14, 2016 6:29 AM   in response to: Peter Bailliere in response to: Peter Bailliere
You can do the following:
* run your application from IDE;
* click button, so app will hang up;
* in IDE press Pause button;
* then analyze the main thread call stack or post it here.

--
With best regards,
Dmitry
John MacDonald

Posts: 179
Registered: 3/22/98
Re: Program hangs when post using firedac
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 22, 2016 9:24 AM   in response to: Dmitry Arefiev in response to: Dmitry Arefiev
I think I might have the same type of problem. I assumed I was doing something wrong.

I'm using FireDac and Interbase.

I expect to go through all the documentation/ video tutorials today.

Maybe you can suggest the right place to start. I want to create new records, edit information and then send the update to the database.


Dmitry Arefiev wrote:
You can do the following:
* run your application from IDE;
* click button, so app will hang up;
* in IDE press Pause button;
* then analyze the main thread call stack or post it here.

--
With best regards,
Dmitry

--
JMAC out
John MacDonald

Posts: 179
Registered: 3/22/98
Re: Program hangs when post using firedac
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 4, 2016 5:33 AM   in response to: Peter Bailliere in response to: Peter Bailliere
Hello Peter:

I'm not sure if you were able to get this sorted out.

I am also new to firedac. I'm moving a large project to interbase and firedac.

I have also dropped into this situation.

I am opening a form appending a record and filling in the record.
When I hit the post then the system appears to be in some kind of loop.

I have used the firedac monitor to see....

. isc_close_blob [blob_handle=$035EB188]
. isc_dsql_fetch [stmt_handle=$035E0434, dialect=3]
. isc_open_blob2 [db_handle=$096E13B8, tra_handle=$035D3B8C, blob_id.high=171, blob_id.low=13842]
. isc_blob_info [blob_handle=$035EB188, items="num_segments;max_segment;total_length;type"]
. isc_get_segment [blob_handle=$035EB188]
. isc_close_blob [blob_handle=$035EB188]
. isc_dsql_fetch [stmt_handle=$035E0434, dialect=3]
. isc_open_blob2 [db_handle=$096E13B8, tra_handle=$035D3B8C, blob_id.high=171, blob_id.low=13843]
. isc_blob_info [blob_handle=$035EB188, items="num_segments;max_segment;total_length;type"]
. isc_get_segment [blob_handle=$035EB188]
. isc_close_blob [blob_handle=$035EB188]
. isc_dsql_fetch [stmt_handle=$035E0434, dialect=3]
. isc_open_blob2 [db_handle=$096E13B8, tra_handle=$035D3B8C, blob_id.high=171, blob_id.low=13844]
. isc_blob_info [blob_handle=$035EB188, items="num_segments;max_segment;total_length;type"]
. isc_get_segment [blob_handle=$035EB188]
. isc_close_blob [blob_handle=$035EB188] ....

It just keeps going.

Perhaps when I insert a record I should use a command instead of a simple insert and then fill in from a form that has direct access to the data?

John

Peter Bailliere wrote:
Hi all,

Wrote program using Firedac to connect to my tables.
Now they are using that program on several computers and I get into problems.

When they click on button the following action is done :

MainForm->FDQBewerk1->SQL->Clear();
MainForm->FDQBewerk1->SQL->Add("Select * from Klanten where Klantnummer = " + QuotedStr(MemKlantnr));
MainForm->FDQBewerk1->Active = true;
if (!MainForm->FDQBewerk1->IsEmpty())
{
MainForm->FDQBewerk1->Edit();
MainForm->FDQBewerk1->FieldByName("Klantnummer")->AsString = TxtKnr->Text;
MainForm->FDQBewerk1->Post();
}

And as soon as the post is executed my program hangs ...
I think it has something to do with updatesettings but I'm quite new in this ...

Plse you advise ...

Thanks in advance !!!!
Regards,
Peter


--
JMAC out
John MacDonald

Posts: 179
Registered: 3/22/98
Re: Program hangs when post using firedac
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 4, 2016 9:17 PM   in response to: Peter Bailliere in response to: Peter Bailliere
Hello Peter:

Is you post being applied to a joined result set from more than one table?
I've read this is a known issue.

I believe that mine is tied up because the result set comes from two database tables.

- Of course the next step is to handle the individual posts, or write something and override the update record "TADUpdateSQL"

Good luck.

I will let you know how it works out.

John

Peter Bailliere wrote:
Hi all,

Wrote program using Firedac to connect to my tables.
Now they are using that program on several computers and I get into problems.

When they click on button the following action is done :

MainForm->FDQBewerk1->SQL->Clear();
MainForm->FDQBewerk1->SQL->Add("Select * from Klanten where Klantnummer = " + QuotedStr(MemKlantnr));
MainForm->FDQBewerk1->Active = true;
if (!MainForm->FDQBewerk1->IsEmpty())
{
MainForm->FDQBewerk1->Edit();
MainForm->FDQBewerk1->FieldByName("Klantnummer")->AsString = TxtKnr->Text;
MainForm->FDQBewerk1->Post();
}

And as soon as the post is executed my program hangs ...
I think it has something to do with updatesettings but I'm quite new in this ...

Plse you advise ...

Thanks in advance !!!!
Regards,
Peter


--
JMAC out
John MacDonald

Posts: 179
Registered: 3/22/98
Re: Program hangs when post using firedac
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 11, 2016 8:55 PM   in response to: Peter Bailliere in response to: Peter Bailliere
Hello Peter:
Do you have a primary key setup for the table?


Peter Bailliere wrote:
Hi all,

Wrote program using Firedac to connect to my tables.
Now they are using that program on several computers and I get into problems.

When they click on button the following action is done :

MainForm->FDQBewerk1->SQL->Clear();
MainForm->FDQBewerk1->SQL->Add("Select * from Klanten where Klantnummer = " + QuotedStr(MemKlantnr));
MainForm->FDQBewerk1->Active = true;
if (!MainForm->FDQBewerk1->IsEmpty())
{
MainForm->FDQBewerk1->Edit();
MainForm->FDQBewerk1->FieldByName("Klantnummer")->AsString = TxtKnr->Text;
MainForm->FDQBewerk1->Post();
}

And as soon as the post is executed my program hangs ...
I think it has something to do with updatesettings but I'm quite new in this ...

Plse you advise ...

Thanks in advance !!!!
Regards,
Peter


--
JMAC out
John MacDonald

Posts: 179
Registered: 3/22/98
Re: Program hangs when post using firedac
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 6, 2016 7:32 AM   in response to: Peter Bailliere in response to: Peter Bailliere
Hello Peter:

The post has to finalize the insertion of the data into the file. In my case, the sql that I was using had access to all the records.
The FireDac monitor revealed that the system was off on a wild trip looking for the appropriate spot to insert the data. Many fetches until the computer ran out of resources.....

You have not returned to this thread.

I post this in the case that you, or someone else, need the information.

John

Peter Bailliere wrote:
Hi all,

Wrote program using Firedac to connect to my tables.
Now they are using that program on several computers and I get into problems.

When they click on button the following action is done :

MainForm->FDQBewerk1->SQL->Clear();
MainForm->FDQBewerk1->SQL->Add("Select * from Klanten where Klantnummer = " + QuotedStr(MemKlantnr));
MainForm->FDQBewerk1->Active = true;
if (!MainForm->FDQBewerk1->IsEmpty())
{
MainForm->FDQBewerk1->Edit();
MainForm->FDQBewerk1->FieldByName("Klantnummer")->AsString = TxtKnr->Text;
MainForm->FDQBewerk1->Post();
}

And as soon as the post is executed my program hangs ...
I think it has something to do with updatesettings but I'm quite new in this ...

Plse you advise ...

Thanks in advance !!!!
Regards,
Peter


--
JMAC out
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02