[CDBI] Uniqueness of Objects in memory

[prev] [thread] [next] [Date index for 2005/08/16]

From: Brian Phillips
Subject: [CDBI] Uniqueness of Objects in memory
Date: 18:03 on 16 Aug 2005
--===============0666117943==
Content-Type: multipart/alternative; 
	boundary="----=_Part_1316_30030190.1124215418828"

------=_Part_1316_30030190.1124215418828
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

This seems to be a bug:

my $obj1 =3D CDBI::Table->create({name=3D>"bobo",coolness=3D>"is cool"});
my $obj2 =3D CDBI::Table->retrieve($obj1->id);

# prints "[is cool] eq [is cool]"
printf('[%s] eq [%s]', $obj1->coolness, $obj2->coolness);=20

$obj1->coolness("is not cool");
$obj2->coolness("is really cool");

# prints "[is not cool] eq [is really cool]"
printf('[%s] eq [%s]', $obj1->coolness, $obj2->coolness);

It appears that _init is the only place where an object is added to the=20
%Live_Objects hash and this sub isn't ever called during the course of=20
creating a new object. Am I misunderstanding how this feature is supposed t=
o=20
work? The docs seem pretty clear that the above should work...

Thanks,
Brian

------=_Part_1316_30030190.1124215418828
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

<span class=3D"gmail_quote"></span>This seems to be a bug:<br>
<br>
my $obj1 =3D CDBI::Table-&gt;create({name=3D&gt;&quot;bobo&quot;,coolness=
=3D&gt;&quot;is cool&quot;});<br>
my $obj2 =3D CDBI::Table-&gt;retrieve($obj1-&gt;id);<br>
<br>
# prints &quot;[is cool] eq [is cool]&quot;<br>
printf('[%s] eq [%s]', $obj1-&gt;coolness, $obj2-&gt;coolness); <br>
<br>
$obj1-&gt;coolness(&quot;is not cool&quot;);<br>
$obj2-&gt;coolness(&quot;is really cool&quot;);<br>
<br>
# prints &quot;[is not cool] eq [is really cool]&quot;<br>
printf('[%s] eq [%s]', $obj1-&gt;coolness, $obj2-&gt;coolness);<br>
<br>
It appears that _init is the only place where an object is added to the
%Live_Objects hash and this sub isn't ever called during the course of
creating a new object.&nbsp; Am I misunderstanding how this feature is
supposed to work?&nbsp; The docs seem pretty clear that the above
should work...<br>
<br>
Thanks,<br><span class=3D"sg">
Brian<br>

</span>

------=_Part_1316_30030190.1124215418828--


--===============0666117943==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
ClassDBI mailing list
ClassDBI@xxxxx.xxxxxxxxxxxxxxxx.xxx
http://lists.digitalcraftsmen.net/mailman/listinfo/classdbi

--===============0666117943==--

[CDBI] Uniqueness of Objects in memory
Brian Phillips 18:03 on 16 Aug 2005

Generated at 00:10 on 01 Sep 2005 by mariachi v0.52