Wednesday, January 27, 2010

WDDX in ColdFusion 9

So, I have been using CF8 and Flex 3 to build an application. I am getting to the point of having a stable 1.0 release, and as such, I am looking forward to the second phase of the project. The second phase is going to be based on a new database architecture, and as such, I thought that it would be a good time to flip everything to Flex 4 and CF9, so that I can take advantage of some of the DCD features of Flex 4 and the ORM features of CF9.

In some preliminary testing, I have run into the following issue:

I make good use of ColdFusion Reports (CFRs) in the current release, and I pass a query object that is built and passed into the CFR from a constructing component. When the system has created the query object, and the user flags it as a 'passed' report, the query is stored into the Database as a WDDX encoded object. This of course will allow me at a later time to do other actions on the object if needed, as I can just extract the data and convert it back to CFML, and I will have a Query Object in my code to work with and pass to the CFR.

Anyways, over the holidays, I formatted my system, and started over, and at that time I decided that I would be using CF9 as my main Development CF engine, as opposed to CF8. Last week, I was fine-tuning my read/write routine, and adding some flags as to WHEN those things would happen, and I ran into a roadblock. I created the query just fine and sent it to the CFR where it was rendered properly. I took the same Query and converted it to WDDX and saved it to the DB, then retrieved it and converted back to a Query Object and the CFR fails with an extra '<'. Now, dumping the query, it looks fine, so I can't say where the error is occurring. The real kicker of course, is that the code works fine on CF8. It will convert to WDDX and back again with no issues from the CFR.

I have filed a bug (81726) and would appreciate some votes for this. This bug will stop me from going to CF9. I guess I need to test out converting the query to JSON, but I thought that JSON did not keep its CF type when converted back, and everything would come out as a struct, when I need a query. Any suggestions?


1 comment:

  1. Are you able to produce some sample code we can try?