belaban/JGroups — pull request #35 by Sanne (2012-04-01 21:53:13+00:00)
Title: JGRP-1440 JDBC_PING java.sql.SQLException: ORA-00001: unique constraint ...

...violated

I have to admit I was aware of the race condition, but I think I had concluded that I would not have two threads doing discovery at the same time. I was wrong, I'm surprised but indeed freeliuade is correct I could reproduce the problem with his instructions.

So this fix is trivial and avoids the issue, but I'm wondering if actually some code higher up in the class hierarchy - maybe `FILE_PING` - should be synchronized as well?

All that logic seems to expect a single threaded discovery as well.

Tested in Hibernate Search - at least I have a database and JDBC drivers there ;-)