|
Hi Brett,
I noticed that in org.hibernate.osgi.OsgiJtaPlatform, there are code like
@Override
public boolean canRegisterSynchronization() {
return false;
}
@Override
public void registerSynchronization(Synchronization synchronization) {
}
And also looked at the code at org.hibernate.engine.transaction.internal.TransactionCoordinatorImpl.attemptToRegisterJtaSync()
jtaPlatform jtaPlatform = getTransactionEnvironment().getJtaPlatform(); if ( jtaPlatform == null ) {
return;
}
if ( !jtaPlatform.canRegisterSynchronization() ) {
LOG.trace( "registered JTA platform says we cannot currently resister synchronization; skipping" );
return; }
So this can cause no hibernate Synchronization impl get registered in JTA service when in OSGi container, which means when use Container Managed Transaction, when TransactionImpl(org.apache.geronimo.transaction.manager.TransactionImpl) commit, it's not possible to trigger Synchronization impl callback in hibernate, when means can't invoke the hibernate SessionImpl.flush method, so we run into the problem that the actual data not get flushed before transaction complete/commit.
So my question is when could canRegisterSynchronization/registerSynchronization method could get implemented in org.hibernate.osgi.OsgiJtaPlatform? As with current implementation the transaction actually doesn't work in OSGi container.
Do I miss something? Is there any workaround for it?
Thanks for all your hard work in hibernate-osgi support! Best Regards Freeman
|