大きなblobファイルでエンティティを永続化しようとしていますが、JBossログに「メモリ不足」エラーが発生しました。
いくつかの構成でテストしましたが、常に同じ結果が得られます。jBoss6とMySQLを使用しています。
この例...エンティティ:
@Entity
@Table(name="ficheros")
public class Fichero implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
@Column(unique=true, nullable=false)
private int idfichero;
@Lob()
@Column(nullable=false)
private Blob fichero;
public Fichero() {
}
public int getIdfichero() {
return this.idfichero;
}
public void setIdfichero(int idfichero) {
this.idfichero = idfichero;
}
public Blob getFichero() {
return this.fichero;
}
public void setFichero(Blob fichero) {
this.fichero = fichero;
}
}
クラス:
public Integer insertaFichero(Fichero fich) {
ficheroDAO.create(fich);
return fich.getIdfichero();
}
それを行う別の方法はありますか?