Originally posted by scott irwin:
The Data::add() method checks the first column via a find() at the beginning of the method. If a row is returned, it is a duplicate key and throws an exception. What are you using this column for? It is not an integer, therefore can not be used for locking (unless you convert the signature to use String vs. row number).
The question that I have is in regard to the first column. Currently I am using the flightnumber a unique key which is ok because these are unique in the text file, but if additional flights will be added in the future how do I know that they won�t "recycle" the flightnumbers.
I use a separate class for lockning and the type of object or primitve to be locked does not matter. Please explain why locking on an int or a String would be a problem.