tag:blogger.com,1999:blog-7213413503669204352024-03-14T01:12:53.972+05:30ColdFusion...AIR...Flex...ColdFusion...AIR...Flex...This blog is for presenting my views on ColdFusion, Flex, AIR etc..etc..I work on these technologies day in day out at Adobe@Bangalore...so thought of sharing my views with folks out there working on similar lines. Hoping it will be useful.<br> <i>NOTE: This is my personal blog, and the opinions and statements voiced here are my own.</i>Jayesh Viradiyahttp://www.blogger.com/profile/15200995560853101319noreply@blogger.comBlogger13125tag:blogger.com,1999:blog-721341350366920435.post-91704335038017645472012-12-09T00:49:00.001+05:302012-12-09T00:56:01.587+05:30Get Set Ready to Gamify yourself with the New Flash Builder 4.7 !!<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://www.adobe.com/in/products/flash-builder.html" target="_blank"><img border="0" height="239" nea="true" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEilT50pfw77DOXGRVz29C95SEAQ7mvMZ6B4_rV7EDvbIMJl3jUEr3pn3XhjmDp9UvVE2rseyqiHClclpH3nagb9M4kKjXG7SvghyphenhyphenM5wf1QZT8N1cZr2yh0uyf9AxUEOI-XQnGKw9yaWLHg2/s640/fb4_7-marquee-family_940x532.jpg" width="640" /></a></div>
<br />
<br />
It was never so easy to Devlope Once / Publish / Monetize Games, across platforms, be it on iOS or Android or Browsers, without having a need to learn any new language set.<br />
<br />
<br />
With the recelty launched Flash Builder 4.7, envelope has been pushed further, as it gives an immense thrust to Social Casual gmaing arena, be it on Facebook or any oher social pltform. With this you can not just develope flash games using ActionScript, but it also lets you exploit native libraries for various platforms opening up the limitless opportunity to extend and build. FB4.7 as well supports creation and publishing of games built using variour gaming frameworks like Starling, Away3D, Feathres etc. <br />
<br />
<br />
FB4.7 also offers support for multi threading, Deploy/ Debug and Test environment for your Games, either through simulator or on a real Apple iOS or any Android Device. <br />
<br />
<br />
What else !!, it lets you build stuffs faster using next generation actionscript compiler along with addition of many IDE productivity features to be more productive in less time, also lets you continue build your RIA usign Open Source Apache Flex framewrok. <br />
<br />
<br />
If you can't wait any more to explore Game Development possibilities with new Flash Builder 4.7, do check out following important resources.<br />
<br />
<a href="http://www.adobe.com/devnet/games/getting-started-games.html" target="_blank">http://www.adobe.com/devnet/games/getting-started-games.html</a><br />
<a href="http://www.adobe.com/in/products/flash-builder/features.html" target="_blank">http://www.adobe.com/in/products/flash-builder/features.html</a><br />
<a href="http://www.adobe.com/devnet/games.html" target="_blank">http://www.adobe.com/devnet/games.html</a><br />
<a href="http://gaming.adobe.com/showcase/" target="_blank">http://gaming.adobe.com/showcase/</a><br />
<a target="_blank" href="http://gaming.adobe.com/technologies/">http://gaming.adobe.com/technologies/</a><br />
<a href="http://gaming.adobe.com/" target="_blank">http://gaming.adobe.com/</a><br />
<a href="http://www.hsharma.com/" target="_blank">http://www.hsharma.com/</a><br />
<br />
<br />
And not to miss out on, icing on the cake....if you have FB4.5/FB4.6 licensed copy, you get a FREE upgrade to FB4.7 via techsupport request !!<br />
<br />
Happy Gaming !! </div>
Jayesh Viradiyahttp://www.blogger.com/profile/15200995560853101319noreply@blogger.com18tag:blogger.com,1999:blog-721341350366920435.post-89542300271702718112010-08-06T10:47:00.008+05:302010-08-07T21:05:35.168+05:30CFUnited 2010 - A picture is worth a thousand words !!<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9bAEh_xBJFBMZgLWhnDRBmqPdbPgCZqmId6FD77QF7SsLT5PXUvOwnYGfpPU0SUn1QlkgGKbiW70xGTHBTW3c4Q0KKgUhr4mDbdDdeKLNY72dw3yh4vp4W8kjGsxKhNNe-KLUzCpEb7Ez/s1600/CFUnited2010.jpg"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9bAEh_xBJFBMZgLWhnDRBmqPdbPgCZqmId6FD77QF7SsLT5PXUvOwnYGfpPU0SUn1QlkgGKbiW70xGTHBTW3c4Q0KKgUhr4mDbdDdeKLNY72dw3yh4vp4W8kjGsxKhNNe-KLUzCpEb7Ez/s1600/CFUnited2010.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5502687726741054002" /></a>Jayesh Viradiyahttp://www.blogger.com/profile/15200995560853101319noreply@blogger.com29tag:blogger.com,1999:blog-721341350366920435.post-51721593449593457962010-08-05T18:56:00.003+05:302010-08-05T19:16:11.812+05:30ColdFusion powered "ActionScript ORM" article on Adobe Devnet - Now Live !!Though I might be late to blog on my Adobe Devnet article on "ActionScript ORM" that has been recently published but nevertheless...here it is. <br /><br /><a href="http://www.adobe.com/devnet/coldfusion/articles/offline_air_orm.html">http://www.adobe.com/devnet/coldfusion/articles/offline_air_orm.html</a><br /><br />This article is in-line with the "ActionScript ORM" session that I conducted in this year's CFUnited. This article, as learning follow up activity to my session, provides the Demo application that I had demonstrated. <br /><br />BTW, This being my first CFUnited, I was pretty impressed with the conference, the kind of participation and most importantly the passion and spirit that CF community shares,"I love CF", "CF Rocks" ,"CF will never die" spirit, is awesome!! This event turned out to be a very good learning experience for me and I am sure it would be back in one or other form in near future.Jayesh Viradiyahttp://www.blogger.com/profile/15200995560853101319noreply@blogger.com19tag:blogger.com,1999:blog-721341350366920435.post-34960152043730940402010-07-22T12:12:00.004+05:302010-07-23T01:41:33.239+05:30Jayesh @ CFUnited 2010<a href="http://cfunited.com/2010/speakers/1099-jayesh-viradiya"><img src="http://cfunited.com/2010/images/125x125_speaker_badge.jpg" border="0" /></a><div><br /></div><div><a href="http://cfunited.com/"></a>I am super excited for my first CFUnited ever this year, where I will be talking on how to Develop AIR Offline applications using CF901 ActionScript ORM library. <div><br /></div><div><i><b>Who should attend my session?</b> </i></div><div><br /></div><div>ActionScript Developers who are interested developing AIR Offline applications but dont like dealing with SQL statements on client side, replicating the server DB on client, tracking offline data changes and handling conflicts. One can handle all these things very easily by use of ActionScript ORM library which is part of CF901. You would learn how to leverage "cfair.swc" library for developing such AIR offline applications.</div><div><br /></div><div><i><b>When?</b></i></div><div><br /></div><div>Don't miss out on registering for my session on <a tabindex="0" href="http://cfunited.com/2010/my/schedule#" tabenabled="true">Thursday, July 29, 2010</a>-9:00 AM- <a tabindex="0" href="http://cfunited.com/2010/topics/452" tabenabled="true">ColdFusion Powered Offline Applications Using AIR ORM</a></div></div>Jayesh Viradiyahttp://www.blogger.com/profile/15200995560853101319noreply@blogger.com7tag:blogger.com,1999:blog-721341350366920435.post-63755807634672586222010-05-19T13:15:00.002+05:302010-05-19T13:26:45.308+05:30NCDevCon 2010<div>The Triangle Area ColdFusion User's Group (TACFUG), associates, and sponsors are organizing the NCDevCon 2010 Conference (NCDevCon) to be held May 22-23, 2010 on the Centennial Campus of NC State University in Raleigh,North Carolina.</div><div><br /></div><div>The conference will cover a wide variety of web development and design topics including ColdFusion, Flex and AIR,Javascript and CSS.</div><div><br /></div><div>Registration for the event will be free which includes entry to the weekend event and all presentations.</div><div><br /></div><div><div>Following the success of the CFinNC conference last October, the Triangle Area ColdFusion User Group (TACFUG) is proud to announce NCDevCon 2010.</div><div><br /></div><div>Planned for May 22-23, 2010 and held in Raleigh, NC, NCDevCon will have two days of timely and important web development sessions at no cost to attendees.</div></div><span style="font-family:arial;"></span>Jayesh Viradiyahttp://www.blogger.com/profile/15200995560853101319noreply@blogger.com14tag:blogger.com,1999:blog-721341350366920435.post-69129414072001048722010-03-22T10:50:00.005+05:302010-03-22T11:34:08.092+05:30ColdFusion Builder 1.0 is Live !!The highly anticipated, new Eclipse based IDE for ColdFusion from Adobe, ColdFusionBuilder 1.0 is live now!!....It easily integrates with Adobe FlashBuilder 4 as well, enabling developers to prepare Flex-CF applications, easily and faster than ever before. Also, CF Builder has the ability to accomplish all parts of the CF application developnent lifecycle with the same tool, which helps increase the productivity. Apart from CF9, CFBuilder 1.0 also provides support for CF7 and CF8.<br /><br />Related link...<br /><br /><br /><a href="http://www.adobe.com/devnet/coldfusion/articles/cfbuilder_whatsnew.html">http://www.adobe.com/devnet/coldfusion/articles/cfbuilder_whatsnew.html</a><br /><a href="http://www.terrenceryan.com/blog/post.cfm/coldfusion-builder-go">http://www.terrenceryan.com/blog/post.cfm/coldfusion-builder-go</a><br /><a href="http://www.adobe.com/devnet/coldfusion/articles/cf9_cfbuilder_videos.html">http://www.adobe.com/devnet/coldfusion/articles/cf9_cfbuilder_videos.html</a><br /><a href="http://www.adobe.com/products/coldfusion/cfbuilder/features/?view=all">http://www.adobe.com/products/coldfusion/cfbuilder/features/?view=all</a><br /><a href="http://help.adobe.com/en_US/ColdFusionBuilder/Using/WSf01dbd23413dda0e3d098bb81213a52da18-8000.html">http://help.adobe.com/en_US/ColdFusionBuilder/Using/WSf01dbd23413dda0e3d098bb81213a52da18-8000.html</a><br /><br /><br />ColdFusion Builder is complimentary for educational purposes. You can request it at<br /><br /><a href="https://freeriatools.adobe.com/cfbuilder">https://freeriatools.adobe.com/cfbuilder</a>Jayesh Viradiyahttp://www.blogger.com/profile/15200995560853101319noreply@blogger.com16tag:blogger.com,1999:blog-721341350366920435.post-26438457666553598412009-07-22T18:42:00.003+05:302009-07-22T18:46:08.634+05:30Adobe Dev Summit, 2009<p>Adobe Dev Summit, 2009 has been announced. The summit is on 4th August, 2009 at Lalit Ashok, Bangalore. You can sign up for a Gold pass, which is absolutely free. You can also sign up for a Platinum pass and get Flex Builder 3 Professional license for free.</p><p><strong>What’s in it for you?</strong><br /></p><ul><li>See the new, improved and rocking <a href="http://labs.adobe.com/technologies/livecycle_dataservices3/">LiveCycle Data Services 3</a> in action! If you are a Java developer, you wouldn’t want to miss this one! </li><li>If you are a PHP/Java developer, get on the RIA expressway using the new Data Centric Development features on <a href="http://labs.adobe.com/technologies/flashbuilder4/">Adobe Flash Builder 4</a> </li><li>If you’re into enterprise-wide RIA development, things have just got hot! Check out the brand new version of <a href="http://labs.adobe.com/technologies/coldfusion9/">ColdFusion</a> with the sparkling new developer IDE – <a href="http://labs.adobe.com/technologies/coldfusionbuilder/">ColdFusion Builder</a>. </li><li>User Interfaces are a thing of the past now. Build User Experiences of tomorrow with <a href="http://labs.adobe.com/technologies/flashcatalyst/">Adobe Flash Catalyst</a>. Quicker than ever!<br /></li></ul><p>Sign up for a Platinum Pass and get the award winning Adobe Flex Builder 3 Professional license worth USD 699 FREE!<br /></p><p>Please find more details and register here </p><p><a href="http://www.endtoend.in/ete2009/adobe/devsummit/mailer.html">http://www.endtoend.in/ete2009/adobe/devsummit/mailer.html</a></p><p> </p>Jayesh Viradiyahttp://www.blogger.com/profile/15200995560853101319noreply@blogger.com273tag:blogger.com,1999:blog-721341350366920435.post-17739241630736750162009-07-21T17:15:00.023+05:302009-07-21T18:22:54.192+05:30Refactoring in ColdFusion BuilderFirst Let’s just discuss what is Refactoring the source code in general.<br /><br /><span style="font-size:130%;"><strong>What is Refactoring ?</strong> </span><br /><br />Refactoring code in a programs means, one cleans up the code to improve the understandability, maintainability of the source code by changing source code’s internal structure or design, but keeps the overall result of the program same.<br /><br />So next question one would is “<strong><span style="font-size:130%;">How do I Refactor my program’s source code ?</span></strong>”<br /><br />First thing, it must not be done manually by one, as it’s more prone to human errors. Refactoring has to be an automated process and it’s a feature of and provided by the most of the IDE.<br /><br />ColdFusion Builder is the new IDE provided by Adobe for Rapid development of ColdFusion applications. ColdFusion builder allows user to Refactor their application source code.<br /><br />So one may argue…<strong><span style="font-size:130%;">What’s the big deal with ColdFusion Bulider? most of the IDEs provide refactoring…</span> </strong><br /><br />The big deal here is that it’s very challenging task for a non-typed language to provide Refactoring feature. ColdFusion being a loosely typed language, it’s not that straight forward to implement Refactoring for ColdFusion Builder, but still an attempt has been made to provide this feature in ColdFusion Builder to make life easier for CF developers.<br /><br /><strong><span style="font-size:130%;">What should I refactor to improve the understandability or maintainability of my source code?<br /></span></strong><br />During the application development cycle, one may hurry to complete the application due to various reasons and hence may end up using the variable names, function names, filenames and many other source code constructs such that it becomes difficult to understand for other developer, making maintainability and understandability of the application difficult. In order to avoid such situation, developer should take corrective actions to Refactor the above mentioned code constructs for making it easier to comprehend for other developers.<br /><br /><strong><span style="font-size:130%;">What sub-features does ColdFusion Builder offer for Refactoring?<br /></span></strong><br />ColdFusion Builder provides the following sub-features in Refactoring.<br /><br /><strong>CFC UDF Refactor</strong><br /><br />In the following component, let’s say…one want to rename test() function to test123(), so it means that all the valid instances of the test() function through out the application should get refactored, including the references in the same component but other functions referring it.<br /><br /><br /><br /><span style="font-family:courier new;"><cfcomponent namespace="Refactor.abc" extends="def.b" ><br /><cffunction name="test" access="remote"><br /><cfreturn 1><br /></cffunction><br /><!---Test 2 Method ---><br /><cffunction name="test2" access="remote"><br /><cfreturn test()><br /></cffunction><br /><!----Test Method 3 from def\b.cfc----><br /><cffunction name="test3" access="remote"><br /><cfreturn foo1()><br /></cffunction><br /></cfcomponent><br /></span><br /><br />So what should one do to achieve it? Just left click on the function name, and then Right click to open the Menu, as shown in the following screenshot.<br /><br /><br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhV66bxk-Q83ZPwJILLDlz-TIdCPpbQHnvY9y7yCwfeBnjOPwEfNcMAmuKLg1-ddjddCZyqMGzd2z2GhRtTD7FFF02Vy0LUmfgljyWePtxQ59SpgxugZzt-V0VmbdVQ7vJDL1_1-OIhOMm2/s1600-h/RefactorMenuInEditor.bmp"><img id="BLOGGER_PHOTO_ID_5360880160479782754" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 797px; CURSOR: hand; HEIGHT: 737px; TEXT-ALIGN: center" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhV66bxk-Q83ZPwJILLDlz-TIdCPpbQHnvY9y7yCwfeBnjOPwEfNcMAmuKLg1-ddjddCZyqMGzd2z2GhRtTD7FFF02Vy0LUmfgljyWePtxQ59SpgxugZzt-V0VmbdVQ7vJDL1_1-OIhOMm2/s400/RefactorMenuInEditor.bmp" border="0" /></a><br /><br /><p>Click on the Refactor->Rename menu item and it will open up a Input dialog as following, </p><br /><p><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRdMzowZe_F1FnpZMWOj9wrd3xcspyMra28Z73KQs42-7rIyUlV_iunRuFuSaKY-OWNuUk-wcuLOPyQDDaqgDaxwSINXS1eSdQKeteDWsv9lc7G9J4tlnoBYaPWLhAnb9sO7Xknx5Vf-HA/s1600-h/NewNameDialog.bmp"><img id="BLOGGER_PHOTO_ID_5360880708599351842" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 191px; TEXT-ALIGN: center" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRdMzowZe_F1FnpZMWOj9wrd3xcspyMra28Z73KQs42-7rIyUlV_iunRuFuSaKY-OWNuUk-wcuLOPyQDDaqgDaxwSINXS1eSdQKeteDWsv9lc7G9J4tlnoBYaPWLhAnb9sO7Xknx5Vf-HA/s400/NewNameDialog.bmp" border="0" /></a></p><p>Now, provide the “New Name” for the test method and once you do that Disabled Preview button is enabled. Notice that we are enforcing user to preview the changes being done by ColdFusion Builder. Reason being at certain places, CF can not determine if the instance has to be considered for refactoring or not and so in such cases, it’s upto user to decide if the unsure instances (unchecked) shown in the preview, has to be considered or not. If required user should check it before preceding by pressing “OK” button. </p><p><img id="BLOGGER_PHOTO_ID_5360881315551066258" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 700px; CURSOR: hand; HEIGHT: 400px; TEXT-ALIGN: center" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGpAQyViec7Ix8f9UWEqzZZW5WXY3qvmaSJGMr-YeIA-rXFWVXqb5Gf5-HLihCVqoJ_uu98ZuMckobkO19CvzH4kxzyUViwkZo9ykUZiPLPlN_3UiGnp9x6AT2ITzOhkKm6e98Pvv-9ynz/s400/PreviewScreen.bmp" border="0" /> </p><p>Notice that even the URLs in <cfhttp>/<cfschedule> tags, which are referring to this test() method are being considered for refactoring. Such URL references are possible to consider for refactoring only when the Server is registered with ColdFusion Builder and the URLs are very much valid and accessible, which otherwise is not possible.<br /><br /><strong>Note:</strong> User can Undo the Refactored changes by pressing Cntrl+Z from keyboard.<br /></p><p>So we have seen how to refactor an UDF in CFC. Similar way, we can also perform the following operations. </p><ul><li><strong>Refactor CFM UDF </strong></li><li><strong>Refactor CFC UDF </strong></li><li><strong>Refactor Funcion Local scope variables </strong></li><li><strong>Refactor Function Argument Names </strong></li><li><strong>Refactor the CFC Name </strong></li><li><strong>Refactor CFM Name </strong></li><li><strong>Refactor Custom Tags </strong></li><li><strong>Refactor CFQuery Names </strong></li><li><strong>Refactor Scoped Varaible names like This/Application/session etc.. variables. </strong></li><li><strong>Refactor UnScoped Global variables in a CFM/CFC. </strong></li><li><strong>Refactor Variables in Included and Includee file. </strong></li><li><strong>Refactor ORM CFC which should also get reflected in ORM Entity Methods. </strong></li><li><strong>Method Refactoring through – “Application Varaible Mappings” in CF Builder </strong><br /></li></ul><p><strong>Note:</strong> To refactor the CFM/CFC/CustomTags, Explore the Template thorough Project Navigator, Right Click on the Template and select Refactor->Rename menuitem, as shown in the following screenshot.<br /></p><p><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjydqXlV8UIWHcd1wl4L5qTyBLXOn8Pqt6H8Q1yymu_po3gnlpixc1hK8pn2bR5JBW692X52Qd639I2aiTHYiiYsuKqFXiSjhlheli9SwsSIturZ-CO1WKEA2cxuu-KplobjYf-ixy8t9K1/s1600-h/RefactorMenuInNavigator.bmp"><img id="BLOGGER_PHOTO_ID_5360883527090074642" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 280px; CURSOR: hand; HEIGHT: 400px; TEXT-ALIGN: center" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjydqXlV8UIWHcd1wl4L5qTyBLXOn8Pqt6H8Q1yymu_po3gnlpixc1hK8pn2bR5JBW692X52Qd639I2aiTHYiiYsuKqFXiSjhlheli9SwsSIturZ-CO1WKEA2cxuu-KplobjYf-ixy8t9K1/s400/RefactorMenuInNavigator.bmp" border="0" /></a><br /><strong>Note:</strong> File/Template Refactoring is allowed only for, CFM/CFC files. TXT files or any other types of files can not be refactored.<br /></p><p><strong><span style="font-size:130%;">Method Refactoring using "Application Variable Mappings" </span></strong></p><p>Assume a scenario where an Application variable is defined for a CFC Object as following.</p><p><cfset Application.appVar = createObject("component","abc.AppCFM.a")></p><p>And now, the CFC function called Method() is invoked as following in some other template<br /><cfset Application.appVar.Method()></p><p><br />In such a case, While Refactoring the Method() function, If a Varaible mapping is created for the application variable, then the above invokation usage will be considered for Refactoring, otherwise it will be ignored.<br /></p><p>To Create Application Variable mappings.... Right Click on the Project >Properties window>ColdFusion Variables Mappings>Click on New button>enter Variable name as "Application.appVar" and Mapped To as "abc.AppCFM.a", Click OK button.</p><p><br /><strong><span style="font-size:180%;">References Search<br /></span></strong><br />Not that always one needs to refactor the Code, But there are times, when one only wants to see/find the references of the Methods/Varaibels/CF templates etc…<br /><br />In such a case, one can use the References option in the Right Click Menu, as shown in the following screenshot.</p><p><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7h4s2am0FZWjIp01AMTWomDpkHQdzwLvheuFG64sQ2d4wFEgfO84LUbFkZYHfKtt6FzDKzQa9FV15azk80uqsg8ZMmbsoqUrvjfJRZYOkaMYsKUDPljXMAm4NAlNM4Fo12eKRJHbEw_JV/s1600-h/ReferenceSearchMenuInEditor.bmp"><img id="BLOGGER_PHOTO_ID_5360884189812831938" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 373px; CURSOR: hand; HEIGHT: 400px; TEXT-ALIGN: center" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7h4s2am0FZWjIp01AMTWomDpkHQdzwLvheuFG64sQ2d4wFEgfO84LUbFkZYHfKtt6FzDKzQa9FV15azk80uqsg8ZMmbsoqUrvjfJRZYOkaMYsKUDPljXMAm4NAlNM4Fo12eKRJHbEw_JV/s400/ReferenceSearchMenuInEditor.bmp" border="0" /></a><br />Similar option is also available for Template search from Project navigator view.<br />Reference search results will be shown in the Search panel as shown below.<br /></p><br /><p><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEha7T9UN3NoODKgnid9lDYKnt9m0y_zwfcADB-Hk0LuJR_LsHcG1Yv8aXzhtb9i4VvxaOYT48UC-huSpr0ZCf13UghPXijpVxfaDT9VVY08Ws7z-gHuKwqihDGfWNDnKLKl6joVzQmvPJ-0/s1600-h/SearchResult.bmp"><img id="BLOGGER_PHOTO_ID_5360885202297498818" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 357px; TEXT-ALIGN: center" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEha7T9UN3NoODKgnid9lDYKnt9m0y_zwfcADB-Hk0LuJR_LsHcG1Yv8aXzhtb9i4VvxaOYT48UC-huSpr0ZCf13UghPXijpVxfaDT9VVY08Ws7z-gHuKwqihDGfWNDnKLKl6joVzQmvPJ-0/s400/SearchResult.bmp" border="0" /></a> </p>Jayesh Viradiyahttp://www.blogger.com/profile/15200995560853101319noreply@blogger.com61tag:blogger.com,1999:blog-721341350366920435.post-55230303219138838542009-07-15T15:44:00.021+05:302009-07-15T17:04:49.663+05:30Enhanced Flash Remoting (CF9) Vs. Old Flash Remoting<p class="MsoNormal">One may wonder, what is this deal about in ColdFusion 9 for “Enhanced Flash Remoting”? Or One may also wonder what was wrong with Old Flash Remoting (CF8 style) that we needed to enhance Flash remoting in ColdFusion 9?</p><p class="MsoNormal"><?xml:namespace prefix = o /><o:p></o:p></p><p class="MsoNormal"><br /></p><p class="MsoNormal">To find answers for these questions, let’s first explore, what was wrong with CF8 style flash remoting. Mainly there was one problem and that was the “Circular reference serialization-deserialization” bug. </p><p class="MsoNormal"><o:p></o:p></p><p class="MsoNormal"><br /></p><p class="MsoNormal">This bug was long standing<span style="font-size:0;"> </span>problem for Advanced CF-Flex developers who tried to send nested or related ActionScript Objects having circular reference to each other, over wire to ColdFusion from Flex Clients, resulting in following error.</p><p class="MsoNormal"><br /></p><p class="MsoNormal"><o:p></o:p></p><div style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 0in; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 4pt; PADDING-BOTTOM: 1pt; BORDER-LEFT: windowtext 1pt solid; PADDING-TOP: 1pt; BORDER-BOTTOM: windowtext 1pt solid"><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><o:p></o:p></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none">[Flex]Exception when invoking service 'remoting-service': flex.messaging.Message</p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none">Exception: java.lang.StackOverflowError</p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><b>.<o:p></o:p></b></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><b>.<o:p></o:p></b></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><b>.<o:p></o:p></b></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none">Exception: flex.messaging.MessageException: java.lang.StackOverflowError</p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-size:0;"></span>at coldfusion.flash.messaging.ColdFusionAdapter.getFlexError(ColdFusionA</p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none">dapter.java:361)</p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-size:0;"></span>at coldfusion.flash.messaging.ColdFusionAdapter.invoke(ColdFusionAdapter</p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none">.java:273)</p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><b>.<br />.<o:p></o:p></b></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><b>.</b></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><o:p></o:p></p></div><p class="MsoNormal"><o:p></o:p></p><p class="MsoNormal"><span style="font-family:Wingdings;"><span style="font-size:0;"><br /></span></span></p><p class="MsoNormal"></p><p><span class="Apple-style-span" style="FONT-WEIGHT: bold">--> This Bug is fixed in ColdFusion 9 – Enhanced Flash Remoting feature. So Developers are no more blocked writing advanced Flex-CF Applications with having AS Objects with circular references.</span></p><p></p><p class="MsoNormal"><o:p></o:p></p><p class="MsoNormal"><br /></p><p class="MsoNormal">Let’s discuss another advantage of using new Enhanced Flash Remoting. Fixing the circular reference bug wasn’t an easy task, many radical changes were required to be done to fix this issue and most of the ActionScript-CF datatype translation or serialization-deserialization process has to be re-written in many ways. This gave us the opportunity to improve the entire process, resulting in faster<span style="font-size:0;"> </span>AS-CF datatype translation which made New Enhanced Flash Remoting faster many times against Old Flash Remoting.</p><p class="MsoNormal"><o:p></o:p></p><p class="MsoNormal"><span style="font-family:Wingdings;"><span style="font-size:0;"><br /></span></span></p><p class="MsoNormal"><b><o:p></o:p></b></p><p><span class="Apple-style-span" style="FONT-WEIGHT: bold;font-family:'Times New Roman';" >--> <span style="font-size:130%;">A Significant Performance Boost for Flash Remoting.</span></span></p><span class="Apple-style-span" style="FONT-WEIGHT: bold;font-family:'Times New Roman';" ><ul><li>Enhanced Flash Remoting is 6 -7 times faster against CF 8.0.1</li><li>Enhanced Flash Remoting is 10-11 times faster against CF 8.</li></ul></span><p class="MsoNormal"><b><o:p></o:p></b></p><p class="MsoNormal"><b><o:p></o:p></b></p><p class="MsoNormal"><b><span style="font-size:14;"><br /></span></b></p><p class="MsoNormal"><b><span style="font-size:14;">So How did I measure this Performance Gain?<o:p></o:p></span></b></p><p class="MsoNormal"><b><o:p></o:p></b></p><p class="MsoNormal"><br /></p><p class="MsoNormal">To measure this performance gain, I created a small Flex Application which will send an Actionscript Object to ColdFusion 9 and ColdFusion 9 will echo it back to Flex application. So making an entire server trip and back will give an appropriate idea about the serialization-deserialization process both ways.</p><p class="MsoNormal"><br /></p><p class="MsoNormal"><o:p></o:p></p><p class="MsoNormal">The below <span style="font-size:0;"></span>Actionscript Object that I used for this purpose has most of the common datatypes of AS.</p><p class="MsoNormal"><br /></p><p class="MsoNormal"><o:p></o:p></p><p class="MsoNormal"><o:p></o:p></p><div style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 4pt; PADDING-BOTTOM: 1pt; BORDER-LEFT: windowtext 1pt solid; PADDING-TOP: 1pt; BORDER-BOTTOM: windowtext 1pt solid"><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><b><span style="font-family:';font-size:10;">package</span></b><span style="font-family:';font-size:10;color:black;"> com</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;">{</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;">[RemoteClass(alias=</span><b><span style="font-family:';font-size:10;">"perf.DataSamples"</span></b><span style="font-family:';font-size:10;color:black;">)] </span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><b><span style="font-family:';font-size:10;">public</span></b><span style="font-family:';font-size:10;color:black;"> </span><b><span style="font-family:';font-size:10;">class</span></b><span style="font-family:';font-size:10;color:black;"> DataSamples</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;">{</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:0;"></span></span><b><span style="font-family:';font-size:10;">public</span></b><span style="font-family:';font-size:10;color:black;"> </span><b><span style="font-family:';font-size:10;">var</span></b><span style="font-family:';font-size:10;color:black;"> firstname:String = </span><b><span style="font-family:';font-size:10;">""</span></b><span style="font-family:';font-size:10;color:black;">;</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:0;"></span></span><b><span style="font-family:';font-size:10;">public</span></b><span style="font-family:';font-size:10;color:black;"> </span><b><span style="font-family:';font-size:10;">var</span></b><span style="font-family:';font-size:10;color:black;"> lastname:String = </span><b><span style="font-family:';font-size:10;">""</span></b><span style="font-family:';font-size:10;color:black;">;</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:0;"></span></span><b><span style="font-family:';font-size:10;">public</span></b><span style="font-family:';font-size:10;color:black;"> </span><b><span style="font-family:';font-size:10;">var</span></b><span style="font-family:';font-size:10;color:black;"> city:String = </span><b><span style="font-family:';font-size:10;">""</span></b><span style="font-family:';font-size:10;color:black;">;</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:0;"></span></span><b><span style="font-family:';font-size:10;">public</span></b><span style="font-family:';font-size:10;color:black;"> </span><b><span style="font-family:';font-size:10;">var</span></b><span style="font-family:';font-size:10;color:black;"> zip:uint;</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:0;"></span></span><b><span style="font-family:';font-size:10;">public</span></b><span style="font-family:';font-size:10;color:black;"> </span><b><span style="font-family:';font-size:10;">var</span></b><span style="font-family:';font-size:10;color:black;"> email:String = </span><b><span style="font-family:';font-size:10;">""</span></b><span style="font-family:';font-size:10;color:black;">;</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:0;"></span></span><b><span style="font-family:';font-size:10;">public</span></b><span style="font-family:';font-size:10;color:black;"> </span><b><span style="font-family:';font-size:10;">var</span></b><span style="font-family:';font-size:10;color:black;"> ContactNos:Object;</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:0;"></span></span><b><span style="font-family:';font-size:10;">public</span></b><span style="font-family:';font-size:10;color:black;"> </span><b><span style="font-family:';font-size:10;">var</span></b><span style="font-family:';font-size:10;color:black;"> designation:String = </span><b><span style="font-family:';font-size:10;">""</span></b><span style="font-family:';font-size:10;color:black;">;</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:0;"></span></span><b><span style="font-family:';font-size:10;">public</span></b><span style="font-family:';font-size:10;color:black;"> </span><b><span style="font-family:';font-size:10;">var</span></b><span style="font-family:';font-size:10;color:black;"> experience:int;</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:0;"></span></span><b><span style="font-family:';font-size:10;">public</span></b><span style="font-family:';font-size:10;color:black;"> </span><b><span style="font-family:';font-size:10;">var</span></b><span style="font-family:';font-size:10;color:black;"> salary:Number;</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:0;"></span></span><b><span style="font-family:';font-size:10;">public</span></b><span style="font-family:';font-size:10;color:black;"> </span><b><span style="font-family:';font-size:10;">var</span></b><span style="font-family:';font-size:10;color:black;"> CompaniesWorkedFor:Array;</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:0;"></span></span><b><span style="font-family:';font-size:10;">public</span></b><span style="font-family:';font-size:10;color:black;"> </span><b><span style="font-family:';font-size:10;">var</span></b><span style="font-family:';font-size:10;color:black;"> dateOfBirth:Date;</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:0;"></span></span><b><span style="font-family:';font-size:10;">public</span></b><span style="font-family:';font-size:10;color:black;"> </span><b><span style="font-family:';font-size:10;">var</span></b><span style="font-family:';font-size:10;color:black;"> IsMarried:Boolean;</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:0;"></span></span><b><span style="font-family:';font-size:10;">public</span></b><span style="font-family:';font-size:10;color:black;"> </span><b><span style="font-family:';font-size:10;">var</span></b><span style="font-family:';font-size:10;color:black;"> Children:Object;</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:0;"></span></span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:0;"></span></span><b><span style="font-family:';font-size:10;">public</span></b><span style="font-family:';font-size:10;color:black;"> </span><b><span style="font-family:';font-size:10;">function</span></b><span style="font-family:';font-size:10;color:black;"> DataSamples()</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:0;"></span>{</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:0;"></span>}</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;">}</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;">}</span></p></div><p class="MsoNormal"><o:p></o:p></p><p class="MsoNormal"><o:p></o:p></p><p class="MsoNormal"><br /></p><p class="MsoNormal">As you observe that, this DataSample class has properties of varying datatypes like String / uint /int / Objects(CFC mapped Objects, Plain AS objects) / Number / Array (Indexed, Associative) / Dates / Boolean. Also observe that this DataSample AS class also maps with a ColdFusion server side CFC “perf\DataSamples.cfc”. So most common Flex app scenarios are being covered through this AS class.</p><p class="MsoNormal"><o:p></o:p></p><p class="MsoNormal"><o:p></o:p></p><p class="MsoNormal"><br /></p><p class="MsoNormal">I am assuming here that similar sort of AS object would broadly represent a Flex application’s Custom AS Class. </p><p class="MsoNormal"><o:p></o:p></p><p class="MsoNormal"><o:p></o:p></p><p class="MsoNormal">Now, so in what quantum or magnitude I should send this DataSample objects I should use to find out the performance difference between Enhanced Flash Remoting and Old Flash remoting. Sending a Few DataSample objects may not give a real idea about the performance gain, so in order to measure the real difference in speed, we have to magnify it by replicating a high traffic Flex application which sends DataSamples Objects around in the range of 10,000 – 50,000. See the following stat metrics that has been gathered in similar environments ( Win2k3 R2 + Intel Xeon CPU 2GHz + 2GB RAM) for ColdFusion 8 / ColdFusion 8.0.1 and ColdFusion 9.</p><p class="MsoNormal"></p><p><table bordercolor="#000000" cellspacing="0" cellpadding="0" width="396" border="1"><tbody></tbody><tbody><tr><td valign="top" width="52"><p><strong>No. of CFCs</strong></p></td><td valign="top" colspan="3"><table width="334"><tbody></tbody><tbody><tr valign="top"><td colspan="3"><p align="center"><strong>Response Time </strong></p><p align="center"><strong>( Readings for Echo operation in ms )</strong></p><p align="center"><b><br /></b></p></td></tr><tr valign="top"><td valign="top" width="101"><p><strong>ColdFusion 8 </strong></p></td><td valign="top" width="113"><strong>ColdFusion 9</strong></td><td valign="top" width="120"><strong>ColdFusion 8.0.1</strong> <p></p></td></tr></tbody></table></td></tr><tr><td valign="top" width="52"><p>10 K </p></td><td valign="top" width="101"><p>14599, 14301, 13890, 14203, 13725</p></td><td valign="top" width="113"><p>1278, 1297, 1285, 1266, 1250</p></td><td valign="top" width="120"><p>7203, 7609, 7062, 7125, 7235</p></td></tr><tr><td valign="top" width="52"><p>20 K</p></td><td valign="top" width="101"><p>29484, 32531, 27188, 27219, 27600</p></td><td valign="top" width="113"><p>2821, 2812, 2815, 2500, 2828, 2515, 2703, 2516</p></td><td valign="top" width="120"><p>14328, 14672, 14375, 14437, 14523</p></td></tr><tr><td valign="top" width="52"><p>30 K</p></td><td valign="top" width="101"><p>41907, 41078, 41355, 41688</p></td><td valign="top" width="113"><p>3969, 4032, 3765, 4031, 3719, 4031, 3718</p></td><td valign="top" width="120"><p>21703, 22312, 22578, 22469</p></td></tr><tr><td valign="top" width="52"><p>40 K</p></td><td valign="top" width="101"><p>55032, 54782, 55392, 55189</p></td><td valign="top" width="113"><p>5000, 5328, 5219, 5313, 5000, 5344</p></td><td valign="top" width="120"><p>30625, 30641, 30516, 30629, 30593</p></td></tr><tr><td valign="top" width="52"><p>50 K</p></td><td valign="top" width="101"><p>70312, 69890, 70891, 70234</p></td><td valign="top" width="113"><p>6562, 6281, 6500, 6297, 6578, 6297, 6265</p></td><td valign="top" width="120"><p>42297, 41516, 39610, 39188, 38010</p></td></tr></tbody></table></p><p class="MsoNormal"><o:p></o:p></p><p class="MsoNormal"><o:p></o:p></p><p class="MsoNormal">Each of the reading given in the metrics represents an average of 10-20 server cycles response time. Why I opted to it this way, instead of just taking 1 server cycle, is to get an average time which will be most nearer to the actual figure. For 10K/20K CFCs, average is for 20 server cycles, and for higher 30K-50K CFCs, average is for 10 server cycles. </p><p class="MsoNormal"><o:p></o:p></p><p class="MsoNormal"><b><br /></b></p><p class="MsoNormal"><b>So If you observe the stats, it suggest that ColdFusion 9 is significantly faster over CF8(10-11 times) and CF801(6-7 times). <o:p></o:p></b></p><p class="MsoNormal"><o:p></o:p></p><p class="MsoNormal"><o:p></o:p></p><p class="MsoNormal"><b><span style="font-size:14;"><br /></span></b></p><p class="MsoNormal"><b><span style="font-size:14;">A few Basics Questions One may have in mind…..<o:p></o:p></span></b></p><p class="MsoNormal"><o:p></o:p></p><p class="MsoNormal"><b><span style="font-family:Wingdings;"><span style="font-size:0;"><br /></span></span></b></p><p class="MsoNormal"><b>--> Does ColdFusion 9 also support Old Flash Remoting ?<o:p></o:p></b></p><p class="MsoNormal"><o:p></o:p></p><p class="MsoNormal"><br /></p><p class="MsoNormal">Yes. It supports, CF8 style, “Old Flash Remoting” for backward compatibility purpose. As “Enhanced Flash Remoting” of ColdFusion 9 requires a few structural changes in the WEB-INF\flex\<span style="font-size:0;"> </span>XML configuration files at <b>Channel</b> as well as <b>Destination</b> level. By default ColdFusion 9 installation supports new Enhanced Flash Remoting.</p><p class="MsoNormal"><o:p></o:p></p><p class="MsoNormal"><span style="font-family:Wingdings;"><span style="font-size:0;"><br /></span></span></p><p class="MsoNormal"><span style="font-family:Wingdings;"><span style="font-size:0;"><br /></span></span></p><p class="MsoNormal"><b>--> What are these changes at Channel and Destination level in flex Configuration files from previous CF releases to CF9?<o:p></o:p></b></p><p class="MsoNormal"><o:p></o:p></p><p class="MsoNormal"><br /></p><p class="MsoNormal">The following properties have been moved from Destination to Channel level. You need to move these properties under <channel-definition > --> <properites> --> <coldfusion> <channel-definition><properites><span style="font-family:Wingdings;"><span style="font-size:0;"></span></span><span style="font-size:0;"></span><coldfusion>from your destinations. </p><p class="MsoNormal"><br /></p><p class="MsoNormal"></coldfusion></properites></CHANNEL-DEFINITION></p><p class="MsoNormal"><o:p></o:p></p><p class="MsoNormal"><access></access></p><p class="MsoNormal"><span style="font-size:0;"></span><use-mappings></USE-MAPPINGS></p><p class="MsoNormal"><span style="font-size:0;"></span><method-access-level></METHOD-ACCESS-LEVEL></p><p class="MsoNormal"></p><p class="MsoNormal"><span style="font-size:0;"></span></p><p class="MsoNormal"><use-accessors></USE-ACCESSORS></p><p class="MsoNormal"><span style="font-size:0;"></span><use-implicit-accessors></USE-IMPLICIT-ACCESSORS></p><p class="MsoNormal"><span style="font-size:0;"></span></p><p class="MsoNormal"><use-structs></USE-STRUCTS></p><p class="MsoNormal"><span style="font-size:0;"></span><property-case></PROPERTY-CASE></p><p class="MsoNormal"><span style="font-size:0;"></span><force-cfc-lowercase></FORCE-CFC-LOWERCASE></p><p class="MsoNormal"><span style="font-size:0;"></span><force-query-lowercase></FORCE-QUERY-LOWERCASE></p><p class="MsoNormal"><span style="font-size:0;"></span><force-struct-lowercase></FORCE-STRUCT-LOWERCASE></p><p class="MsoNormal"><span style="font-size:0;"></span></p><p class="MsoNormal"><o:p></o:p></p><p class="MsoNormal"><o:p></o:p></p><p class="MsoNormal">For more details, refer Documentation, Changes in the XML configuration files for New Flash Remoting in ColdFusion 9.</p><p class="MsoNormal"><br /></p><p class="MsoNormal"></p><p class="MsoNormal"></p><p class="MsoNormal"><access> </p><p class="MsoNormal"><use-mappings></p><p class="MsoNormal"><method-access-level></p><p class="MsoNormal"></access> </p><p class="MsoNormal"><br /></p><p class="MsoNormal"><use-accessors> </p><p class="MsoNormal"><use-implicit-accessors> </p><p class="MsoNormal"></use-accessors></p><p class="MsoNormal"><br /></p><p class="MsoNormal"></p><p class="MsoNormal"><use-structs> </p><p class="MsoNormal"></p><p class="MsoNormal"><property-case> </p><p class="MsoNormal"></p><p class="MsoNormal"><force-cfc-lowercase> </p><p class="MsoNormal"><force-query-lowercase> </p><p class="MsoNormal"><force-struct-lowercase> </p><p class="MsoNormal"></p><p class="MsoNormal"></property-case> </p><p class="MsoNormal"></p><p class="MsoNormal"></use-structs> </p><p class="MsoNormal"><br /><br /></p><p class="MsoNormal"><b>--> So What happens, while migrating from previous CF installs to ColdFusion 9, if I just simply drop my old WEB-INF\flex XML configuration files, without above changes, over ColdFusion 9 installation?<o:p></o:p></b></p><p class="MsoNormal"><b><o:p></o:p></b></p><p class="MsoNormal"><br /></p><p class="MsoNormal">With Old style XML Flex configuration files, it will continue to work but in this case ColdFusion 9, will use Old Flash Remoting and not the Enhanced Flash Remoting. </p><p class="MsoNormal"><o:p></o:p></p><p class="MsoNormal">One must follow above suggested XML changes, in order to take advantages offered by Enhanced Flash Remoting.</p>Jayesh Viradiyahttp://www.blogger.com/profile/15200995560853101319noreply@blogger.com9tag:blogger.com,1999:blog-721341350366920435.post-22729336874202953152009-07-14T15:26:00.030+05:302009-08-18T14:27:36.750+05:30ColdFusion 9 - AIR SQLite Offline Support<p class="MsoNormal">In this Article, I will be explaining about the new feature, <b>AIR Offline Support</b>, introduced in ColdFusion 9.<span style="font-size:+0;"> </span>This Article will try to cover, most of the aspects of the feature with Code snippets to simplify the subject.</p><p class="MsoNormal"><?xml:namespace prefix = o /><o:p></o:p></p><p class="MsoNormal">Now, before explaining this feature I would like to cover a few basic questions which user may have in mind.</p><p class="MsoNormal">
<br /></p><p class="MsoNormal"><o:p></o:p></p><p class="MsoNormal"><b><span style="font-size:14;">Is this a client side feature or server side feature?</span></b></p><p class="MsoNormal">
<br /><b><span style="font-size:14;"><o:p></o:p></span></b></p><p class="MsoNormal"><o:p></o:p></p><p class="MsoNormal">This is mainly a client side feature which could be used for Flex based AIR applications. Browser based Flex applications can not take advantage of this feature as it needs client side SQLite DB which is offered only by AIR platform. </p><p class="MsoNormal"><o:p></o:p></p><p class="MsoNormal">Also, There are a few ColdFusion Interfaces defined on server side, which user need to comply with while writing their CFC having “Fecth” and “Sync” methods.</p><p class="MsoNormal">
<br /></p><p class="MsoNormal"><b><o:p></o:p></b></p><p class="MsoNormal"><b><o:p></o:p></b></p><p class="MsoNormal"><b><span style="font-size:14;">Why Offline Support in ColdFusion 9 where as AIR also provides it?</span></b></p><p class="MsoNormal">
<br /><b><span style="font-size:14;"><o:p></o:p></span></b></p><p class="MsoNormal"><o:p></o:p></p><p class="MsoNormal">One may argue that AIR provides Offline SQLite DB support, then why ColdFusion 9 is redoing it? To clarify on this, ColdFusion 9 is not redoing it, but rather making it more simplified by introducing an ActionScript persistence framework which could help in taking all the complexities and pain away from user to deal with Client side DB/Tables/SQL Queries etc...</p><p class="MsoNormal">
<br /></p><p class="MsoNormal"><span style="font-size:+0;"></span></p><p class="MsoNormal"><b><span style="font-size:14;">Why should I use Offline feature of ColdFusion 9 ?</span></b></p><p class="MsoNormal">
<br /><b><span style="font-size:14;"><o:p></o:p></span></b></p><p class="MsoNormal"><o:p></o:p></p><p class="MsoNormal">By using the ActionScript persistence framework introduced in ColdFusion 9, user doesnt need to create the client side DB Schema, Tables and also user doesn’t need to write even a Single line of SQLite Query to store/update/retrieve data from Offline DB. Isn’t it simplified ?</p><p class="MsoNormal"><o:p></o:p></p><p class="MsoNormal"><b><span style="font-size:14;">
<br /></span></b></p><p class="MsoNormal"><b><span style="font-size:14;">How can ColdFusion 9 Offline feature do it without writing Queries?<o:p></o:p></span></b></p><p class="MsoNormal"><b><o:p></o:p></b></p><p class="MsoNormal">
<br /></p><p class="MsoNormal">This ActionScript Persistence Framework, comes with many Metadata tags to assist user in defining their client side classes which should be mapped with Client side DB. See the few basic Metadata tags information in the following table.</p><p><table bordercolor="#000000" cellspacing="0" cellpadding="0" border="1"><tbody></tbody><tbody><tr><td valign="top" width="130"><p align="center"><strong>MetaData Tags</strong></p></td><td valign="top" width="250"><p align="center"><strong>Purpose</strong></p></td></tr><tr><td valign="top" width="130"><p>[Entity]</p></td><td valign="top" width="250"><p>Specifies that instances of this class can be persisted to the SQLite database. This element is
<br />required.</p></td></tr><tr><td valign="top" width="130"><p>[Table( name = "tableName")]</p></td><td valign="top" width="250"><p>The name of the SQLite table in which the object is to be stored. Defaults to the name of the
<br />
<br />class.</p></td></tr><tr><td valign="top" width="130"><p>[Id]</p></td><td valign="top" width="250"><p>Precedes a field definition. Indicates that the field is a primary key in the table. For composite
<br />
<br />keys, use Id tags on all the primary key fields.</p></td></tr><tr><td valign="top" width="130"><p>[Column(name="name",
<br />
<br />columnDefinition="TEXT INTEGER
<br />
<br />FLOAT BOOLEAN VARCHACHAR",
<br />
<br />nullable = true false, unique = true false ) ] ),</p></td><td valign="top" width="250"><p>Specifies the SQLite database column that contains data for this field.
<br />
<br /><strong>name </strong>Column name. If not specified, defaults to the property name.
<br />
<br /><strong>columnDefinition </strong>The SQL Datatype to use for the column.
<br />
<br /><strong>nullable </strong>Specifies whether a field can have a null value.
<br />
<br /><strong>unique </strong>Specifies whether the value for each field must be unique within the
<br />
<br />column.</p></td></tr></tbody></table></p>
<br /><p class="MsoNormal">This framework also offers Relationship Metadata tags, like [OneToOne],[OneToMany],[ManyToMany],[JoinTable],[JoinColumn],[InverseJoinColumn] which are used to define relationships between the AS classes, which is also being followed while creating Offline tables for these classes. Refer ColdFusion9 AIR Offline Documentation for more information on these Relationship metadata tags.</p><p class="MsoNormal"><o:p></o:p></p><p class="MsoNormal"><b><span style="font-size:14;">
<br /></span></b></p><p class="MsoNormal"><b><span style="font-size:14;">Let’s have a look at a Simple AIR Offline Application Example ….<o:p></o:p></span></b></p><p class="MsoNormal"><o:p></o:p></p><p class="MsoNormal">
<br /></p><p class="MsoNormal">Given is the Screenshot of the Application. Application has mainly 2 sections, top section is used for performing the CRUD operations and Bottom datagrid panel provides user to view the local SQLite data for Customer and Address tables.<span style="font-size:+0;"> </span>Also it provides 2 buttons for Fetching data from server and Syncing local data changes back to server. </p>
<br />
<br />
<br />
<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNJreAh5XXkdiK07g-1dvLHKfIsbMi_sJq8MFxIYW2Fu7EH1G2NgUrp-al3VHklfPgOGxgO613GyeS3HC454c1FmQzIyePClzenNtTNw3cd5XhQWZDtzrdEO3eM8wRAwyrsw4HkUpM-awt/s1600-h/CustomerManager.jpg"><img id="BLOGGER_PHOTO_ID_5358252945163582450" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: pointer; HEIGHT: 570px; TEXT-ALIGN: center" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNJreAh5XXkdiK07g-1dvLHKfIsbMi_sJq8MFxIYW2Fu7EH1G2NgUrp-al3VHklfPgOGxgO613GyeS3HC454c1FmQzIyePClzenNtTNw3cd5XhQWZDtzrdEO3eM8wRAwyrsw4HkUpM-awt/s400/CustomerManager.jpg" border="0" /></a>
<br /><meta content="text/html; charset=utf-8" equiv="Content-Type"><meta content="Word.Document" name="ProgId"><meta content="Microsoft Word 11" name="Generator"><meta content="Microsoft Word 11" name="Originator"><link href="file:///C:%5CDOCUME%7E1%5CCFQAUS%7E1.CFI%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml" rel="File-List"><style> <!-- /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman";} @page Section1 {size:8.5in 11.0in; margin:1.0in 1.25in 1.0in 1.25in; mso-header-margin:.5in; mso-footer-margin:.5in; mso-paper-source:0;} div.Section1 {page:Section1;} --> </style>
<br /><p class="MsoNormal">This Application demonstrates working of two Objects, Customer and Address, having One-To-One relationship.</p><p class="MsoNormal"><o:p></o:p></p><p class="MsoNormal">
<br /></p><p class="MsoNormal">It also demonstrates concepts of CASCADING, LAZY Loading, FETCHing and PERSISTing Server data on client side SQLite DB. </p><p class="MsoNormal"><o:p></o:p></p><p class="MsoNormal">
<br /></p><p class="MsoNormal">CONFLICT management is also one of the important concept for Offline applications, as user may be working in offline mode for a long time and when user tries to sync the data back to server it may happen that those datasets are already updated or deleted by other clients.</p><p class="MsoNormal"><o:p></o:p></p><p class="MsoNormal">
<br /></p><p class="MsoNormal">Also on server side it uses, newly introduced feature of ColdFusion 9, ORM, for Fetch() and Sync() methods. To get to know more on ORM feature of ColdFusion 9 refer the documentation. </p><p class="MsoNormal"><o:p></o:p></p><p class="MsoNormal"><b><span style="font-size:14;">
<br /></span></b></p><p class="MsoNormal"><b><span style="font-size:14;">How to setup this example as a project ?</span></b></p><p class="MsoNormal">
<br /><b><span style="font-size:14;"><o:p></o:p></span></b></p><p class="MsoNormal"><o:p></o:p></p><p class="MsoNormal">Download this application from below link.</p><p class="MsoNormal">
<br /></p><iframe scrolling="no" marginheight="0" marginwidth="0" frameborder="0" style="width:240px;height:66px;margin:3px;padding:0;border:1px solid #dde5e9;background-color:#ffffff;" src="http://cid-e7319d870dab450e.skydrive.live.com/embedrowdetail.aspx/.Public/AIR%20Offline%20Example.zip"></iframe>
<br /><meta content="text/html; charset=utf-8" equiv="Content-Type"><meta content="Word.Document" name="ProgId"><meta content="Microsoft Word 11" name="Generator"><meta content="Microsoft Word 11" name="Originator"><link href="file:///C:%5CDOCUME%7E1%5CCFQAUS%7E1.CFI%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml" rel="File-List"><o:smarttagtype name="Street" namespaceuri="urn:schemas-microsoft-com:office:smarttags"></o:smarttagtype><o:smarttagtype name="address" namespaceuri="urn:schemas-microsoft-com:office:smarttags"></o:smarttagtype><object id="ieooui" classid="clsid:38481807-CA0E-42D2-BF39-B33AF135CC4D"></object><style> st1\:*{behavior:url(#ieooui) } </style>
<br /><style> <!-- /* Font Definitions */ @font-face {font-family:Wingdings; panose-1:5 0 0 0 0 0 0 0 0 0; mso-font-charset:2; mso-generic-font-family:auto; mso-font-pitch:variable; mso-font-signature:0 268435456 0 0 -2147483648 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman";} @page Section1 {size:8.5in 11.0in; margin:1.0in 1.25in 1.0in 1.25in; mso-header-margin:.5in; mso-footer-margin:.5in; mso-paper-source:0;} div.Section1 {page:Section1;} --> </style>
<br /><p class="MsoNormal"><span style="font-family:Wingdings;"><span style="font-size:+0;">
<br /></span></span></p><p class="MsoNormal"><span class="Apple-style-span" style="font-family:Georgia;">--></span>After extracting the ZIP file, put “AIRIntegration” folder directly under your ColdFusion 9 <span style="font-size:+0;"></span>wwwroot</p><p class="MsoNormal"><o:p></o:p></p><p class="MsoNormal"><span style="font-family:Wingdings;"><span style="font-size:+0;">
<br /></span></span></p><p class="MsoNormal"><span class="Apple-style-span" style="font-family:Georgia;">--></span>Create a DataSource called ‘<b>AIROffline</b>’ in CF Admin on “AIRIntegration\
<br /></p><p class="MsoNormal">ServerSideDB_AIROfflineExample.mdb”<span style="font-size:+0;"> </span>using MS Access with Unicode as driver.</p><p class="MsoNormal"><o:p></o:p></p><p class="MsoNormal"><span style="font-family:Wingdings;"><span style="font-size:+0;">
<br /></span></span></p><p class="MsoNormal"><span class="Apple-style-span" style="font-family:Georgia;">--></span> Import ‘CFAIROfflineCustomerManagerApp.zip’ as Flex Project into your Flex Builder.
<br /></p><p class="MsoNormal">
<br /></p>--> <span style="font-family:times new roman;">Once Imported you may need to change ‘cfair.swc’ path from Project->Properties-> Flex build Path -> Library path. Adding this SWC file into your library path is very important in order to use AIR Offline feature of Coldfusion 9.</span><span style="font-family:times new roman;"> </span><span style="font-family:times new roman;">You may also want to change your compiler arguments to set the right path for services-config.xml file.</span>
<br />
<br />--> <span class="Apple-style-span" style="font-family:'times new roman';">Change the SyncManager CF Server credentials in application, as per your CF Server IP/Port/ContextRoot.</span>
<br /><div>
<br /><p class="MsoNormal"><o:p></o:p></p><p class="MsoNormal">Following above steps should be good to go for launching this Application.</p><p class="MsoNormal">
<br /></p><p class="MsoNormal"><o:p></o:p></p><p class="MsoNormal"><b><span style="font-size:14;">Let’s have a look at Client Side ActionScript Classes…</span></b></p><p class="MsoNormal">
<br /><b><span style="font-size:14;"><o:p></o:p></span></b></p><p class="MsoNormal"><b><span style="font-size:14;"><o:p></o:p></span></b></p><p class="MsoNormal">I have explained the constructs of the class by providing inline comments, so read through it.</p><p class="MsoNormal">
<br /></p><p class="MsoNormal"><o:p></o:p></p><p class="MsoNormal"><b><u>Customer.as</u></b></p><p class="MsoNormal">
<br /><b><u><o:p></o:p></u></b></p><p class="MsoNormal"><b><o:p></o:p></b></p><div style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 4pt; PADDING-BOTTOM: 1pt; BORDER-LEFT: windowtext 1pt solid; PADDING-TOP: 1pt; BORDER-BOTTOM: windowtext 1pt solid"><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><b><span style="font-family:';font-size:10;">package</span></b><span style="font-family:';font-size:10;color:black;"> onetoone</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;">{</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span>[</span><b><span style="font-family:';font-size:10;">Bindable</span></b><span style="font-family:';font-size:10;color:black;">]<o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span>// corresponding Server side class</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span>[RemoteClass(alias=</span><b><span style="font-family:';font-size:10;">"AIRIntegration.customer"</span></b><span style="font-family:';font-size:10;color:black;">)]<o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span>// This tag is required to create a client side Table for Class<o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span>[Entity]</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span>// Optional. If table name is not provided, class name will be<span style="font-size:+0;"> </span><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span>//considered as default name for creating table<span style="font-size:+0;"> </span><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span>[Table(name=”Customer”)]<o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span></span><b><span style="font-family:';font-size:10;">public</span></b><span style="font-family:';font-size:10;color:black;"> </span><b><span style="font-family:';font-size:10;">class</span></b><span style="font-family:';font-size:10;color:black;"> Customer</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span>{<o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span>//Define PK for Offline “Customer” table, “cid” will be PK</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span>[Id]<span style="font-size:+0;"> </span><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span></span><b><span style="font-family:';font-size:10;">public</span></b><span style="font-family:';font-size:10;color:black;"> </span><b><span style="font-family:';font-size:10;">var</span></b><span style="font-family:';font-size:10;color:black;"> cid:int;</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span></span><b><span style="font-family:';font-size:10;">public</span></b><span style="font-family:';font-size:10;color:black;"> </span><b><span style="font-family:';font-size:10;">var</span></b><span style="font-family:';font-size:10;color:black;"> name:String;</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span>// Defines OneToOne relationship with Address class</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span>[OneToOne(cascadeType=</span><b><span style="font-family:';font-size:10;">'ALL'</span></b><span style="font-family:';font-size:10;color:black;">,fetchType=</span><b><span style="font-family:';font-size:10;">"EAGER"</span></b><span style="font-family:';font-size:10;color:black;">)]<o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span>// Foreign Key Column which will be referring to Address table<o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span>// name=</span><b><span style="font-family:';font-size:10;">"add_id" --> </span></b><span style="font-family:';font-size:10;">FK Column Name<b><span style="COLOR: rgb(153,0,0)"> <o:p></o:p></span></b></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><b><span style="font-family:';font-size:10;"><span style="font-size:+0;"></span>// </span></b><span style="font-family:';font-size:10;color:black;">referencedColumnName=</span><b><span style="font-family:';font-size:10;">"aid" --> </span></b><span style="font-family:';font-size:10;">Refers to the <?xml:namespace prefix = st1 /><st1:street st="on"><st1:address st="on">Address Table PK</st1:address></st1:street></span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span>[JoinColumn(name=</span><b><span style="font-family:';font-size:10;">"add_id"</span></b><span style="font-family:';font-size:10;color:black;">,referencedColumnName=</span><b><span style="font-family:';font-size:10;">"aid"</span></b><span style="font-family:';font-size:10;color:black;">)]</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span></span><b><span style="font-family:';font-size:10;">public</span></b><span style="font-family:';font-size:10;color:black;"> </span><b><span style="font-family:';font-size:10;">var</span></b><span style="font-family:';font-size:10;color:black;"> address:Address;</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span>}</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;">}<o:p></o:p></span></p></div><p class="MsoNormal"><span style="font-family:';font-size:10;color:black;"><o:p></o:p></span></p><p class="MsoNormal"><b><u><span style="color:black;">
<br /></span></u></b></p><p class="MsoNormal"><b><u><span style="color:black;">Address.as</span></u></b></p><p class="MsoNormal">
<br /><b><u><span style="color:black;"><o:p></o:p></span></u></b></p><p class="MsoNormal"><b><span style="color:black;"><o:p></o:p></span></b></p><div style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 4pt; PADDING-BOTTOM: 1pt; BORDER-LEFT: windowtext 1pt solid; PADDING-TOP: 1pt; BORDER-BOTTOM: windowtext 1pt solid"><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><b><span style="font-family:';font-size:10;">package</span></b><span style="font-family:';font-size:10;color:black;"> onetoone</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;">{</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span>[</span><b><span style="font-family:';font-size:10;">Bindable</span></b><span style="font-family:';font-size:10;color:black;">]</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span>[RemoteClass(alias=</span><b><span style="font-family:';font-size:10;">"AIRIntegration.address"</span></b><span style="font-family:';font-size:10;color:black;">)]</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span>[Entity]</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span></span><b><span style="font-family:';font-size:10;">public</span></b><span style="font-family:';font-size:10;color:black;"> </span><b><span style="font-family:';font-size:10;">class</span></b><span style="font-family:';font-size:10;color:black;"> Address</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span>{</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span><span style="font-size:+0;"></span>[Id]</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span></span><b><span style="font-family:';font-size:10;">public</span></b><span style="font-family:';font-size:10;color:black;"> </span><b><span style="font-family:';font-size:10;">var</span></b><span style="font-family:';font-size:10;color:black;"> aid:int;</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span></span><b><span style="font-family:';font-size:10;">public</span></b><span style="font-family:';font-size:10;color:black;"> </span><b><span style="font-family:';font-size:10;">var</span></b><span style="font-family:';font-size:10;color:black;"> street:String;</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span></span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span>}</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;">}</span><b><span style="color:black;"><o:p></o:p></span></b></p></div><p class="MsoNormal"><o:p></o:p></p><p class="MsoNormal"><b><span style="font-size:14;"><o:p></o:p></span></b></p><p class="MsoNormal"><b><span style="font-size:14;">
<br /></span></b></p><p class="MsoNormal"><b><span style="font-size:14;">Corresponding Server side ORM CFCs ….</span></b></p><p class="MsoNormal">
<br /><b><span style="font-size:14;"><o:p></o:p></span></b></p><p class="MsoNormal"><b><span style="font-size:14;"><o:p></o:p></span></b></p><p class="MsoNormal"><b><u>customer.cfc : </u></b><span style="font-size:+0;"></span>This ORM Cutomer CFC has one-to-one relationship with Address CFC, as it can be observed in the 3<sup>rd</sup> cfproperty defined.</p><p class="MsoNormal">
<br /></p><p class="MsoNormal"><link href="file:///C:%5CDOCUME%7E1%5CCFQAUS%7E1.CFI%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml" rel="File-List"><style> <!-- /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman";} @page Section1 {size:8.5in 11.0in; margin:1.0in 1.25in 1.0in 1.25in; mso-header-margin:.5in; mso-footer-margin:.5in; mso-paper-source:0;} div.Section1 {page:Section1;} --> </style></p><div style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 4pt; PADDING-BOTTOM: 1pt; BORDER-LEFT: windowtext 1pt solid; PADDING-TOP: 1pt; BORDER-BOTTOM: windowtext 1pt solid"><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;">
<br /></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;"><cfcomponent persistent="true"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;"><span style="font-size:+0;"></span><cfproperty name="cid" fieldtype="id" ><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;"><span style="font-size:+0;"></span><cfproperty name="name" ><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;"><span style="font-size:+0;"></span><cfproperty name="address" fieldType='one-to-one' CFC="address" fkcolumn='aid' cascade='all' lazy="false"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;"></cfcomponent></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none">
<br /><span style="font-family:';font-size:10;"><o:p></o:p></span></p></div><p></p><p class="MsoNormal"><b><u>
<br /></u></b></p><p class="MsoNormal"><b><u>address.cfc: </u></b>This ORM Address CFC has no references back to Cutomer CFC it being a one directional relationship. Although it’s quite possible to have bidirectional relationship.</p><p class="MsoNormal">
<br /></p><p class="MsoNormal"><link href="file:///C:%5CDOCUME%7E1%5CCFQAUS%7E1.CFI%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml" rel="File-List"><style> <!-- /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman";} @page Section1 {size:8.5in 11.0in; margin:1.0in 1.25in 1.0in 1.25in; mso-header-margin:.5in; mso-footer-margin:.5in; mso-paper-source:0;} div.Section1 {page:Section1;} --> </style></p><div style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 4pt; PADDING-BOTTOM: 1pt; BORDER-LEFT: windowtext 1pt solid; PADDING-TOP: 1pt; BORDER-BOTTOM: windowtext 1pt solid"><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;">
<br /></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;"><cfcomponent persistent="true"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;"><span style="font-size:+0;"></span><cfproperty name="aid" fieldtype="id" ><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;"><span style="font-size:+0;"></span><cfproperty name="street" ><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;"></cfcomponent></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;">
<br /></span></p></div><p></p><p class="MsoNormal"><b><u>
<br /></u></b></p><p class="MsoNormal"><b><u>cusManger.cfc: </u></b><span style="font-size:+0;"></span>This is the Manger CFC which AIR Offline app client interacts with. This Manger CFC will have to implement “CFIDE.AIR.ISyncManger”. This interface has declaration for SYNC method. The SYNC Method in the following code handles CONFLICT management as well part from persisting client data changes to server. It Uses ORM Entity methods to perform the CRUD operations.
<br /></p><p class="MsoNormal">
<br /></p><p class="MsoNormal"><o:p></o:p></p><p class="MsoNormal">These CRUD operations could also be done using normal <cfquery>but that would be not so clean way of writing SYNC method. Because Query approach will require query records sets to get translated into Objects before sending data to AIR Offline app client. And also vice versa, each and every property of AIR Client Objects needs to be accessed for performing CRUD operations.</cfquery></p><p class="MsoNormal"><cfquery>
<br /></cfquery></p><p class="MsoNormal"><o:p></o:p></p><p class="MsoNormal">Also Notice the ORMGetSession().merge() methods in SYNC<span style="font-size:+0;"> </span>method usage before calling EntitySave() / EntityDelete() methods. You may see following kind of error message if you are using Old Style (cf8) Remoting with AIR Offline applications having server side "Sync" method using ORM EntitySave()/EntityDelete() methods.
<br /></p><p class="MsoNormal">
<br /></p><p class="MsoNormal"><o:p></o:p></p><p class="MsoNormal">Error handling message: flex.messaging.MessageException: Unable to invoke CFC - a different object with the same identifier value was already associatedwith the session: [address#1]. Root cause :org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated withthe session: [address#1]</p><p class="MsoNormal"><o:p></o:p></p><p class="MsoNormal">
<br /></p><p class="MsoNormal">You may also encounter this error with new style (cf9) Remoting also but only for EntityDelete method.</p><p class="MsoNormal">Same above solution will apply to resolve this issue.</p>
<br /><link href="file:///C:%5CDOCUME%7E1%5CCFQAUS%7E1.CFI%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml" rel="File-List"><style> <!-- /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman";} @page Section1 {size:8.5in 11.0in; margin:1.0in 1.25in 1.0in 1.25in; mso-header-margin:.5in; mso-footer-margin:.5in; mso-paper-source:0;} div.Section1 {page:Section1;} --> </style>
<br /><p class="MsoNormal"><o:p></o:p></p><div style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 1pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 1pt; PADDING-BOTTOM: 1pt; BORDER-LEFT: windowtext 1pt solid; PADDING-TOP: 1pt; BORDER-BOTTOM: windowtext 1pt solid"><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><o:p></o:p></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><cfcomponent implements="CFIDE.AIR.ISyncManager"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><!----Fetch method---><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><cffunction name="fetch" returnType="Array" access="remote"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><cfset cus = ArrayNew(1)><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><!----This ORM Method will load all data from Server Customer table and send it to AIR client ----><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><cfset cus = EntityLoad("customer")><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><cfreturn cus><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ></cffunction><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><!----SYNC method, Sync Client data with Server and also handles Conflicts---><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><cffunction name="sync" returntype="any"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><cfargument name="operations" type="array" required="true"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><cfargument name="clientobjects" type="array" required="true"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><cfargument name="originalobjects" type="array" required="false"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><span style="font-size:+0;"></span><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><cfset conclits = ArrayNew(1)><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><cfset conflictcount = 1><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><cfloop index="i" from="1" to="#ArrayLen( operations )#"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><span style="font-size:+0;"></span><cfset operation = operations[i]><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><span style="font-size:+0;"></span><cfset clientobject = clientobjects[i]><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><span style="font-size:+0;"></span><cfset originalobject = originalobjects[i]><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><span style="font-size:+0;"></span><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><span style="font-size:+0;"></span><cfif operation eq "INSERT"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><span style="font-size:+0;"></span><cfset obj = ORMGetSession().merge(clientobject)><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><span style="font-size:+0;"></span><cfset EntitySave(obj)><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><span style="font-size:+0;"></span><cfelseif listfindnocase("UPDATE,DELETE",operation) neq 0><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><span style="font-size:+0;"></span><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><span style="font-size:+0;"></span><cfif isinstanceOf(originalobject,"customer")><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><span style="font-size:+0;"></span><cfset serverobject = EntityLoadByPK("customer",originalobject.getcid())><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><span style="font-size:+0;"></span><cfelseif isinstanceOf(originalobject,"address")><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><span style="font-size:+0;"></span><!---Ignoring Address object, as it is casceded with Customer Object, so while saving Custoemr, Address will also be saved,<o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><span style="font-size:+0;"></span>If not Ignored, then It will result in Conflict, incase Cutomer and Address CFC relationship has lazy=fasle. <o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><span style="font-size:+0;"></span>---><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><span style="font-size:+0;"></span><cfcontinue><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><span style="font-size:+0;"></span><!---<cfset serverobject = EntityLoadByPK("address",originalobject.getaid())><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><span style="font-size:+0;"></span><cflog text="AddressID: #originalobject.getaid()#">---><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><span style="font-size:+0;"></span><cfelse><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><span style="font-size:+0;"></span><cfthrow message="Invalid Object"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><span style="font-size:+0;"></span></cfif><span style="font-size:+0;"> </span><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><span style="font-size:+0;"></span><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><span style="font-size:+0;"></span><cfif not isdefined('serverobject') ><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><span style="font-size:+0;"></span><cflog text="CONFLICT::SERVER OBJECT NOT FOUND, RECORD MAY BE DELETED ALREADY"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><span style="font-size:+0;"></span><cfset conflict = CreateObject("component","CFIDE.AIR.conflict")><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><span style="font-size:+0;"></span><cfset conflict.clientobject = clientobject><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><span style="font-size:+0;"></span><cfset conflict.originalobject = originalobject><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><span style="font-size:+0;"></span><cfset conflict.operation = operation><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><span style="font-size:+0;"></span><cfset conflicts[conflictcount++] = conflict><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><span style="font-size:+0;"></span><cfcontinue><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><span style="font-size:+0;"></span></cfif><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><span style="font-size:+0;"></span><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><span style="font-size:+0;"></span><cfset isNotConflict = ObjectEquals(originalobject, serverobject)><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><span style="font-size:+0;"></span><cfif isNotConflict><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><span style="font-size:+0;"></span><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><span style="font-size:+0;"></span><cfif operation eq "UPDATE"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><span style="font-size:+0;"></span><span style="font-size:+0;"></span><cfdump var="#clientobject#" output="C:\clientobject.txt"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><span style="font-size:+0;"></span><span style="font-size:+0;"></span><cfset obj = ORMGetSession().merge(clientobject)><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><span style="font-size:+0;"></span><span style="font-size:+0;"></span><cfset EntitySave(obj)><span style="font-size:+0;"> </span><span style="font-size:+0;"></span><span style="font-size:+0;"></span><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><span style="font-size:+0;"></span><cfelseif operation eq "DELETE"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><span style="font-size:+0;"></span><span style="font-size:+0;"></span><cfset obj = ORMGetSession().merge(originalobject)><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><span style="font-size:+0;"></span><span style="font-size:+0;"></span><cfset EntityDelete(obj)><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><span style="font-size:+0;"></span></cfif><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><span style="font-size:+0;"></span><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><span style="font-size:+0;"></span><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><span style="font-size:+0;"></span><cfelse><!----Conflict---><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><span style="font-size:+0;"></span><cflog text = "is a conflict"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><span style="font-size:+0;"></span><cfset conflict = CreateObject("component","CFIDE.AIR.conflict")><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><span style="font-size:+0;"></span><cfset conflict.serverobject = serverobject><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><span style="font-size:+0;"></span><cfset conflict.clientobject = clientobject><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><span style="font-size:+0;"></span><cfset conflict.originalobject = originalobject><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><span style="font-size:+0;"></span><cfset conflict.operation = operation><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><span style="font-size:+0;"></span><cfset conflicts[conflictcount++] = conflict><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><span style="font-size:+0;"></span><cfcontinue><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><span style="font-size:+0;"></span></cfif><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><span style="font-size:+0;"></span></cfif><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><span style="font-size:+0;"></span><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ></cfloop><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><cfif conflictcount gt 1><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><span style="font-size:+0;"></span><cfreturn conflicts><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ></cfif><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ><span style="font-size:+0;"></span><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ></cffunction><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="Courier: ;font-size:10;" ></cfcomponent><b><o:p></o:p></b></span></p></div><p class="MsoNormal"><o:p></o:p></p>
<br />
<br /><p class="MsoNormal"><b><span style="font-size:14;">What is the Flow Of the client side AIR Application ?<o:p></o:p></span></b></p><p class="MsoNormal"><o:p></o:p></p><p class="MsoNormal">
<br /></p><p class="MsoNormal">It is upto developer to decided on the Offline application workflow depending upon the application requirements. But I am trying to present here a general approach which may be suitable for a large number of offline applications.</p><p class="MsoNormal"><o:p></o:p></p><p class="MsoNormal">As soon as this example application is launched, it will first try to connect to server by creating an instance of SyncManger, in order to fetch the server data. <span style="font-size:+0;"></span>See the following code snippets with inline comments provided. </p><p class="MsoNormal">
<br /></p><p class="MsoNormal"><o:p></o:p></p><div style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 4pt; PADDING-BOTTOM: 1pt; BORDER-LEFT: windowtext 1pt solid; PADDING-TOP: 1pt; BORDER-BOTTOM: windowtext 1pt solid"><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><o:p></o:p></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><b><span style="font-family:';font-size:10;">private</span></b><span style="font-family:';font-size:10;color:black;"> </span><b><span style="font-family:';font-size:10;">function</span></b><span style="font-family:';font-size:10;color:black;"> init():</span><b><span style="font-family:';font-size:10;">void</span></b><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;">{</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span></span><i><span style="font-family:';font-size:10;">// Provide Credentials for Server side Connection and CFC</span></i><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span>syncmanager = </span><b><span style="font-family:';font-size:10;">new</span></b><span style="font-family:';font-size:10;color:black;"> SyncManager();</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span>syncmanager.cfPort = 8501;</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span>syncmanager.cfServer = </span><b><span style="font-family:';font-size:10;">"localhost"</span></b><span style="font-family:';font-size:10;color:black;">;</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span></span><i><span style="font-family:';font-size:10;">// Path of the Server side CFC having Sync/Fetch method, relative from CF webroot</span></i><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span>syncmanager.syncCFC = </span><b><span style="font-family:';font-size:10;">"AIRIntegration.cusManager"</span></b><span style="font-family:';font-size:10;color:black;">;</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span></span><i><span style="font-family:';font-size:10;">// THis handler will be called when any COnflict occures while writing back changes on serverside </span></i><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span>syncmanager.addEventListener(ConflictEvent.CONFLICT, conflictHandler);</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span></span><i><span style="font-family:';font-size:10;">// Fetch Server side DB data onto Client SQLite DB while starting the App itself </span></i><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span></span><b><span style="font-family:';font-size:10;">var</span></b><span style="font-family:';font-size:10;color:black;"> token:AsyncToken= syncmanager.fetch(</span><b><span style="font-family:';font-size:10;">"fetch"</span></b><span style="font-family:';font-size:10;color:black;">);</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span><u>token</u>.addResponder(</span><b><span style="font-family:';font-size:10;">new</span></b><span style="font-family:';font-size:10;color:black;"> mx.rpc.Responder(fetchSuccess, fetchFault));</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span></span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;">}</span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><o:p></o:p></p></div><p class="MsoNormal"><o:p></o:p></p><p class="MsoNormal">
<br /></p><p class="MsoNormal">Once Server connection is established successfully it fetches the data on client side and stores it on local clientside SQLite DB by creating a DB, if already not created.
<br /></p><p class="MsoNormal">
<br /></p><p class="MsoNormal"><o:p></o:p></p><div style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 4pt; PADDING-BOTTOM: 1pt; BORDER-LEFT: windowtext 1pt solid; PADDING-TOP: 1pt; BORDER-BOTTOM: windowtext 1pt solid"><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><o:p></o:p></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><b><span style="font-family:';font-size:10;">private</span></b><span style="font-family:';font-size:10;color:black;"> </span><b><span style="font-family:';font-size:10;">function</span></b><span style="font-family:';font-size:10;color:black;"> fetchSuccess(event:SyncResultEvent):</span><b><span style="font-family:';font-size:10;">void</span></b><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;">{</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span></span><b><span style="font-family:';font-size:10;">var</span></b><span style="font-family:';font-size:10;color:black;"> cus:Array = event.result </span><b><span style="font-family:';font-size:10;">as</span></b><span style="font-family:';font-size:10;color:black;"> Array;</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span>cusColl = </span><b><span style="font-family:';font-size:10;">new</span></b><span style="font-family:';font-size:10;color:black;"> ArrayCollection(cus);</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><i><span style="font-family:';font-size:10;">// Open a Session for the client side SQLite DB, It will create a<span style="font-size:+0;"> </span>//DB with Name “onetonesync.db” under user directory</span></i><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span>dbFile = File.userDirectory.resolvePath(</span><b><span style="font-family:';font-size:10;">"onetoonesync.db"</span></b><span style="font-family:';font-size:10;color:black;">);</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><i><span style="font-family:';font-size:10;">/*<o:p></o:p></span></i></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><i><span style="font-family:';font-size:10;">Providing a Unique interger number in openSession method is required in order to create a unique database session, in order to avoid conflicts with other Applications.<o:p></o:p></span></i></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><i><span style="font-family:';font-size:10;">*/</span></i><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span></span><b><span style="font-family:';font-size:10;">var</span></b><span style="font-family:';font-size:10;color:black;"> sessiontoken:SessionToken =syncmanager.openSession(dbFile,017915);</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span>sessiontoken.addResponder(</span><b><span style="font-family:';font-size:10;">new</span></b><span style="font-family:';font-size:10;color:black;"> mx.rpc.Responder(connectSuccess,connectFault));</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;">}</span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><o:p></o:p></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><b><span style="font-family:';font-size:10;">private</span></b><span style="font-family:';font-size:10;color:black;"> </span><b><span style="font-family:';font-size:10;">function</span></b><span style="font-family:';font-size:10;color:black;"> connectSuccess(event:SessionResultEvent):</span><b><span style="font-family:';font-size:10;">void</span></b><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;">{</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span>session = event.sessionToken.session;</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span></span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span></span><b><span style="font-family:';font-size:10;">if</span></b><span style="font-family:';font-size:10;color:black;">(cusColl.length > 0)</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span>{</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span></span><i><span style="font-family:';font-size:10;">// This operation will save/update fetched data into AIR SQLite DB<span style="font-size:+0;"> </span></span></i><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span></span><b><span style="font-family:';font-size:10;">var</span></b><span style="font-family:';font-size:10;color:black;"> savetoken:SessionToken = session.saveUpdateCache(cusColl);</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span>savetoken.addResponder(</span><b><span style="font-family:';font-size:10;">new</span></b><span style="font-family:';font-size:10;color:black;"> mx.rpc.Responder(saveCacheSuccess, savefault));</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span>}</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span></span><b><span style="font-family:';font-size:10;">else</span></b><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span>{</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span>Alert.show(</span><b><span style="font-family:';font-size:10;">"No data available from Server to save on local DB, Grid will be attempted to load with local DB Data if any available"</span></b><span style="font-family:';font-size:10;color:black;">);</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span>updateGrid();</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span>}</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span><span style="font-size:+0;"></span></span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;">}</span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><o:p></o:p></p></div><p class="MsoNormal"><o:p></o:p></p><p class="MsoNormal">
<br /></p><p class="MsoNormal">
<br /></p><p class="MsoNormal">So now, user has local data available to work with in offline mode. This data will be available even in case of server is unreachable or network outage. </p><p class="MsoNormal"><o:p></o:p></p><p class="MsoNormal">User has all the liberty to perform CRUD operation by Adding new records, by Editing existing Records or by Deleting them.
<br /></p><p class="MsoNormal">
<br /></p><p class="MsoNormal">
<br /></p><p class="MsoNormal"><o:p></o:p></p><div style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 4pt; PADDING-BOTTOM: 1pt; BORDER-LEFT: windowtext 1pt solid; PADDING-TOP: 1pt; BORDER-BOTTOM: windowtext 1pt solid"><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><i><span style="font-family:';font-size:10;"><o:p></o:p></span></i></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><i><span style="font-family:';font-size:10;">// This Method will be used for Insert / Update operations</span></i><b><span style="font-family:';font-size:10;"><o:p></o:p></span></b></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><b><span style="font-family:';font-size:10;">private</span></b><span style="font-family:';font-size:10;color:black;"> </span><b><span style="font-family:';font-size:10;">function</span></b><span style="font-family:';font-size:10;color:black;"> SaveLocal():</span><b><span style="font-family:';font-size:10;">void</span></b><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span>{</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span>cus = </span><b><span style="font-family:';font-size:10;">new</span></b><span style="font-family:';font-size:10;color:black;"> Customer();</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span>cus.cid = int(cusId.text);</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span>cus.name = cusName.text;</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span></span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span>add = </span><b><span style="font-family:';font-size:10;">new</span></b><span style="font-family:';font-size:10;color:black;"> Address();</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span>add.aid = int(AddId.text);</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span>add.street = AddStreet.text;</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span></span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span>cus.address = add;</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span></span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span></span><i><span style="font-family:';font-size:10;">/*</span></i><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><i><span style="font-family:';font-size:10;"><span style="font-size:+0;"></span>INSERT the new Records, this will be first saveed in client side SQLite DB, only on Commit operation this will be saved this new records in Server side DB. Notice that we are only saving Customer here, this operation will also save the binded Address Object also, as both the entities are CASCADED inside Customer Class</span></i><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><i><span style="font-family:';font-size:10;"><span style="font-size:+0;"></span>*/</span></i><span style="font-family:';font-size:10;color:black;"> </span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span></span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span></span><b><span style="font-family:';font-size:10;">var</span></b><span style="font-family:';font-size:10;color:black;"> savetoken:SessionToken = session.saveUpdate(cus);<span style="font-size:+0;"> </span></span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span>savetoken.addResponder(</span><b><span style="font-family:';font-size:10;">new</span></b><span style="font-family:';font-size:10;color:black;"> mx.rpc.Responder(savesuccess, savefault));</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span></span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span>}<o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><i><span style="font-family:';font-size:10;"><o:p></o:p></span></i></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><i><span style="font-family:';font-size:10;">// This Method will be used for Delete operations<o:p></o:p></span></i></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><b><span style="font-family:';font-size:10;">private</span></b><span style="font-family:';font-size:10;color:black;"> </span><b><span style="font-family:';font-size:10;">function</span></b><span style="font-family:';font-size:10;color:black;"> DeleteLocal():</span><b><span style="font-family:';font-size:10;">void</span></b><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span>{</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span>cus = </span><b><span style="font-family:';font-size:10;">new</span></b><span style="font-family:';font-size:10;color:black;"> Customer();</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span>cus.cid = int(cusId.text);</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span>cus.name = cusName.text;</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span></span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span>add = </span><b><span style="font-family:';font-size:10;">new</span></b><span style="font-family:';font-size:10;color:black;"> Address();</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span>add.aid = int(AddId.text);</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span>add.street = AddStreet.text;</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span></span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span>cus.address = add;</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span></span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span></span><b><span style="font-family:';font-size:10;">var</span></b><span style="font-family:';font-size:10;color:black;"> savetoken:SessionToken = session.remove(cus);<span style="font-size:+0;"> </span></span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span>savetoken.addResponder(</span><b><span style="font-family:';font-size:10;">new</span></b><span style="font-family:';font-size:10;color:black;"> mx.rpc.Responder(removeSuccess, removeFault));</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span>}<o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><o:p></o:p></p></div><p class="MsoNormal"><o:p></o:p></p><p class="MsoNormal">
<br /></p><p class="MsoNormal">
<br /></p><p class="MsoNormal">At any point in time if user feels like getting fresh data from Server, he can do so by pressing the “Fetch Data Server” button. This operation will override the Updated/deleted data changes by user. Newly inserted records on local DB table will have no impact by Fetch data operation. So it makes sense to perform this operation while only when you changes are Synced with Server.
<br /></p><p class="MsoNormal">
<br /></p><p class="MsoNormal"><o:p></o:p></p><p class="MsoNormal">Once after performing the required data changes, user needs to write back this data on server. It can be done by performing “Commit” operation by pressing “Commit/Sync local data to Server” button.
<br /></p><p class="MsoNormal">
<br /></p><p class="MsoNormal">
<br /></p><p class="MsoNormal"><o:p></o:p></p><div style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 4pt; PADDING-BOTTOM: 1pt; BORDER-LEFT: windowtext 1pt solid; PADDING-TOP: 1pt; BORDER-BOTTOM: windowtext 1pt solid"><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><o:p></o:p></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><b><span style="font-family:';font-size:10;">private</span></b><span style="font-family:';font-size:10;color:black;"> </span><b><span style="font-family:';font-size:10;">function</span></b><span style="font-family:';font-size:10;color:black;"> commit():</span><b><span style="font-family:';font-size:10;">void</span></b><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;">{</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span></span><i><span style="font-family:';font-size:10;">/*</span></i><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><i><span style="font-family:';font-size:10;"><span style="font-size:+0;"></span>So far, we have performed Insert/Update/Delete operation on Customer/Address entities on client side SQLite DB, Now let's send them to Server by performing COMMIT Operation</span></i><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><i><span style="font-family:';font-size:10;"><span style="font-size:+0;"></span>*/</span></i><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span></span><b><span style="font-family:';font-size:10;">var</span></b><span style="font-family:';font-size:10;color:black;"> committoken:SessionToken = session.commit();</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span>committoken.addResponder(</span><b><span style="font-family:';font-size:10;">new</span></b><span style="font-family:';font-size:10;color:black;"> mx.rpc.Responder(commitSuccess, commitFault));<span style="font-size:+0;"> </span></span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span></span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;">}</span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><o:p></o:p></p></div><p class="MsoNormal"><o:p></o:p></p><p class="MsoNormal"><o:p></o:p></p><p class="MsoNormal">
<br /></p><p class="MsoNormal">
<br /></p><p class="MsoNormal">Now, while Syncing back data on Server, it may happen that user has stale data that he was working on OR User is updating a record that is already deleted from Server. In this case, Server CFC will throw back an array of Conflicts back to client, informing client about the latest server data copy. There will be a Conflict Event on client and eventually Conflict Handler will be called. <span style="font-size:+0;"></span>Now, it is upto user to Accept / Ignore this Server changes. Incase, user wants to Accpets these changes he can do so as following.
<br /></p><p class="MsoNormal">
<br /></p><p class="MsoNormal"><o:p></o:p></p><p class="MsoNormal">One more Important aspect of Conflict handler that one need to know is, even incase of conflict, the Commit Success event will be fired. So, you will see that ConflictHandler as well as CommitSuccess Handlers both will be called. This happens because commit success event is fired when data changes from client reaches to server successfully. Now, this data gets written on server DB or not, it doesn’t wait for this. And hence, if there are conflicts here, we fire another Conflict event.<span style="font-size:+0;"> </span></p><p class="MsoNormal">
<br /></p><p class="MsoNormal">
<br /></p><p class="MsoNormal"><o:p></o:p></p><div style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 4pt; PADDING-BOTTOM: 1pt; BORDER-LEFT: windowtext 1pt solid; PADDING-TOP: 1pt; BORDER-BOTTOM: windowtext 1pt solid"><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><o:p></o:p></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><b><span style="font-family:';font-size:10;">private</span></b><span style="font-family:';font-size:10;color:black;"> </span><b><span style="font-family:';font-size:10;">function</span></b><span style="font-family:';font-size:10;color:black;"> conflictHandler(event:ConflictEvent):</span><b><span style="font-family:';font-size:10;">void</span></b><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;">{</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span>Alert.show(</span><b><span style="font-family:';font-size:10;">"conflict man!"</span></b><span style="font-family:';font-size:10;color:black;">);</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span></span><b><span style="font-family:';font-size:10;">var</span></b><span style="font-family:';font-size:10;color:black;"> conflicts:ArrayCollection = event.result </span><b><span style="font-family:';font-size:10;">as</span></b><span style="font-family:';font-size:10;color:black;"> ArrayCollection;</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span></span><i><span style="font-family:';font-size:10;">// Accept Server data and write it to client side SQLite DB</span></i><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span></span><b><span style="font-family:';font-size:10;">var</span></b><span style="font-family:';font-size:10;color:black;"> token:SessionToken = session.keepAllServerObjects(conflicts);</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;"><span style="font-size:+0;"></span>token.addResponder(</span><b><span style="font-family:';font-size:10;">new</span></b><span style="font-family:';font-size:10;color:black;"> mx.rpc.Responder(conflictSuccess, conflictFault));</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><span style="font-family:';font-size:10;color:black;">}</span><span style="font-family:';font-size:10;"><o:p></o:p></span></p><p class="MsoNormal" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none"><o:p></o:p></p></div><p class="MsoNormal"><o:p></o:p></p>
<br /></div>
<br />Jayesh Viradiyahttp://www.blogger.com/profile/15200995560853101319noreply@blogger.com138tag:blogger.com,1999:blog-721341350366920435.post-67092527854208065362008-09-04T10:44:00.005+05:302008-09-04T11:34:13.469+05:30ColdFusion 8 Enterprise- Free for Educational purpose"ColdFusion 8 Enterprise" is now free for Students and Educators....See the details on the following link.<br /><a title="blocked::http://www.webbschofield.com/index.cfm/2008/9/2/ColdFusion-8-Now-Available-to-Students-and-Educators-for-Free" href="http://www.webbschofield.com/index.cfm/2008/9/2/ColdFusion-8-Now-Available-to-Students-and-Educators-for-Free">http://www.webbschofield.com/index.cfm/2008/9/2/ColdFusion-8-Now-Available-to-Students-and-Educators-for-Free</a><br />There’s also a FAQ posted here about the offer: <a title="http://www.stage.adobe.com/products/coldfusion/faq/" href="http://www.stage.adobe.com/products/coldfusion/faq/">http://www.stage.adobe.com/products/coldfusion/faq/</a>Jayesh Viradiyahttp://www.blogger.com/profile/15200995560853101319noreply@blogger.com7tag:blogger.com,1999:blog-721341350366920435.post-50608279306113520182008-07-17T16:59:00.005+05:302008-07-22T14:43:57.033+05:30Finetune ColdFusion Server PerformanceLet me just put across some terminologies before I present my thoughts on improving/fine tuning the ColdFusion Server performance.<br /><br /><strong>Request Wait Time</strong><br />The number of milliseconds that a request was waiting in the queue before starting to execute.<br /><strong></strong><br /><strong>Requests Running</strong><br />The number of request currently under execution by server.<br /><strong></strong><br /><strong>Request Execution Time</strong><br />The number of milliseconds that a request took to execute on server.<br /><strong></strong><br /><strong>Requests Queued</strong><br />The number of queued requests that are waiting to be processed.<br /><br />Keeping all the above terms in consideration the Response time could roughly be calculated as below...<br /><br />HTTP Response time / PageLoad Time = "Webserver trip time for Browser and Application Server" + "Request Wait Time" + "HTTP Request Execution Time on Application Server"<br /><br />Now, Before we move on let us know what different kind of requests ColdFusion server can handle.<br /><br /><strong>What Kind of Requests can ColdFusion Server accept via HTTP ?</strong><br /><br />Currently with ColdFusion8, it accepts 4 kinds of requests via HTTP<br />1. CFML Template requests<br />2. Flash Remoting requests<br />3. WebService requests<br />4. CFC function requests<br /><br />Each of the above 4 type of HTTP requests can be moderated for simultaneous request execution from "CFAdmin->ServerSettings->Request Tuning". So Next question here could be asked is, <strong>What should be the limit for each one of the above 4 ?</strong><br /><br />It depends, what kind of Applications are deployed on the ColdFusion server. One need to find out, which of the above 4 techniques are hugely used in the deployed Applications.<br /><br />--> Traditionally ColdFusion Application generally uses CFML template Requests, so in this case increase the CFML template request accordingly.<br /><br />--> With Flex/AIR technologies gaining momentum, a lot many Flash Remoting Calls could be coming into the server, so in this case it would make sense to increase the Flash Remoting Request Limit.<br /><br />--> Likewise, if your application is hugely using CF WebService / CFC function requests then it would make sense to increase "webservice" and "CFC" request limits respectively.<br /><br />ColdFusion uses JRun as underlying J2EE application server to run on. Here JRun is the master server which can control the simultaneous request execution limit. So Coldfusion has to respect this limit in order to moderate the simultaneous running request for the above 4 types of HTTP request, Meaning....... "Maximum number of running JRun threads Limit must be, greater than Simultaneous ( CFML Template + Flash Remoting + WebService + CFC ) Limits"<br />For example say,<br /><br />CFML Template requests --> 20<br />Flash Remoting requests --> 20<br />WebService requests --> 10<br />CFC function requests --> 20<br />-----------------------------------------<br />Total --> 70<br /><br />so, "Maximum number of running JRUN threads" must be greater than 70. If the value "Maximum Run Threads" is changed, then ColdFusion server needs to be restarted for the change to take effect<br /><br /><strong>By how much we should/can increase the Request limits or What should be the threshold for Request Limits ? OR How to do the performance fine tuning for ColdFusion server ? </strong><br /><strong></strong><br />There is no standard formula to determine the thresholds. It depends on the machine/hardware capabilities on which the ColdFusion is deployed. Powerful the hardware(processor and memory), higher could be the threshold for each of those request limits. So how do you determine it?....It could be done by a trial and error method as mentioned below.<br /><br />--> <strong>If the "Sum of (CFML+Flash+webService+CFC) Requests Running" value nearly matches the value of the "Maximum number of running JRUN threads" property, and also if the Requests Queued is large, and IF CPU USAGE IS LOW, you can increase the threshold for "CFML,Flash,webservice,CFC" and accordingly for "Maximum number of running JRUN threads".</strong><br /><br />Try this method starting with lower threshold values and keep increasing them until CPU usage is not underutilized. you would be able to determine the ideal load handling capabilities of your hardware by trying this method.<br /><br /><strong>Note:</strong> The value of the "Maximum Running Run Threads" can significantly influence the scalability of your Web applications and the performance of your server.<br /><br />So this trial and error approach to determine the threshold should be first tried on a similar configuration machine in development environment and then once you get your ideal threshold, same can be applied to ColdFusion server in production.<br /><br />Ideally, the "Requests Queued" should remain close to zero; however, they can vary under varying loads (depending on the application) while the server still provides good performance.<br /><br />If these numbers vary too much from their expected range, you might want to take Server Monitoring help to find out which portion of your code is taking too much time and accordingly might want to rewrite that portion of code to make it efficient.<br /><br />If the queue size and wait time increases, or if the queue limit is reached, browser displays the HTTP error message "500/Server Too Busy".Jayesh Viradiyahttp://www.blogger.com/profile/15200995560853101319noreply@blogger.com16tag:blogger.com,1999:blog-721341350366920435.post-42971413202573016892008-07-16T18:00:00.007+05:302008-07-17T16:58:26.152+05:30Sample Flex File Upload ApplicationRecently I came across a thing where in I had to write a flex application which needs to upload file from the Client machine to Remote Application server, So I did some googling and came up with this simple demo application which explains most aspects of File upload functionality in Flex. I have tried to provide the inline comments in the below code to explain it. Refer http://livedocs.adobe.com/flex/2/langref/flash/net/FileReference.html for more information on Methods/events of FileReference package. Also, I found some cool multifile upload custom components but those were too complex for my need.<br /><br />MXML/AS code of FileUpload:<br /><HR><br /><div class="code"><br /><?xml version="1.0" encoding="utf-8"?><br /><mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" creationComplete="init()"><br /><mx:Script><br /><![CDATA[<br />import mx.controls.Alert;<br /><br />// This is the main library package which provided APIs/Events for FileUpload<br /><br />import flash.net.FileReference;<br /><br />private var fileRef:FileReference = new FileReference();<br />private var fileTypes:Array = new Array();<br /><br />//setup the filters (types of files to be browsed)<br /><br />private var imageTypes:FileFilter = new FileFilter("Images (*.jpg; *.jpeg; *.gif; *.png)" ,"*.jpg; *.jpeg; *.gif; *.png");<br />private var documentTypes:FileFilter = new FileFilter("Documents (*.pdf), (*.doc), (*.rtf), (*.txt)",("*.pdf; *.doc; *.rtf, *.txt"));<br /><br />// Set Up URLRequest<br /><br />public var uploadURL:URLRequest = new URLRequest();<br /><br />public function init():void<br />{<br />// This URL should be replaced with your server side URL<br /><br />uploadURL.url = "http://localhost/CF/upload/upload.cfm";<br />uploadURL.method = "GET"; // OR "POST" as you need it<br />uploadURL.contentType = "multipart/form-data";<br /><br />// Event Listeners for UI Buttons (Upload/Browse)<br /><br />browsebutton.addEventListener(MouseEvent.CLICK, browseFiles);<br />uploadbutton.addEventListener(MouseEvent.CLICK,uploadFiles);<br />fileRef.addEventListener(Event.SELECT, selectHandler);<br /><br /><br />}<br /><br />//Browse for files<br /><br />private function browseFiles(event:Event):void<br />{<br />fileTypes.push(imageTypes);<br />fileTypes.push(documentTypes);<br />fileRef.browse(fileTypes);<br /><br />}<br /><br />// called after user selects a file form the browse window.<br /><br />private function selectHandler(event:Event):void<br />{<br />FilePath.text = event.currentTarget.name.toString();<br />}<br /><br />// called when user clicks on the Upload button to upload the file<br /><br />private function uploadFiles(event:Event):void<br />{<br />fileRef.addEventListener(Event.COMPLETE, completeHandler);<br />fileRef.addEventListener(DataEvent.UPLOAD_COMPLETE_DATA,dataHandler);<br />fileRef.addEventListener(SecurityErrorEvent.SECURITY_ERROR,securityErrorHandler);<br />fileRef.addEventListener(HTTPStatusEvent.HTTP_STATUS,httpStatusHandler);<br />fileRef.addEventListener(IOErrorEvent.IO_ERROR,ioErrorHandler);<br />fileRef.upload(uploadURL);<br />}<br /><br />// called after a file is uploaded<br /><br />private function completeHandler(event:Event):void<br />{<br />Alert.show("File Uploaded successfully");<br />}<br /><br />//called after file upload is done and Data has been returned from Server<br /><br />private function dataHandler(event:DataEvent):void<br />{<br />resultsTxtField.text = event.data.toString();<br />}<br /><br />// called if there is an error detected by flash player browsing or uploading a file<br /><br />private function ioErrorHandler(event:IOErrorEvent):void<br />{<br />mx.controls.Alert.show(String(event),"ioError",0);<br />}<br />// called if a security error<br /><br />private function securityErrorHandler(event:SecurityErrorEvent):void<br />{<br />mx.controls.Alert.show(String(event),"Security Error",0);<br />}<br />// server will return an http status code, code 200 means all is good<br /><br />private function httpStatusHandler(event:HTTPStatusEvent):void<br />{<br />if (event.status != 200)<br />{<br />mx.controls.Alert.show(String(event),"Error",0);<br />}<br />}<br />]]><br /></mx:Script><br /><br /><mx:Panel title="File Uploader"><br /><mx:ControlBar><br /><mx:Spacer width="100%"/><br /><mx:HBox><br /><mx:TextInput id="FilePath" width="50"/><br /><mx:Button id="browsebutton" label="Browse File" /><br /><mx:Button label="UpLoad File" name="uploadbutton" id="uploadbutton" /><br /></mx:HBox><br /><mx:TextArea id="resultsTxtField"/><br /></mx:ControlBar><br /></mx:Panel><br /><br /></mx:Application><br /><br /><br />Code for [http://localhost/CF/upload/upload.cfm] would be something as below in case of ColdFusion<br /><HR><br /><br /><cffile action="upload" destination="C:\Inetpub\wwwroot\uploadClientfilesHere\" accept="application/octet-stream" FILEFIELD="filedata" nameconflict="overwrite" ><br /><br /></div>Jayesh Viradiyahttp://www.blogger.com/profile/15200995560853101319noreply@blogger.com14