Re: uploaded files in page instance

2009-11-03 Thread fachhoch

Is there any open source utility to write and manage files to temp folder ,
handle deletion , signle thread   access etc   ?


Newgro wrote:
> 
> Igor Vaynberg schrieb:
>> you guys ever hear of transactional isolation? :) databases handle all
>> this kind of neat stuff for you.
>>
>> -igor
>>
>>   
> Oh, i didn't saw that he tried it in one transaction. I thought it are 
> multiple stateless steps.
> Sorry
> Per
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/uploaded-files-in-page-instance-tp25962716p26160637.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: uploaded files in page instance

2009-10-19 Thread Per Newgro

Igor Vaynberg schrieb:

you guys ever hear of transactional isolation? :) databases handle all
this kind of neat stuff for you.

-igor

  
Oh, i didn't saw that he tried it in one transaction. I thought it are 
multiple stateless steps.

Sorry
Per

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: uploaded files in page instance

2009-10-19 Thread Igor Vaynberg
you guys ever hear of transactional isolation? :) databases handle all
this kind of neat stuff for you.

-igor

On Mon, Oct 19, 2009 at 11:09 PM, Per Newgro  wrote:
> fachhoch schrieb:
>>
>> Why are you saving the byte arrays in the page instance?
>>
>> I show these files to  user with read-only permission  , so this user can
>> just view these files ,the owner of these files can delete them anytime ,
>> so
>> If I go to database     , upon user click , this file might have been
>> deleted by the user , or when user tries to access this file the   owner
>> might be deleting this file , to avoid such issues I am loading all the
>> bytes to page instance , so no  concurrent access issues .
>> to save them inside temp folders can I ask the page to give some
>> identifier
>> which I can use  to name the folder which contains all the files ?  or do
>> I
>> have to create my own identifier  ?
>>
>>
>
> With this issues i would rethink my design. Why don't you mark the file as
> "inUse" in DB and if it is in use
> deny delete? So user can only delete file if noone has a copy in use. And as
> Igor posted you can't guarantee
> that your processing never leads to your problem described above.
>
> Page identifier:
> You could use the page.id + sessionId
>
> Cheers
> Per
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: uploaded files in page instance

2009-10-19 Thread Per Newgro

fachhoch schrieb:

Why are you saving the byte arrays in the page instance?

I show these files to  user with read-only permission  , so this user can
just view these files ,the owner of these files can delete them anytime , so
If I go to database , upon user click , this file might have been
deleted by the user , or when user tries to access this file the   owner
might be deleting this file , to avoid such issues I am loading all the
bytes to page instance , so no  concurrent access issues .
to save them inside temp folders can I ask the page to give some identifier
which I can use  to name the folder which contains all the files ?  or do I
have to create my own identifier  ?

  
With this issues i would rethink my design. Why don't you mark the file 
as "inUse" in DB and if it is in use
deny delete? So user can only delete file if noone has a copy in use. 
And as Igor posted you can't guarantee

that your processing never leads to your problem described above.

Page identifier:
You could use the page.id + sessionId

Cheers
Per

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: uploaded files in page instance

2009-10-19 Thread Igor Vaynberg
what happens if the owner is deleting the file while you are copying
it to the temp dir???

-igor

