|
|
导航: |
论坛 -> DELPHI技术
斑竹:liumazi,sephil |
|
作者: |
tiez (骑牛夜旅) |
★☆☆☆☆ |
-
|
普通会员 |
|
2016/7/22 10:31:55 |
标题: |
提交到Remobjects的bug有回应了 |
浏览:1403 |
|
加入我的收藏 |
楼主: |
DA使用command的方式操作数据时,有一个参数组不自动释放导致的内存泄漏的BUG,上周日提交到Remobjects Talk后,官方将这个BUG收录了,并在很短时间内解决了这个问题。 问题的表现是这样的: project: %DAPath%\RemObjects Samples\Data Abstract for Delphi\Commands.dpr unit: fClientDataModule.pas lines: 101-125
function TClientDataModule.UpdateClient(aClientID: integer; aClientName: string; aClientDiscount: double; aClientEmail, aClientPassword: string; aClientBirthdate: DateTime; aClientPhone, aClientPostalCode, aClientAddress, aClientNotes: string): Boolean; var ldp: DataParameterArray; lp: DataParameter; begin ldp := DataParameterArray.Create; try lp := ldp.Add; lp.Name := UTF8Encode('ClientName');lp.Value := aClientName; lp := ldp.Add; lp.Name := UTF8Encode('ClientDiscount');lp.Value := aClientDiscount; lp := ldp.Add; lp.Name := UTF8Encode('ClientEmail');lp.Value := aClientEmail; lp := ldp.Add; lp.Name := UTF8Encode('ClientPassword');lp.Value := aClientPassword; lp := ldp.Add; lp.Name := UTF8Encode('ClientBirthdate');lp.Value := aClientBirthdate; lp := ldp.Add; lp.Name := UTF8Encode('ClientPhone');lp.Value := aClientPhone; lp := ldp.Add; lp.Name := UTF8Encode('ClientPostalCode');lp.Value := aClientPostalCode; lp := ldp.Add; lp.Name := UTF8Encode('ClientAddress');lp.Value := aClientAddress; lp := ldp.Add; lp.Name := UTF8Encode('ClientNotes');lp.Value := aClientNotes; lp := ldp.Add; lp.Name := UTF8Encode('OLD_ClientID');lp.Value := aClientID; Result := RemoteCommand.Execute('Clients_UPDATE',ldp) > 0; finally ldp.Free; end; end; 官方的回复是这样的: Thanks, logged as bugs://75697 bugs://75697 got closed with status fixed. 大家临时先用以下方法解决: update uRODynamicRequest.pas as procedure TRODynamicRequest.DoReadParams(aMessage: IROMessage; aParams: TRORequestParamCollection);
procedure _ReadParam(aParam: TRORequestParam); ... aParam.AsComplexType := vobj; aParam.OwnsComplexType:=True; // added ... 如果你们是测试版用户,那么可能没有DA的源代码,那么请按以下方法使用也可绕过这个问题: Result := RemoteCommand.Execute('Clients_UPDATE',ldp) > 0; RemoteCommand.ExecuteCall.ParamByName(RemoteCommand.ExecuteCall.IncomingParametersParameter).OwnsComplexType := true; //<<<<
----------------------------------------------
- |
作者: |
|
2016/7/22 11:44:09 |
1楼: |
好贴要顶。
----------------------------------------------
(C)(P)Flying Wang
|
作者: |
|
2016/7/30 15:41:14 |
2楼: |
DA 很厉害!
----------------------------------------------
kittyapp
|
作者: |
|
2016/7/30 17:41:19 |
3楼: |
很好,LZ辛苦!
----------------------------------------------
向你学习
|
|