Issue of kbmMWClientQuery.AutoFieldDefsOnOpen property.

Home Forums kbmMW Issue of kbmMWClientQuery.AutoFieldDefsOnOpen property.

Viewing 3 reply threads
  • Author
    Posts
    • #55110
      TomYU
      Participant

      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!

       

       

      • This topic was modified 5 years, 2 months ago by TomYU.
    • #55126
      kimbomadsen
      Keymaster

      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.

      • This reply was modified 5 years, 2 months ago by kimbomadsen.
    • #55130
      tomyu666
      Participant

      Hi, Kim

      It works as i would expect. and let’s me looking forward to the next version.

      Thank you!

       

      • This reply was modified 5 years, 2 months ago by tomyu666.
    • #55204
      TomYU
      Participant

      hi,kim

      5.13 fixed! Thank you.

      Best regards

      TomYU.

Viewing 3 reply threads
  • You must be logged in to reply to this topic.