JBoss Community

Re: Drools, Spring integration and JTA in container

created by Alex Manly in jBPM - View the full discussion

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.

Reply to this message by going to Community

Start a new discussion in jBPM at Community