views:

266

answers:

2

Hi there .... My project is a Web project built using three technologies :

  1. Icefaces for presentation layer.

  2. Spring for business layer.

  3. Hibernate for data access layer.

My Project deployed on WebSphere 6.1 and the user can upload files, I use ice:inputFile component to handle the upload process...

The first issue is:

When the upload process finished i expect to find the uploaded file under the following path : myWebProjectRoot/upload/"sessionId"/fileName.ext

where the "sessionId" is a folder named with the current session id and the fileName.ex is the file uploaded by the user...

But what i found is : the folder "sessionId" did not created and the file is stored directly on the upload folder..

My Configuration is like the configuration of the component-showcase of icefaces library which i deployed it on my server and it create the sessionId directory successfully....

i don't know what to do.. please help me...

The second Issue is :

When the session expired I expect the sessionId folder will be deleted, i modified the code of component-showcase in the class InputFileSessionCleaner and make it delete the folder and it's children recursevly form bottm to up, but some time i face the current problem :

Some files can not be deleted using my code -may be they are used by another process-, thus the folder will not be deleted because one of it's children didn't deleted. so what to do in this case ... ?

There is an idea in my mind, which is: Is there any way to create a process running at the background in the server-side: this process check the upload directory and if it founds any file created from at least 60 minutes -which is my session time out period specified in web.xml- this process will delete this file....

any one can help me.. every help will be appriciated .....

A: 

In answwer to your second question:

WebSphere has a facility for creating worker threads and arranging for them to be initiated according to a schedule. This approach is fully supported in WebSphere - you don't violate any JEE restrictions on thread creation by using it.

Search for Aysynchronous Beans in your WebSphere documentation.

There are a couple of flavours of this capability in WebSphere one of which is a generally standardised form that you may also find in other vendors App Servers. Some description is given here: http://www.ibm.com/developerworks/library/specification/j-commonj-sdowmt/index.html

djna
A: 

Your first question has been answered here:

Stack Overflow question # 1447029

KG