{
XaDataSourceManager xaDsMgr = xaDsManager;
String name = dsName.toLowerCase();
if ( xaDsMgr.hasDataSource( name ) )
{
throw new TransactionFailureException( "Data source[" + name
+ "] has already been registered" );
}
try
{
XaDataSource dataSource = xaDsMgr.create( className, params );
xaDsMgr.registerDataSource( name, dataSource, resourceId );
return dataSource;
}
catch ( Exception e )
{
throw new TransactionFailureException(
"Could not create data source [" + name
+ "], see nested exception for cause of error", e.getCause() );
}
}