Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » Possible JpoxHelper bug; Custom PMFCreator not honoured
Possible JpoxHelper bug; Custom PMFCreator not honoured [message #615513] Tue, 19 February 2008 09:52
Florian Hackenberger is currently offline Florian HackenbergerFriend
Messages: 123
Registered: July 2009
Senior Member
Hi!

I'm trying to use Teneo with the standard JPOX plugin (copied to
eclipse/plugins) within an RCP application. According to [1] I need to
create the PersistenceManagerFactory like this:

//set classloader for driver (using classloader from the "rcp.jars" bundle)
ClassLoader clrDriver =
Platform.getBundle("rcp.jars").loadClass("org.h2.Driver").getClassLoader();
map.put("org.jpox.primaryClassLoader", clrDriver);

//set classloader for JPOX (using classloader from the "org.jpox" bundle)
ClassLoader clrJPOX =
Platform.getBundle("org.jpox").loadClass("org.jpox.PersistenceManagerFactoryImpl ").getClassLoader()

PersistenceManagerFactory pmf = JDOHelper.getPersistenceManagerFactory(map,
clrJPOX);

Otherwise, the database driver cannot be loaded. With Teneo this procedure
should involve creating a custom PMFCreator and setting it via:
JpoxHelper.INSTANCE.setPMFCreator(pmfCreator);
This pmfCreator would then create the persistence manager factory in it's
method
getPersistenceManagerFactory()
like the code above. There is one problem however. JpoxDataStore on line 526
in createSchema(), doesn't use JpoxHelper to get a persistence manager
factory, but instead uses JDOHelper. Is that a bug? I'd say yes, because it
uses JpoxHelper in it's initialize() method. Is there a workaround
available? Placing the jpox plugin jar file within another plugin doesn't
work in my case, because I need the extension points which are registered
by the jpox plugin.

Cheers,
Florian

[1] http://www.jpox.org/servlet/wiki/pages/viewpage.action?pageI d=1179712
--
Florian Hackenberger
Previous Topic:[CDO] Questions about 0.8.0M5
Next Topic:[Teneo] Solution for XMLGregorianCalendar problems
Goto Forum:
  


Current Time: Fri Mar 29 13:44:26 GMT 2024

Powered by FUDForum. Page generated in 0.01912 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top