4 Replies Latest reply on Feb 28, 2013 12:15 PM by Adam Cameron.

    Weird transaction issue with implicit struct (and possible array)

    Jeremy Tan Level 1

      I have the following 2 files.


      <cfcomponent  output="false">


                <cffunction name="set" output="true" returntype="void">

                          <cfargument name="text1" type="string" required="true">

                          <cfargument name="something" type="any" required="true">

                          <cfdump var="#arguments#">







                test = {firstName="Bob in line 2"};


                transaction {

           new mycfc().set(Text1:"hello",something:"Bob in text");


           new mycfc().set(Text1:"hello",something:"Bob in text again");

           new mycfc().set(Text1:"hello",something:test);

           new mycfc().set(Text1:"hello",something:{firstName="Bob in line 9"});

           test2 = {firstName="Merry"};

           writeDump(var=test2,label="line 11" );

           new mycfc().set(Text1:"hello",something:{firstName="Jenny"});


           new mycfc().set(Text1:"hello",something:{firstName="Jenny 2"});


                writeDump("i = #i#");




      If you run the mycfc.cfm, you will notice 4 weird things here.

      1) new mycfc().set(Text1:"hello",something:test); should output "Bob in line 2", but is replace with "Bob in line 9"

      2) my dump with label="line 11" is missing.

      3) duplication of "Jenny 2", even you remove the writedump, you still get double "Jenny 2".

      4) writeDump("i = #i#"); will give you "i = 2", which should be i = 3


      This problem only happen when using transaction. It is happen to both CF9 and CF10