It took me a while to find out how to reproduce the problem. It happens when identity of the entity to be created is generated by the database (e.g. by a sequence). In this case the identity is null and we can not do the duplicate identity check with SQLStatementLookup.
Final patch fixes this and includes a test case to verify that things work at oracle.
Problem doesn't happen with MySQL using no key generator. Maybe it only happens with Oracle using sequence only where I originally discovered it.