It is allowed to delete an object which is created but not committed.
The error you get is probably due to the fact that you are retrieving and editing the same type of objects from two different transactions. This can lead to a deadlock in the database.