Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » BLOB with Lazy fetching
BLOB with Lazy fetching [message #917578] Thu, 20 September 2012 08:05 Go to next message
Zoltan Levardy is currently offline Zoltan Levardy
Messages: 4
Registered: September 2012
Junior Member
Hi,

it looks like that my recommendation as LAZY does not work with binary things.

this is my column:
    @Basic(fetch=FetchType.LAZY)
    @Lob
    @Column(name="file_content")
    private byte[] fileContent;


Eclipselink 2.0.2 simply read it into memory, what is very slow. Database is Oracle 11R2. How can I make this working - preferably less code modification?

thx
Re: BLOB with Lazy fetching [message #917675 is a reply to message #917578] Thu, 20 September 2012 10:09 Go to previous messageGo to next message
Zoltan Levardy is currently offline Zoltan Levardy
Messages: 4
Registered: September 2012
Junior Member
already tried to separate content blob into a FileContent object (table, where id_file, fileContent). Still readying huge file contents into memory.

this is new obejct:
public class FileContent extends AbstractItem implements JsonItem {

	@Id
	@Column(name = "id_file")
	private Long id;

	@Basic(fetch=FetchType.LAZY)
    @Lob
    @Column(name="content_data")
    private byte[] contentData;

...


reference for this in old place (File, where pk is ID):
	@JoinColumn(name = "id", insertable=false, updatable=false)
        @OneToOne(optional = true, cascade=CascadeType.ALL)
	private FileContent fileContent;


Hmm. any hints?
Re: BLOB with Lazy fetching [message #917772 is a reply to message #917675] Thu, 20 September 2012 12:23 Go to previous messageGo to next message
Zoltan Levardy is currently offline Zoltan Levardy
Messages: 4
Registered: September 2012
Junior Member
if forcing more Fetch Lazy, then null pointer exceptions coming:
    @JoinColumn(name = "id", insertable=false, updatable=false)
    @OneToOne(optional = true, cascade=CascadeType.ALL),[b] fetch = FetchType.LAZY)[/b]
	private FileContent fileContent;

Re: BLOB with Lazy fetching [message #918605 is a reply to message #917772] Fri, 21 September 2012 07:00 Go to previous messageGo to next message
Zoltan Levardy is currently offline Zoltan Levardy
Messages: 4
Registered: September 2012
Junior Member
no hints?
Re: BLOB with Lazy fetching [message #918973 is a reply to message #918605] Fri, 21 September 2012 14:48 Go to previous message
Russell Bateman is currently offline Russell Bateman
Messages: 3227
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

On 9/21/2012 1:00 AM, Zoltan Levardy wrote:
> no hints?

There's a separate forum for EclipseLink. You'd be better off there.
Previous Topic:Wrong colors
Next Topic:APP lock after 45 days?
Goto Forum:
  


Current Time: Sun Oct 26 06:10:37 GMT 2014

Powered by FUDForum. Page generated in 0.10856 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software