db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From skka...@engr.uky.edu
Subject Bug in copy() for blob field?
Date Wed, 21 Apr 2004 02:22:52 GMT
Hi,

  I have a table called Image with a field called data which is of type Blob. I 
noticed that the copy() of the Image object has something like (actually code 
below is that of copyInto() which is called by copy() )

{
          copyObj.setImageId(imageId);
          copyObj.setReferenceId(referenceId);
          copyObj.setData(data);

          copyObj.setImageId(0);


        return copyObj;
}

and setData() is like -

    public void setData(byte[] v)
    {

           if (!ObjectUtils.equals(this.data, v))
           {
            this.data = v;
            setModified(true);
           }


    }

Isn't this wrong? Coz if I do

Image X = Y.copy();

and then change the value of Y.data then the value of the X.data will also 
change! Since X.data and Y.data refer to the same byte[].

~Sarav

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Mime
View raw message