I have a class that opens a database file, reads the records by batch# then closes the file.
I am trying to read a list of batch# and run a seperate
thread for each batch#.
public static synchronized
String createBatchFile(String batchNumber) {
String fileName = downLoadFile;
PriceBatchCreator batchCreator = new PriceBatchCreator(batchNumber);
Thread runner = new Thread(batchCreator);
runner.start();
}
When more then one Thread is running at the same time I get an error that the file is closed when I try to read the file with the second Thread after the first Thread has closed the file.