I'm still having the same problem (it can't find my ConnectionDriverName
property). Now my code looks like:
HashMap propMap = new HashMap();
propMap.put("openjpa.jdbc.DBDictionary", "
org.apache.openjpa.jdbc.sql.DerbyDictionary");
propMap.put("openjpa.ManagedRuntime", TxMgrProvider.class.getName
());
propMap.put("openjpa.ConnectionDriverName",
org.apache.derby.jdbc.EmbeddedDriver.class.getName());
propMap.put("javax.persistence.nonJtaDataSource", _datasource);
propMap.put("openjpa.Log", "DefaultLevel=TRACE");
EntityManagerFactory emf = Persistence.createEntityManagerFactory
("ode-dao");
EntityManager em = emf.createEntityManager(propMap);
As you can see everything is a string exception
javax.persistence.nonJtaDataSource. I even tried to comment out this
property to only have string properties and I still got the same error.
I have 2 questions thought:
1. If the loading of one property fails, no property gets loaded?
2. I keep on looking at the code in
EntityManagerFactoryImpl.createEntityManager. The error appears on the call
to _factory.newBroker and it seems to me that nothing much is done with the
provided Map before that. When does the Map gets used exactly?
Thanks a lot for your help!
On 1/3/07, Abe White <awhite@bea.com> wrote:
>
> OK, the problem is that we're only paying attention to openjpa.*
> property keys with String values when you bootstrap through
> Persistence. I have no idea why, and I'll change it momentarily.
> But for now, you can work around the problem for your DataSource
> using the "javax.persistence.nonJtaDataSource" key instead of
> "openjpa.ConnectionFactory". Unfortunately no such workaround exists
> for the ManagedRuntime.
> _______________________________________________________________________
> Notice: This email message, together with any attachments, may contain
> information of BEA Systems, Inc., its subsidiaries and affiliated
> entities, that may be confidential, proprietary, copyrighted and/or
> legally privileged, and is intended solely for the use of the individual
> or entity named in this message. If you are not the intended recipient,
> and have received this message in error, please immediately return this
> by email and then delete it.
>
|