tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Blevins (JIRA)" <j...@apache.org>
Subject [jira] Created: (OPENEJB-879) Automatically set toplink.target-server for TopLink
Date Mon, 04 Aug 2008 22:06:44 GMT
Automatically set toplink.target-server for TopLink
---------------------------------------------------

                 Key: OPENEJB-879
                 URL: https://issues.apache.org/jira/browse/OPENEJB-879
             Project: OpenEJB
          Issue Type: Improvement
          Components: configuration
    Affects Versions: 3.0-beta-1, 3.0-beta-2, 3.0
            Reporter: David Blevins
            Assignee: David Blevins
             Fix For: 3.0.1


Code is essentially:

                    String lookupProperty = "hibernate.transaction.manager_lookup_class";
                    String openejbLookupClass = "org.apache.openejb.hibernate.TransactionManagerLookup";
                    String className = persistenceUnit.properties.getProperty(lookupProperty);

                    if (className == null || className.startsWith("org.hibernate.transaction")){
                        persistenceUnit.properties.setProperty(lookupProperty, openejbLookupClass);
                        logger.debug("Adjusting PersistenceUnit(name="+persistenceUnit.name+")
property to "+lookupProperty+"="+openejbLookupClass);
                    }

The result is that OpenEJB-specific configuration can be avoided when using OpenEJB + Hibernate.
 A second benefit is that if another vendor is used in production, the value will automatically
be reset for using OpenEJB in the test environment.  Ensuring the strategy starts with "org.hibernate.transaction"
allows for a custom lookup strategy to be used and not overridden.




-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message