Hi emmanuel,
When i read your comment i understand that my code :
Code:
properties.put(Environment.TRANSACTION_STRATEGY, PersistenceUnitTransactionType.RESOURCE_LOCAL);
is no good because PersistenceUnitTransactionType.RESOURCE_LOCAL is jpa transaction type and not hibernate !!!.
Which configuration information must be in place of PersistenceUnitTransactionType.RESOURCE_LOCAL ?
Why now it's working and why this propertiy is enabled if i give a empty config file ?
Another strange configuration issue in the class InjectionSettingsFactory.
When i used the static call to the method
Code:
protected ConnectionProvider createConnectionProvider(Properties properties) {
return ConnectionProviderFactory.newConnectionProvider( properties, connectionProviderInjectionData );
}
the code :
Code:
public static ConnectionProvider newConnectionProvider(Properties properties, Map connectionProviderInjectionData) throws HibernateException {
ConnectionProvider connections;
String providerClass = properties.getProperty(Environment.CONNECTION_PROVIDER);
if ( providerClass!=null ) {
try {
log.info("Initializing connection provider: " + providerClass);
connections = (ConnectionProvider) ReflectHelper.classForName(providerClass).newInstance();
}
catch (Exception e) {
log.fatal("Could not instantiate connection provider", e);
throw new HibernateException("Could not instantiate connection provider: " + providerClass);
}
}
alway thow and exception
Code:
java.lang.ClassCastException: org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider
at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:73)
In debug mode the providerClass is by default an
org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider
who is a ConnectionProvider !!! this is totaly crazy when i evaluate the expression no error is thrown but when i step over error is reased !!!
I miss again something ?
Thank's