How should I derive unique file names

I am getting multiple files from the source in the same milisecond. I am current logging the file names in *yyyyMMddHHmmssSSS format. If I receive multiple files in the same milisecond it overwrite the file name with the previous file. Is there a way I can log the file name to nano second or micro second? As per the documentation, wM only keeps track up to millisecond. How can I derive the unique file name for the scenario?

Create a Java service and use java.io.File.createTempFile to create a unique filename for you.

does the requirement specifies to use just the datetime stamp with the filename …or any type of unique filename.
for one of my requirements to generate a unique file name(we needed a sequential number appended to file name) .i used oracle sequence to generate a sequential number ,everytime i process a file.see if this process can fit into ur requirements.

  • check how oracle sequence works.
    HTH
    sri

The requirement is to use date time stamp…I can suffix the Oracle seq after the time stamp…How do you get Oracle seq #? Do you have the service?

Why is having the timestamp part of the filename a “requirement?”

u have to create a sequence in oracle (google for this info) ,and then u use ur regular jdbc connection to the database ,and write a custom sql(template) to invoke sequence ,and the result u get is a number (sequential).append this number to the file name.
HTH
sri

If your are using JDK 1.5 you can use a java service for the nano seconds. System. nanoTime