I am wrong on what I have told:
Only certain combinations of properties in jpaPropertyMap give me "no-auto-flushing" behavior. Other combination simply tell me there is no transaction in progress when I flush.
Here is the combinations I have tried in jpaPropertyMap:
Code:
hibernate.transaction.manager_lookup_class org.hibernate.transaction.WebSphereExtendedJTATransactionLookup
no transaction is in progress
Code:
hibernate.transaction.manager_lookup_class org.hibernate.transaction.WebSphereExtendedJTATransactionLookup
hibernate.transaction.factory_class org.hibernate.transaction.CMTTransactionFactory
transaction active, manual flush works, auto-flush not working
Code:
hibernate.transaction.manager_lookup_class org.hibernate.transaction.WebSphereExtendedJTATransactionLookup
hibernate.transaction.factory_class org.hibernate.engine.transaction.internal.jta.CMTTransactionFactory
transaction active, manual flush works, auto-flush not working
Code:
hibernate.transaction.manager_lookup_class org.hibernate.transaction.WebSphereExtendedJTATransactionLookup
hibernate.transaction.factory_class org.hibernate.transaction.JTATransactionFactory
no transaction is in progress
Code:
hibernate.transaction.manager_lookup_class org.hibernate.transaction.WebSphereExtendedJTATransactionLookup
hibernate.transaction.factory_class org.hibernate.engine.transaction.internal.jta.JtaTransactionFactory
no transaction is in progress
Code:
hibernate.transaction.jta.platform org.hibernate.service.jta.platform.internal.WebSphereExtendedJtaPlatform
no transaction is in progress
Code:
hibernate.transaction.jta.platform org.hibernate.service.jta.platform.internal.WebSphereExtendedJtaPlatform
hibernate.transaction.factory_class org.hibernate.transaction.CMTTransactionFactory
no transaction is in progress
Code:
hibernate.transaction.jta.platform org.hibernate.service.jta.platform.internal.WebSphereExtendedJtaPlatform
hibernate.transaction.factory_class org.hibernate.transaction.JTATransactionFactory
no transaction is in progress
In short, no matter I am using jta.platform or manager_lookup_class, JPA/Hibernate seems only be able to pick up the transaction when I am using CMTTransactionFactory. However, auto-flush is still not working.
My app service look like this:
Code:
@Transactional(propagation=Propagation.REQUIRES_NEW)
public class FooServiceImpl implements FooService {
@Inject
private FooRepository fooRepo;
public void doSomething() {
Foo foo = fooRepo.findBySomething(...);
foo.setBar(...);
//fooRepo.flush();
}
}
(the line fooRepo.flush() is the place I modify to try manual flushing and auto flushing)
Repository is making use of Spring Data JPA
I really have no clues on what else I can try 
Using Spring 3.1.2, Hibernate 4.1.6, Websphere 8