public synchronized <T> T execute(Command<T> command) {
PlatformTransactionManager txManager = GrailsIntegration.getTransactionManager();
DefaultTransactionDefinition txDef = new DefaultTransactionDefinition();
txDef.setPropagationBehavior(DefaultTransactionDefinition.PROPAGATION_REQUIRED);
TransactionStatus status = txManager.getTransaction(txDef);
try {
initKsession( this.sessionInfo.getId(),
this.marshallingHelper.getKbase(),
this.marshallingHelper.getConf() );
registerRollbackSync();
configureEnvironment();
T result = ((GenericCommand<T>) command).execute( this.kContext );
updateBlobs(command instanceof DisposeCommand);
txManager.commit(status);
return result;
} catch (RuntimeException e){
status.setRollbackOnly();
throw e;
} catch ( Exception e ) {
status.setRollbackOnly();
throw new RuntimeException("Wrapped exception see cause", e);
}
}