In a EE container you can either do everything manually or just use what the container provides. Of course the last one is the best since you decrease the code you need to maintain. That's great but sometimes you need to customize few things and for datasource for instance you can desire to customize the way you read the configuration. If you create it yourself how do you keep JTA support? TomEE has the answer!