On Mon, Oct 19, 2009 at 12:54 PM, fachhoch  wrote:
>
>
> Why are you saving the byte arrays in the page instance?
>
> I show these files to  user with read-only permission  , so this user can
> just view these files ,the owner of these files can delete them anytime , so
> If I go to database     , upon user click , this file might have been
> deleted by the user , or when user tries to access this file the   owner
> might be deleting this file , to avoid such issues I am loading all the
> bytes to page instance , so no  concurrent access issues .
> to save them inside temp folders can I ask the page to give some identifier
> which I can use  to name the folder which contains all the files ?  or do I
> have to create my own identifier  ?
>
>
> jthomerson wrote:
>>
>> Why are you loading the files from the DB before the user asks for them
>> (clicks the download link)?
>>
>> Why are you saving the byte arrays in the page instance?  If you really
>> must
>> load them from the DB before the user clicks the download link, save them
>> to
>> a temp file and save only the path of the file in the page (like Igor
>> originally said).
>>
>> --
>> Jeremy Thomerson
>> http://www.wickettraining.com
>>
>>
>>
>> On Mon, Oct 19, 2009 at 2:40 PM, fachhoch  wrote:
>>
>>>
>>> I have several pages which has links to  uploaded files to download,  I
>>> load
>>> this from database and save it inside page instance as instance variable
>>> .
>>> When user clicks on the download link I retrieve the byte array from the
>>> page instance and   call download.  Several user have  different
>>> instances
>>> of same pages and all these pages have these huge files byte[]  .
>>> Sure this will cause Outof memory issues.
>>> To resolve this  I have to  use temp folder ,
>>> every time a page instance gets  created I have to   create temp folder
>>> to
>>> save these uploaded files bytes  with a proper name so that I can know
>>> this
>>> folder is for this  user and this page and this instance.   I am asking
>>> do
>>> I
>>> have to create a naming factory which names the folder  for every page
>>> instance ?  or is there anything available which  I can use a as  a
>>> folder
>>> name?
>>>
>>>
>>>
>>> fachhoch wrote:
>>> >
>>> > I show these files in almost all my pages.So every page  before it
>>> loads
>>> > has to create all these files in temp folder , please suggest me what
>>> > should be the identifier   to recognize these files ,I actually have
>>> these
>>> > files inside PancelCachingTab  , and this tab gets loaded only when
>>> user
>>> > clicks on on it for the first time.
>>> >
>>> >
>>> >
>>> > igor.vaynberg wrote:
>>> >>
>>> >> store them in a temp directory and only give your page the filename.
>>> >>
>>> >> -igor
>>> >>
>>> >> On Mon, Oct 19, 2009 at 10:55 AM, tubin gen 
>>> wrote:
>>> >>> I have   some huge files   upto 50Mb in side my page instance , I
>>> have
>>> >>> to
>>> >>> save them in  page instance and I cannot reload it everytime from
>>> >>> database
>>> >>> becasue other users might delete the file .
>>> >>>
>>> >>> I am getting   java.lang.OutOfMemoryError  , only way I can resolve
>>> this
>>> >>> is
>>> >>> increasing heap size but Is this a bad idea storing files upto 50Mb
>>> >>> inside
>>> >>> page instance ?
>>> >>>
>>> >>
>>> >> -
>>> >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>> >> For additional commands, e-mail: users-h...@wicket.apache.org
>>> >>
>>> >>
>>> >>
>>> >
>>> >
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/uploaded-files-in-page-instance-tp25962716p25964309.html
>>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>>
>>>
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>
>>>
>>
>>
>
> --
> View this message in context: 
> http://www.nabble.com/uploaded-files-in-page-instance-tp25962716p25964541.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: uploaded files in page instance

2009-10-19 Thread fachhoch


Why are you saving the byte arrays in the page instance?

I show these files to  user with read-only permission  , so this user can
just view these files ,the owner of these files can delete them anytime , so
If I go to database , upon user click , this file might have been
deleted by the user , or when user tries to access this file the   owner
might be deleting this file , to avoid such issues I am loading all the
bytes to page instance , so no  concurrent access issues .
to save them inside temp folders can I ask the page to give some identifier
which I can use  to name the folder which contains all the files ?  or do I
have to create my own identifier  ?


