You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by Colin Chalmers <co...@maxware.nl> on 2001/03/15 01:53:52 UTC

slightly off-topic

Hi guys,

Apologies for this as it is a bit off topic but no doubt someone else has bound to have encountered this problem before.

I'm building an application that runs under Turbine. I use the scheduler to start a job that looks into a specific directory to check if there are files to be sent, if so I use the MultiPartMail class to send the files. Great that works!! But now I want to get rid/delete the files I've just sent otherwise the next time the job starts they'll be sent again.

My question/problem is centered around the cleaning-up bit which is why I say it's a bit off topic. I use a (lame) routine that tries to delete files based on the name in an ArrayList, if successful it's removed from the List if not it stays there for the next round. This works no problem with Kawa!

Now if I try it using Catalina:
If I have 10 files it'll (usually) send 9 and hang on the tenth locking the file. Could there be some sort of threading problem??

Does anyone know of a more efficient way of doing this or is it handy to try and extend MultiPartMail with a flag or so to delete the files after sending?

If anyone can help you'd be saving my ass, if not I'm prepared for the flak for posting off-topic !!

thanx in advance

/colin

Re: slightly off-topic

Posted by Sean Legassick <se...@informage.net>.
In message <01...@maxware.nl>, Colin Chalmers 
<co...@maxware.nl> writes
>My question/problem is centered around the cleaning-up bit which is why I
>say it's a bit off topic. I use a (lame) routine that tries to delete files based
>on the name in an ArrayList, if successful it's removed from the List if not
>it stays there for the next round. This works no problem with Kawa!

So how is this routine running - do you just have a worker thread 
polling the directory?

>Now if I try it using Catalina:
>If I have 10 files it'll (usually) send 9 and hang on the tenth locking the file.
>Could there be some sort of threading problem??

So it hangs trying to _send_ the file - is your cleanup thread trying to 
delete the file at the same time? Or is it hanging trying to delete the 
10th file?

>Does anyone know of a more efficient way of doing this or is it handy to try
>and extend MultiPartMail with a flag or so to delete the files after sending?

This sounds like a reasonable addition if you can implement it 
cleanly...

-- 
Sean Legassick
sean@informage.net
         Jeg er mann: Ingenting menneskelig er fremmed for meg

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org