.setUser( user )
.setPassword( password )
.setTimeout( 0 ) //infinite transaction
.createDataSource();
PersistenceUnitInfoBuilder pub = new PersistenceUnitInfoBuilder();
final PersistenceUnitInfo unitInfo = pub
.setExcludeUnlistedClasses( true )
.setJtaDataSource( ds )
.setPersistenceProviderClassName( HibernatePersistence.class.getName() )
.setPersistenceUnitName( "jbossjta" )
.setPersistenceXMLSchemaVersion( "2.0" )