[ic] Sessions no longer preserve "sameness" of references

Andrew Shelansky andrew at lunsfordgroup.com
Fri Sep 10 21:37:25 EDT 2004


For the past couple years I ran Interchange 4.8.x on Red Hat 7.0/7.2.

We recently upgraded to Interchange 5.0.x, and I encountered an
interesting problem.

I have an object in the session, for example:
$Scratch->{my_object} = { 
                            name => "myName",
                            height => "5 foot 7",
                            weight => "150 lbs"
                         };

I have another object in the session, for example:
$Scratch->{my_other_object} = {
                      name => "myOtherName",
                      spiffy_ref => \($Session->{my_object}{height})
                              };

At the moment $Scratch->{my_other_object}{spiffy_ref} is a reference to
the string "5 foot 7" stored in $Scratch->{my_object}

Suppose that these two lines are in an action.

The action executes, and then the user sees a page.  When the user
submits the page, I find that:

$Scratch->{my_other_object}{spiffy_ref} is a reference to a string
containing "5 foot 7", but that it is not the same copy of the string
stored in $Scratch->{my_object}{height}.

That is, if I execute the following lines:

$Scratch->{my_object}{height} = "5 foot 2";
&Log($Scratch->{my_object}{height});
my $ref = $Scratch->{my_other_object}{spiffy_ref};
&Log($$ref);

The log will contain:

"5 foot 2"
"5 foot 7"

In Interchange 4.8.x the session management was really cool and
preserved the "sameness" of the references... by that I mean that in
4.8.x, the log would contain, in this example:

"5 foot 2"
"5 foot 2"

Since I have a significant application piece built somewhat heavily
around this cool feature of 4.8.x, I was exceptionally disappointed when
I discovered this change.

Was this feature in 4.8.x known and deliberate?  Was its removal
deliberate?  Is this because Storable changed?  Has the way Interchange
uses Storable changed? Is there any conceivable way to make this work?

While I'm asking questions:  is there a name for this "sameness"
relationship I'm describing that I should use?

I would very much like to avoid the months of re-development required if
I can't convince (or coerce) Interchange into preserving this
relationship, so any help at all would be very greatly appreciated.

Thanks for your help,

Andrew Shelansky 






More information about the interchange-users mailing list