jthomerson wrote:
> 
> Why are you loading the files from the DB before the user asks for them
> (clicks the download link)?
> 
> Why are you saving the byte arrays in the page instance?  If you really
> must
> load them from the DB before the user clicks the download link, save them
> to
> a temp file and save only the path of the file in the page (like Igor
> originally said).
> 
> --
> Jeremy Thomerson
> http://www.wickettraining.com
> 
> 
> 
> On Mon, Oct 19, 2009 at 2:40 PM, fachhoch  wrote:
> 
>>
>> I have several pages which has links to  uploaded files to download,  I
>> load
>> this from database and save it inside page instance as instance variable
>> .
>> When user clicks on the download link I retrieve the byte array from the
>> page instance and   call download.  Several user have  different
>> instances
>> of same pages and all these pages have these huge files byte[]  .
>> Sure this will cause Outof memory issues.
>> To resolve this  I have to  use temp folder ,
>> every time a page instance gets  created I have to   create temp folder
>> to
>> save these uploaded files bytes  with a proper name so that I can know
>> this
>> folder is for this  user and this page and this instance.   I am asking
>> do
>> I
>> have to create a naming factory which names the folder  for every page
>> instance ?  or is there anything available which  I can use a as  a
>> folder
>> name?
>>
>>
>>
>> fachhoch wrote:
>> >
>> > I show these files in almost all my pages.So every page  before it
>> loads
>> > has to create all these files in temp folder , please suggest me what
>> > should be the identifier   to recognize these files ,I actually have
>> these
>> > files inside PancelCachingTab  , and this tab gets loaded only when
>> user
>> > clicks on on it for the first time.
>> >
>> >
>> >
>> > igor.vaynberg wrote:
>> >>
>> >> store them in a temp directory and only give your page the filename.
>> >>
>> >> -igor
>> >>
>> >> On Mon, Oct 19, 2009 at 10:55 AM, tubin gen 
>> wrote:
>> >>> I have   some huge files   upto 50Mb in side my page instance , I
>> have
>> >>> to
>> >>> save them in  page instance and I cannot reload it everytime from
>> >>> database
>> >>> becasue other users might delete the file .
>> >>>
>> >>> I am getting   java.lang.OutOfMemoryError  , only way I can resolve
>> this
>> >>> is
>> >>> increasing heap size but Is this a bad idea storing files upto 50Mb
>> >>> inside
>> >>> page instance ?
>> >>>
>> >>
>> >> -
>> >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> >> For additional commands, e-mail: users-h...@wicket.apache.org
>> >>
>> >>
>> >>
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/uploaded-files-in-page-instance-tp25962716p25964309.html
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
> 
> 

-- 
View this message in context: 
http://www.nabble.com/uploaded-files-in-page-instance-tp25962716p25964541.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: uploaded files in page instance

2009-10-19 Thread Jeremy Thomerson
Why are you loading the files from the DB before the user asks for them
(clicks the download link)?

Why are you saving the byte arrays in the page instance?  If you really must
load them from the DB before the user clicks the download link, save them to
a temp file and save only the path of the file in the page (like Igor
originally said).

--
Jeremy Thomerson
http://www.wickettraining.com



On Mon, Oct 19, 2009 at 2:40 PM, fachhoch  wrote:

>
> I have several pages which has links to  uploaded files to download,  I
> load
> this from database and save it inside page instance as instance variable .
> When user clicks on the download link I retrieve the byte array from the
> page instance and   call download.  Several user have  different instances
> of same pages and all these pages have these huge files byte[]  .
> Sure this will cause Outof memory issues.
> To resolve this  I have to  use temp folder ,
> every time a page instance gets  created I have to   create temp folder
> to
> save these uploaded files bytes  with a proper name so that I can know this
> folder is for this  user and this page and this instance.   I am asking do
> I
> have to create a naming factory which names the folder  for every page
> instance ?  or is there anything available which  I can use a as  a folder
> name?
>
>
>
> fachhoch wrote:
> >
> > I show these files in almost all my pages.So every page  before it loads
> > has to create all these files in temp folder , please suggest me what
> > should be the identifier   to recognize these files ,I actually have
> these
> > files inside PancelCachingTab  , and this tab gets loaded only when user
> > clicks on on it for the first time.
> >
> >
> >
> > igor.vaynberg wrote:
> >>
> >> store them in a temp directory and only give your page the filename.
> >>
> >> -igor
> >>
> >> On Mon, Oct 19, 2009 at 10:55 AM, tubin gen  wrote:
> >>> I have   some huge files   upto 50Mb in side my page instance , I have
> >>> to
> >>> save them in  page instance and I cannot reload it everytime from
> >>> database
> >>> becasue other users might delete the file .
> >>>
> >>> I am getting   java.lang.OutOfMemoryError  , only way I can resolve
> this
> >>> is
> >>> increasing heap size but Is this a bad idea storing files upto 50Mb
> >>> inside
> >>> page instance ?
> >>>
> >>
> >> -
> >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> >> For additional commands, e-mail: users-h...@wicket.apache.org
> >>
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/uploaded-files-in-page-instance-tp25962716p25964309.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: uploaded files in page instance

