[hibernate-dev] HHH-5951 - Guess appropriate JtaPlatform based on environment if an explicit one not specified

Łukasz Antoniak lukasz.antoniak at gmail.com
Tue Aug 7 15:19:58 EDT 2012


Hello all,

I have implemented basic proof of concept regarding JTA platform recognition. You can find the initial suggestion here: 
https://github.com/lukasz-antoniak/hibernate-core/commit/3df34efad32ceed98a98d2af2c831119b4261773.

Implementation notes:

1) Defining JAR archives in classes extending AbstractJtaPlatform might not be the best option, but I did not want to double each 
platform class by introducing something like:
public interface EnterprisePlatform {
     public JtaPlatform getJtaPlatform();
     public Collection<Pattern> getCharacteristicJarArchivePatterns();
}
public class WeblogicEnterprisePlatform implements EnterprisePlatform {
     // obvious goes here...
}
Any thoughts?

2) Decided to match JAR archive names with regular expressions instead of strict names because of JAR versioning (case of Bitronix).

As for now, automatic recognition has been tested on WebLogic 12 and it seems to work fine.

I wanted to know your opinion before testing against other application servers.

Best Regards,
Lukasz


More information about the hibernate-dev mailing list