Further investigation reveals that where I am calling openSession(), and therefore not taking part in a JTA transation) but a JTA transaction exists calls to tx.commit and session.close are being ignored as if I am in a transaction.
Is this a bug, or am I missing something?
I am having the same issue did you ever find a solution to this problem?
In short yes, what we had to do is remove any transaction demarcation code, and any calls to session.close(), in dao methods that were called inside a container transaction. Persistence was then correctly managed by the container.
The only exception to this where you get hold of the underlying connection by calling session.connection() in this case you must close the connection.
Be careful to also remove the catching of HibernateExeption as Hibernate 3 has made this exception unchecked and rely on this to orchestrate a rollback, (it's a standard feature of J2EE containers that unchecked exceptions cause any current transaction to be rolled back).
The documention for this makes it sound like all of this is optional, it is not. It should be in big red lights in the documentation and the migration guide.