How many PO numbers do you need to keep track of and for how long? What happens if IS goes down for a brief time?
I think you need to get away from trying to store the PO numbers in memory. Using pub.storage services isn't advisable either as that facility isn't intended for data such as this.
What are the issues/concerns with storing the numbers in a DB table?
My understanding is that it's not the same file. It is a new file but contains a PO number that has been seen and processed before. The source system is spitting out duplicates.
..its not the same fileName..its content repeats the same PONumber that was just processed in the previous attempt resulting in duplicate processing error
You can use HashMap/Hashtable, but this is not recommended in production, since its not shared among clustered IS and that too, if IS went down and after IS restart you can't retrieve back values from HashMap/Hashtable. What Rob suggested is the best, instead using DB, in other way you can do is store the PONumbers in a file, refer this file before processing the request, instead using DB.
You can go for a file storage if you are sure that duplicates are always from just the previous file if not then better to take Rob's suggestion to go for a db table.
please be advise that if you are saving this information in memory (using any HASH table or datastore) it will be gone on server restart, so you ur vital information will be lost.
Saving in DB looks a good option to me as well..
If you are using a file port, one of the configuration parameters is the number of invocation threads.
If you set 1 thread, the same file won't be processed twice.
Or are you getting the file again after a period of time?
To clarify for those coming upon this thread in the future...
When properly using a file polling port there is not a risk of a single file being processed multiple times even when "Maximum Number of Invocation Threads" is greater than 1. The file management facilities of the polling port are such that this will not happen.
1)
create a file in the file system and keep appending the file with new PO number...
on every run match the new Po number with the PO numbers stored in the temp file...
for successful Match Do nothing or throw error.
else keep processing ...
2)
if the duplicate PO is coming in the very next file ...
then use pub.storage service ... but use it carefully in clustered environment else you will see lock issues on the storage ... and you will not be able to release the lock then ....