-->
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.  [ 1 post ] 
Author Message
 Post subject: How to prevent to save same BLOB data from diffrent users
PostPosted: Fri Jan 01, 2010 11:30 pm 
Newbie

Joined: Tue Jan 24, 2006 12:11 pm
Posts: 7
Hi,

We have entity class contain BLOB like:
@Entity
@Table(name = "RawGpsData")
public class RawGpsData implements Serializable
{
private Long id;
private String vehNo;
private Date dateTime;
@Lob
private String data;
}

We don't want to have duplicate data in the database.


I am to try to define data field as unique, but unique attribute seem not work for Lob:
@Lob @Column(name = "data",columnDefinition = "MEDIUMTEXT", unique = true)
public String getData() {
return data;
}
public void setData(String data) {
this.data = data;
}

Duplicated happened from two user try to save same data at the same. I try to find this data before save it, but it does not work.

Anyone know its solution?


Thanks


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

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.