Page 1 of 1

insert large blob through hibernate:outofmemory problem

PostPosted: Thu Mar 17, 2011 3:51 pm
by haretu
insert large blob through hibernate.

First I use
Code: Select all
byte[] fileBArray = new byte[(int)upload.length()];
fis = new FileInputStream(upload);
         blob = Hibernate.createBlob(fis);

even though I set JVM to Xmx1024M, it still complain outofmemory :heap size space.

Then I change to

Code: Select all
setFileblob(Hibernate.createBlob(new FileInputStream(upFile[0])));

that solve the problem.