-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Remove a entity with blob field
PostPosted: Sun May 11, 2008 10:11 am 
Newbie

Joined: Fri Nov 16, 2007 9:27 pm
Posts: 5
First of all Hi to all!

I try to use hibernate annotation, postgres DB, and jboss to create a entity with a field of byte[]
like this:

Code:
@Entity
public class Allegato implements Serializable {

   private static final long serialVersionUID = 1L;

   @Id
   @GeneratedValue(strategy = GenerationType.IDENTITY)
   private Long id;

   @Column(length = 255, nullable = false)
   private String filename;

   @Column(nullable = false)
   private int filesize;

   @Lob
   @Column(nullable = false, length = 10485760)
   @Basic(fetch = FetchType.LAZY)
   private byte[] data;

   @Column(length = 255)
   private String contentType;

        ... 
        ... many get and set method ...
        ...
}


When i create a entity like that type and persist the object it all work. Good!

But if found try to remove that object from db I saw that only the row in the "Allegato" table is delete, while if i watch in the table pg_largeobject of postgres db the row about my byte[] field entity persist!

It seem that only the refer about the entity to be canceled, while the real byte data remain in to the db

Can somebody help me about this?

_________________
Stefano Zaccaria


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 12, 2008 2:38 am 
Newbie

Joined: Fri Nov 16, 2007 9:27 pm
Posts: 5
Have some idea?

_________________
Stefano Zaccaria


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.