First, my source of confusion is why would you insert duplicate data
into your database. You may need to check your object in the UI, if
applicable, and then insert it into database.
Anyway, I wouldn't go for Hashing. The point is that you will have to
check your database quite a few times to find the right id. The world
would be a better place if we could define a hash function that maps
our objects to unique ids.
You could alternatively rely on your database auto numbering, but you
will need to put it in a stored procedure to check whether not the
record is already in database. Your database is indexed and a String
search is fast anyway. On top of that, putting this logic in the
database will give you scalability at a minor cost. You always have
the option to add another machine to the cluster if the performance
sucks.