Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] Oracle Driver loaded from wrong classloader in OSGi environment sometimes

Hello,

I have a strange problem that once in a while the Oracle Driver is loaded from the wrong classloader and EclipseLink cannot use it. I am importing the oracle driver packages into my project and set the EntityManagerFactory like this properties.put(PersistenceUnitProperties.CLASSLOADER, this.getClass().getClassLoader());

in a class that is in the same bundle as the oracle imports. This works in 80% of the time. But sometimes (due to some race conditions I assume) the classloader that was used by the oracle bundle to register itself with the driver manager seems to be the wrong one.

I am using org.eclipse.persistence.jpa.osgi.PersistenceProvider.

Anyway it would be better this whole old DriverManager thing would be replaced by proper OSGi services. The Oracle driver would just register itself as a driver in the OSGi system. Dreams :)

Thanks for any input on this issue,
Phil


Back to the top