The finding is triggered by the transaction/auto-flushing problem I encountered and discussed in the reference URL.
I am using Spring 3.1.2, Hibernate 4.1.6, WebSphere 8
The symptoms is: If I use LocalContainerEntityManagerFactoryBean (Lemme call it LCEMFB) without persistence.xml, when I am performing transactional actions (e.g. flushing the entity manager (em) ), it complains for no transaction in progress (It seems to me that Hibernate is unable to lookup the transaction). However if I use the traditional way to have a persistence.xml which contains almost identical settings, it works without problem.
I can move almost all settings from persistence.xml to Spring's config, leaving only the <persistence-unit name="foo" transaction-type"="JTA"> line in persistence.xml. It works fine.
I need to have transaction-type = "JTA" in persistence.xml. Having "RESOURCE_LOCAL" is giving the same error of "no transaction in progress". (Though it works in my previous projects with Spring 2.5 + Hibernate 3 + WebLogic)
(A wild guess) It seems to be that for the xml-less LocalContainerEntityManagerFactoryBean bootstrapping method, it is making the native entity manager intialized as it is having a persistence.xml with transaction-type as "LOCAL_RESOURCES" (though we haven't declare it anywhere), which caused the problem (at least for the combination of framework/system I am using this time).
Workaround is to leave persistence.xml in my JAR. However, by doing so, "packagesToScan" become useless (I found it cannot co-exists with persistence.xml).
I've addressed this through the introduction of a "jtaDataSource" bean property on LocalContainerEntityManagerFactoryBean now, explicitly indicating JTA awareness. Simply using that one instead of "dataSource" should reliably expose transaction type JTA to the persistence provider, even without persistence.xml.