When using a sequence generator, sometimes auto-flushing does not work and ends up in TransientObjectException. I managed to create a sample case: https://github.com/attendium/hibernate-sequence-id-flush-bug