Hi there,

We have a database in which we store pictures. When we delete pictures from 
the database, the file does not become smaller. So apparently, the pictures 
are not really removed from the file.

    public class MachineImageMap : ModelBaseMap<MachineImage>
    {
        public MachineImageMap()
        {
            this.Map(x => x.OrderIndex);
            this.References(x => x.Image).Cascade.All();
        }
    }

    public class ImageResourceMap : ModelBaseMap<ImageResource>
    {
        public ImageResourceMap()
        {
            this.Map(x => x.Description);
            this.Map(x => x.ImageData);
            this.Map(x => x.Name);
            this.Map(x => x.Height);
        }
    }

The SQL log file shows that the image is deleted from both tables, 
MachineImage and ImageResource, but apparently it is not physically removed.

On the Internet I read that we should perhaps use Cascade.AllDeleteOrphan. 
However, NHibernate 3.3.1.4000 does not support that. Do we have to switch 
to a newer version of NHibernate or is there another way to fix it?

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/nhusers.
For more options, visit https://groups.google.com/d/optout.

Reply via email to