2009-10-19 Thread fachhoch

I have several pages which has links to  uploaded files to download,  I load
this from database and save it inside page instance as instance variable .
When user clicks on the download link I retrieve the byte array from the
page instance and   call download.  Several user have  different instances
of same pages and all these pages have these huge files byte[]  .
Sure this will cause Outof memory issues.
To resolve this  I have to  use temp folder , 
every time a page instance gets  created I have to   create temp folder   to
save these uploaded files bytes  with a proper name so that I can know this
folder is for this  user and this page and this instance.   I am asking do I
have to create a naming factory which names the folder  for every page
instance ?  or is there anything available which  I can use a as  a folder
name?



fachhoch wrote:
> 
> I show these files in almost all my pages.So every page  before it loads
> has to create all these files in temp folder , please suggest me what
> should be the identifier   to recognize these files ,I actually have these
> files inside PancelCachingTab  , and this tab gets loaded only when user
> clicks on on it for the first time.
> 
> 
> 
> igor.vaynberg wrote:
>> 
>> store them in a temp directory and only give your page the filename.
>> 
>> -igor
>> 
>> On Mon, Oct 19, 2009 at 10:55 AM, tubin gen  wrote:
>>> I have   some huge files   upto 50Mb in side my page instance , I have
>>> to
>>> save them in  page instance and I cannot reload it everytime from
>>> database
>>> becasue other users might delete the file .
>>>
>>> I am getting   java.lang.OutOfMemoryError  , only way I can resolve this
>>> is
>>> increasing heap size but Is this a bad idea storing files upto 50Mb  
>>> inside
>>> page instance ?
>>>
>> 
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>> 
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/uploaded-files-in-page-instance-tp25962716p25964309.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: uploaded files in page instance

2009-10-19 Thread fachhoch

I show these files in almost all my pages.So every page  before it loads has
to create all these files in temp folder , please suggest me what should be
the identifier   to recognize these files ,I actually have these files
inside PancelCachingTab  , and this tab gets loaded only when user clicks on
on it for the first time.



igor.vaynberg wrote:
> 
> store them in a temp directory and only give your page the filename.
> 
> -igor
> 
> On Mon, Oct 19, 2009 at 10:55 AM, tubin gen  wrote:
>> I have   some huge files   upto 50Mb in side my page instance , I have to
>> save them in  page instance and I cannot reload it everytime from
>> database
>> becasue other users might delete the file .
>>
>> I am getting   java.lang.OutOfMemoryError  , only way I can resolve this
>> is
>> increasing heap size but Is this a bad idea storing files upto 50Mb  
>> inside
>> page instance ?
>>
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/uploaded-files-in-page-instance-tp25962716p25963009.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: uploaded files in page instance

2009-10-19 Thread Igor Vaynberg
store them in a temp directory and only give your page the filename.

-igor

On Mon, Oct 19, 2009 at 10:55 AM, tubin gen  wrote:
> I have   some huge files   upto 50Mb in side my page instance , I have to
> save them in  page instance and I cannot reload it everytime from database
> becasue other users might delete the file .
>
> I am getting   java.lang.OutOfMemoryError  , only way I can resolve this is
> increasing heap size but Is this a bad idea storing files upto 50Mb   inside
> page instance ?
>

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



uploaded files in page instance

2009-10-19 Thread tubin gen
I have   some huge files   upto 50Mb in side my page instance , I have to
save them in  page instance and I cannot reload it everytime from database
becasue other users might delete the file .

I am getting   java.lang.OutOfMemoryError  , only way I can resolve this is
increasing heap size but Is this a bad idea storing files upto 50Mb   inside
page instance ?