Problem with FetchAll = False and transactions

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
tmezzena@gmail.com
Posts: 6
Joined: Fri 16 Dec 2005 22:33

Problem with FetchAll = False and transactions

Post by tmezzena@gmail.com » Tue 03 Jan 2006 22:51

Why does the TMyQuery create a new(internal) connection to get values on FetchAll = False? I've had problems with transactions... I update some values but I can't get them on transaction...

Can I set some property to cancel this creation?

Tato.

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Wed 04 Jan 2006 14:38

It's impossible due to MySQL server protocol restrictions. You can read details in MyDAC help.

tmezzena@gmail.com
Posts: 6
Joined: Fri 16 Dec 2005 22:33

Post by tmezzena@gmail.com » Thu 05 Jan 2006 22:21

Hi,

I create a new class of TMyQuery and I put the code above in constructor create:

Unidirectional := True;
FIRecordSet.SetProp(prCreateConnection, False);

It seems that this solve my problem, but I've not tested it on totality. I'm not using thread and I only open TMyQuery, populate other dataset, and close TMyQuery. I don't connect controls on TMyQuery. Unidirectional(FetchAll=False) property is important to save memory.

Could I have future problems?

Sorry for my poor english.

Thank's

Tato.

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Fri 06 Jan 2006 10:43

> Could I have future problems?

Yes, it's possible. MyDAC wasn't developed to work in this situation.

tmezzena@gmail.com
Posts: 6
Joined: Fri 16 Dec 2005 22:33

Post by tmezzena@gmail.com » Sat 07 Jan 2006 13:22

Hi,

I want to read all data from a big select, consuming less memory as possible, with a good speed. I don't have plugged controls. Resuming: Select, read and close... But I have to use transactions, locks, etc... in this environment.
Which is the best practice for it using MyDac?

Thank's,

Tato.

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Tue 10 Jan 2006 12:22

Try to use MyConnection.Pooling.

Post Reply