This week's giveaway is in the EJB and other Java EE Technologies forum. We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line! See this thread for details.
I am trying to build a program to write to a file, i initialized the filename in a static piece of code so that if multiple threads are even writing into the file, the file is initialized only once. I don't want to close the file until the whole writing is finsihed, how and when can i close the file.