}
private DataSource createJtaDataSource(TransactionManager transactionManager) throws Exception {
JdbcManagedConnectionFactory mcf = new JdbcManagedConnectionFactory("org.hsqldb.jdbcDriver", "jdbc:hsqldb:mem:JpaTest", "sa", "", false);
SharedLocalConnectionManager connectionManager = new SharedLocalConnectionManager(transactionManager);
DataSource connectionFactory = (DataSource) mcf.createConnectionFactory(connectionManager);
return connectionFactory;
}