final DataSource dataSource = dataSourceInstance.get();
final String schema = dbUnitConfigurationInstance.get().getSchema();
final DatabaseConnection databaseConnection = createDatabaseConnection(dataSource, schema);
databaseConnectionProducer.set(databaseConnection);
final DatabaseConfig dbUnitConfig = databaseConnection.getConfig();
dbUnitConfig.setProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY, new DefaultDataTypeFactory());
final Map<String, Object> properties = new DBUnitConfigurationPropertyMapper().map(dbUnitConfigurationInstance.get());
for (Entry<String, Object> property : properties.entrySet())
{
dbUnitConfig.setProperty(property.getKey(), property.getValue());
}
} catch (Exception e)
{
throw new DBUnitInitializationException("Unable to initialize database connection for DBUnit module.", e);
}