Property hibernate.transaction.manager_lookup_class automatically set when
using Hibernate as the PersistenceProvider
---------------------------------------------------------------------------------------------------------------------
Key: OPENEJB-801
URL: https://issues.apache.org/jira/browse/OPENEJB-801
Project: OpenEJB
Issue Type: Improvement
Components: configuration
Affects Versions: 3.0, 3.0-beta-2, 3.0-beta-1
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.