Brian,
Welcome to JavaRanch!
It looks like the duplicate key exception is thrown when two callers execute the code at the same time. This could happen if you have the following sequence of events:
1) You check if record exists and it doesn't
2) Another
thread inserts a record with that key
3) You insert the record and get a duplicate key exception
Take a look at transactions to eliminate this scenario.