1) when I change date in calendar, then connection is wasted - (exception: lost connection to MySQL server during query). Why ?
2) How to cooperate AsString cast with TFormatSettings in TMyQuery object ? For example: I select decimal field from DB and I'd like that result of method AsString depends of TFormatSettings.DecimalSeparator.
3) I am projecting multi-thread application:
Is MyDAC thread-safe in 100% ? Ofc each thread has own instance of TMyConnection and connection is assigned by procedure (AssignConnect)
3 Question: Thread, TFormatSettings, Change windows date
-
AndreyZ
Hello,
1. I cannot reproduce the problem. Please try composing a small sample to demonstrate the problem and send it to andreyz*devart*com.
2. You can manage the result of the AsString function by using the DecimalSeparator global variable. Also you can use the TNumericField.DisplayFormat property that determines how a numeric field value is formatted for displaying in a data-aware control. For more information please read Delphi Reference Manual.
3. The best way to work in a multithreaded application is to have a separate connection in each thread. In this case your application will be thread-safe.
1. I cannot reproduce the problem. Please try composing a small sample to demonstrate the problem and send it to andreyz*devart*com.
2. You can manage the result of the AsString function by using the DecimalSeparator global variable. Also you can use the TNumericField.DisplayFormat property that determines how a numeric field value is formatted for displaying in a data-aware control. For more information please read Delphi Reference Manual.
3. The best way to work in a multithreaded application is to have a separate connection in each thread. In this case your application will be thread-safe.
It's very simple to reproduce it.
In each version of MyDAC it appeared.
//user root
//pass - Your pass
//schema - mysql
1) Execute this action, is OK !
2) Don't close application(TMyConnection), change Year(2010->2011) in Windows calendar and click button again
3) exception...................
btw.
Using globally variables like DecimalSeparator is deprecated by Delphi XE
In each version of MyDAC it appeared.
//user root
//pass - Your pass
//schema - mysql
Code: Select all
procedure TForm1.Button1Click(Sender: TObject);
begin
myquery1.SQL.Text := 'select user from user';
try
myquery1.Open;
except on E: Exception do
begin
showmessage(e.Message);
myquery1.Close;
end;
end;
showmessage(myquery1.Fields[0].AsString);
myquery1.Close;
end;1) Execute this action, is OK !
2) Don't close application(TMyConnection), change Year(2010->2011) in Windows calendar and click button again
3) exception...................
btw.
Using globally variables like DecimalSeparator is deprecated by Delphi XE
-
AndreyZ
I have reproduced the problem. This is a MySQL problem and not MyDAC. You can check this using any other client, for example, MySQL Command Line Client. It seems that MySQL server closes connection by timeout. In this case the time difference between two queries is one year. Server takes it as inactivity time and closes connection.
-
eduardosic
- Posts: 387
- Joined: Fri 18 Nov 2005 00:26
- Location: Brazil