Hi,
I have managed to get the spring context to load by overriding the SingleSessionCommandService as you mentioned. Here is my code:
public void initTransactionManager(Environment env) {
Object tm = env.get( EnvironmentName.TRANSACTION_MANAGER );
if ( tm != null && tm.getClass().getName().equals( "org.springframework.transaction.jta.JtaTransactionManager" ) ) {
logger.debug( "Instantiating Spring JtaTransactionManager" );
this.txm = new JtaTransactionManager(((org.springframework.transaction.jta.JtaTransactionManager)tm).getUserTransaction(),
env.get( EnvironmentName.TRANSACTION_SYNCHRONIZATION_REGISTRY ),
((org.springframework.transaction.jta.JtaTransactionManager)tm).getTransactionManager() );
this.jpm = new DefaultJpaManager(this.env);
} else {
// continue as normal
}
I agree.....very messy. Thanks for your help.