-->
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: PostgreSQL updating oid content by chunks.
PostPosted: Mon Nov 22, 2010 4:01 am 
Newbie

Joined: Mon Nov 22, 2010 3:41 am
Posts: 3
Hello,
I have the Web Service method which uploads 100 Mb movie file by 10K chunks.
Code:
public void addFileChunk(Long fileId, byte[] buffer);

I need to store this file in database,

If I were not using Hibernate, I would use the following code which appends each chunk to the end of the LargeObject.
Code:
LargeObject largeObject = largeObjectManager.Open(fileId, LargeObjectManager.READWRITE);
                    int size = largeObject.Size();
                    largeObject.Seek(size);
                    largeObject.Write(buffer);
                    largeObject.Close();

I'm curious how can I achieve the same functionality using Hibernate persistence objects?
What might be correct methodology to store files by chunk in database?


Top
 Profile  
 
 Post subject: Re: PostgreSQL updating oid content by chunks.
PostPosted: Tue Nov 23, 2010 9:54 am 
Newbie

Joined: Mon Nov 22, 2010 3:41 am
Posts: 3
Hi,

does anybody have any clue?

Danny.


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.