// Create an embedded database for testing tx results when commit / rollback
ConnectionManagerFactoryBean factory = new ConnectionManagerFactoryBean();
factory.setTransactionManager(tm);
factory.setTransaction("xa");
factory.afterPropertiesSet();
ConnectionManager cm = (ConnectionManager) factory.getObject();
ManagedConnectionFactory mcf = new DerbyDataSourceMCF("target/testdb");
dataSource = (DataSource) mcf.createConnectionFactory(cm);
JdbcStoreFactory storeFactory = new JdbcStoreFactory();
storeFactory.setDataSource(dataSource);