Flush-before-completion must be enabled. (It is actually a bug that it is not enabled by default in HEM.)
You DO NOT have to call merge.
Use a persistence.xml something like this:
<entity-manager> <name>entityManager</name> <provider>org.hibernate.ejb.HibernatePersistence</provider> <jta-data-source>java:/DefaultDS</jta-data-source> <properties> <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/> <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup"/> <property name="hibernate.transaction.flush_before_completion" value="true"/> <property name="hibernate.hbm2ddl.auto" value="create-drop"/> <property name="hibernate.show_sql" value="true"/> </properties> </entity-manager>
Ah, I'm not insane! Thanks for the quick response. I didn't think merge was necessary either. I'll try this right away.
Ooops, I forgot:
There is more you need to do. There is actually a bug in the currently released version of HEM that causes it to not get enlisted in the JTA txn in some circumstances.
Emmanuel is waiting for Steve to release HB 3.1 before he can release the next version of HEM/HA. That will happen sometime this week (Monday/Tuesday).
In the meantime, you can build HB/HEM/HA from current CVS.
You then need to upgrade JBoss 4.0.3 to use these fixed versions of HB/HEM/HA.
(By the way, after you do all this stuff, it really *does* work, I promise.)