What you are trying is bean managed transaction where the transaction commit, rollback etc... is managed by your code. You don't have to do that (although it's an option). You can use Container Managed Transactions with EJBs and leave the transaction management to the container.
Jorge Bendahan wrote:But in the end, the transaction is not working, i mean, the insert works, but it's not an atomic transaction.
Sorry, i did not understand that. Can you please explain?