db-jdo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Luc Claes <...@contactoffice.com>
Subject Re: jdo 1.0 + jdo 2.0
Date Sun, 26 Feb 2006 18:21:25 GMT
Hi Craig,

Here follows a sample of what could be a problematic situation. But 
maybe I'm missing something obvious.
We are trying to mix a JDO 1.0 implementation (FastObjects) with a JDO 
2.0 implementation (JPOX 1.1). The problem occurs at runtime on one of 
the 'makePersistent' call, depending on the included jdo jar (1.x or 2.0).


import java.util.Properties;

import javax.jdo.JDOHelper;
import javax.jdo.PersistenceManager;
import javax.jdo.PersistenceManagerFactory;

public class Test {
private void init() {
// Create the JPOX 1.1 PMF
Properties propertiesJPOX = new Properties();
// Other properties...
PersistenceManagerFactory pmfJPOX = 

// Create the FastObjects PMF
Properties propertiesFastObjects = new Properties();
// Other properties...
PersistenceManagerFactory pmfFastObjects = 

PersistenceManager pmJPOX = pmfJPOX.getPersistenceManager();
PersistenceManager pmFastObjects = pmfFastObjects.getPersistenceManager();
Object objectToMakePersistent = null;
// Here, various operations are taking place...
// This will fail at runtime if we import the 1.x jdo.jar
// because makePersistent is declared as returning void
// This will fail at runtime if we import the 2.0 jdo.jar
// because makePersistent is declared as returning Object

Craig L Russell wrote:
> Hi Luc Claes,
> JDO was designed to allow clean separation of application classes, so 
> that you could mix and match implementations.
> But maybe a more specific example of what you are trying to accomplish 
> would help decide the issue.
> Regards,
> Craig

View raw message