So, there are a few things you should understand about sequence.
- It's not transactional, so yes, once the transaction retrieves the value, rolling back does not restore it.
- The values for the sequence are allocated in batches, so say you have your cache size set to 10, grab one value, then restart the server, there will be a gap of 10.
As for how to get a perfect sequence, well, likely the only way you could do that is by getting the max value from the table in a serializable transaction. Now the question you should ask yourself is "do they really need to be sequential?".