开发者

Nesting datasets with TClientdatasets in more than two levels?

I would like to know if it is possible to nest a dataset within a dataset and then nest this data set with in another dataset. Therfore 3 levels of nesting. Currently I only manage to nest one dataset with in the other. When attemting to nest the third level the database manages to run successfully the first time I compile my program and I am able to enter data. When I then attempt to run the program the second time I an execption raised by EDBClient with message开发者_运维问答 "mismatch in datapacket".

So I would like to know is it possible to nest 3 levels of datasets within each other?

Kind regards Riaan


Short story:

Try it with Delphi XE... for my nowadays main project this resolved the bug.

Long story:

I faced the same problem you have with 3 or more levels of nested datasets when there's any error on the database side with Delphi 2010.

The previous last version I heavily used was Delphi 2007 without problems, so there's a chance the bad behavior was introduced in Delphi 2009 or Delphi 2010.

I traced this problem down to midas.dll on the client side, and it happens no matter if you're linking midas statically using MidasLib. Midas "thinks" the packet it receives from the server is malformed, and raises the exception. This exception breaks the "normal" error reconcile process, so there's no way to try to recover from an error: OnReconcileError never fired and the process is aborted due to the lack of try/except blocks inside this part of the VCL.

I'm sure it was a bug, but not if it happens on the server or on the client side, When I was working to produce a project to put a support ticket, while trying to reduce it to the minimum possible, it happens Delphi XE was released and I'm under SA, so I get it the last minute.

Download, Install, configure... then, I compiled my to support project and everything worked fine. I compiled my main project: the one where I was facing real problems with the users because of this and the fact I use to raise exceptions in database triggers and stored procedures due to last second validations or state/condition changes. Everything worked fine. The user is receiving meaningful error messages and the application recovered his ability to perform data-transformations and retries on the fly, or to ask the user what to do in some circumstances.

Sorry, I found no workaround during my efforts to diagnose and report this problem to Embarcadero, maybe someone else can help you better without suggesting to upgrade.


Simple answer is yes, you can have three levels of datasets nested within each other. I have examples of ClientDataSets where the nesting goes down 6 levels. In fact, I do not think there is a limit to the depth of nesting, other than that imposed by memory constraints.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