- This topic has 3 replies, 3 voices, and was last updated 5 years, 1 month ago by .
Viewing 3 reply threads
Viewing 3 reply threads
- You must be logged in to reply to this topic.
hi,kim
I set kbmMWClientQuery.AutoFieldDefsOnOpen=mwafoOnce and the Field object is rebuilt after each ClientQuery.Open.
I had to write a helper class and rewrite the Open method.
TkbmMWClientQueryHelper = class helper for TkbmMWClientQuery
procedure Open;
end;
procedure TkbmMWClientQueryHelper.Open;
begin
inherited Open;
if Self.AutoFieldDefsOnOpen=mwafoOnce then
Self.Fields.LifeCycles:= [lcPersistent];//持久化字段定义,避免重建字段
…
end;
This is very annoying, every unit that uses ClientQuery must uses the unit where the helper class is located.
If kbmMWClientQuery.Open does not rebuild the Field object when AutoFieldDefsOnOpen=mwafoOnce, smartbind will work better.
Looking forward to your implementation in the new version。
thanks!
Hi,
Can you try to change InternalCreateFieldsOnOpen in kbmMWCustomConnectionPool.pas to this:
procedure TkbmMWCustomPooledDataSet.InternalCreateFieldsOnOpen;
begin
inherited;
if AutoFieldDefsOnOpen=mwafoOnce then
Fields.LifeCycles:=[lcPersistent];
end;
and report back if it works as you would expect. Then that would be the suggested solution.
hi,kim
5.13 fixed! Thank you.
Best regards
TomYU.