This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes Stable JDO implementation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Stable JDO implementation" Watch "Stable JDO implementation" New topic
Author

Stable JDO implementation

kalpeshS desai
Greenhorn

Joined: Jan 20, 2004
Posts: 6
HI,

I've got following list of open-source JDO implementations from http://www.jdocentral.com.
Speedo (Open-Source)
http://speedo.objectweb.org
JBossDO (Open-Source)
http://www.jboss.org/index.html?module=html&op=userdisplay&id=developers/projects/jboss/jbossdo
Jakarta OJB (Open-Source)
http://jakarta.apache.org/ojb
Triactive JDO (Open-Source)
http://tjdo.sourceforge.net
XORM (Open-Source)
http://xorm.org
JPOX (Open-Source)
http://jpox.sf.net
I'm new to JDO, hence does not know which one of the above open-source JDO implementations is a stable one to use in my application.
Would be great if I get help to decide this.
regards,
kalpesh
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
If I had to make a quick decision, I would concentrate my research into TJDO and OJB because they're relatively mature and have probably the largest user communities. I could be wrong, of course.


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Erik Bengtson
Ranch Hand

Joined: Dec 06, 2003
Posts: 90
It depends on your requirements, like data storage, your data model, existing schemas, and bla bla bla...
- You can forget about JBossDO for a while. I mean, probably one year.
- The Apache OJB doesn't have their own JDO implementation, they have only one adapter do the JDO RI, which is based on the file system for data
storage. Don't recommend
- Speedo. I can't comment
- XORM. stable JDO implementation that supports RDBMS, but using a different concept of interfaces. I recommend
- TJDO. stable JDO implementation that supports RDBMS. works only with schemas created by TJDO. I recommend
- JPOX. stable JDO implementation that supports RDBMS.
I'm a JPOX developer, and so, I would like not to comment about JPOX.
kalpeshS desai
Greenhorn

Joined: Jan 20, 2004
Posts: 6
Thanks Erik,
I'm trying to run a test jdo project using EclipseJDO as a plugin for Eclipse 2.1 as instructed at url,
http://jpox.sourceforge.net/user-docs/eclipseJDO/Tutorial-EclipseJDO.html
I'm using eclipse 2.1.
I've followed all the steps listed in this html.
The enhancer works fine, but when it try to run the Main class, I get error,
java.lang.NullPointerException
at org.jpox.poid.MaxPoidGenerator.reserveBlock(MaxPoidGenerator.java:73)
at org.jpox.poid.PoidManager.getPoidBlock(PoidManager.java:63)
at org.jpox.poid.PoidManager.getPoid(PoidManager.java:38)
at org.jpox.store.StoreManager$2.execute(StoreManager.java:1048)
at org.jpox.store.StoreManager$MgmtTransaction.execute(StoreManager.java:1619)
at org.jpox.store.StoreManager.getNextOID(StoreManager.java:1053)
at org.jpox.store.table.JDOBaseTable.newOID(JDOBaseTable.java:69)
at org.jpox.store.StoreManager.newObjectID(StoreManager.java:981)
at org.jpox.state.StateManagerImpl.<init>(StateManagerImpl.java:267)
at org.jpox.AbstractPersistenceManager.internalMakePersistent(AbstractPersistenceManager.java:712)
at org.jpox.AbstractPersistenceManager.makePersistent(AbstractPersistenceManager.java:733)
at model.Main.main(Main.java:29)
java.lang.NullPointerException
at org.jpox.store.table.JDOBaseTable.newOID(JDOBaseTable.java:84)
at org.jpox.store.StoreManager.newObjectID(StoreManager.java:981)
at org.jpox.state.StateManagerImpl.<init>(StateManagerImpl.java:267)
at org.jpox.AbstractPersistenceManager.internalMakePersistent(AbstractPersistenceManager.java:712)
at org.jpox.AbstractPersistenceManager.makePersistent(AbstractPersistenceManager.java:733)
at model.Main.main(Main.java:29)
Exception in thread "main"
I'm using com.versant.eclipse.jdo_0.9.7.zip and com.versant.eclipse.jdo.jpox_0.9.7.zip as plugins.
My class,
--------
public class Inv {
String name;
String value;

public void setName(String nm)
{
name = nm;
}
public String getName(){
return name;
}
public void setValue(String val){
value = val;
}
public String getValue(){
return value;
}
}
Inv.jdo file
-------------
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jdo SYSTEM "file:/javax/jdo/jdo.dtd">
<jdo>
<package name="model">
<class name="Inv">
<field name="name" persistence-modifier="persistent"/>
<field name="value" persistence-modifier="persistent"/>
</class>
</package>
</jdo>
Main class
----------
public class Main {
public static void main(String[] args) {
Properties properties = new Properties();
properties.setProperty("javax.jdo.PersistenceManagerFactoryClass", "org.jpox.PersistenceManagerFactoryImpl");
properties.setProperty("javax.jdo.option.ConnectionURL", "jdbc racle:thin:@T00328588:1521 evk");
properties.setProperty("javax.jdo.option.ConnectionDriverName","oracle.jdbc.driver.OracleDriver");
properties.setProperty("javax.jdo.option.ConnectionUserName","scott");
properties.setProperty("javax.jdo.option.ConnectionPassword","tiger");
properties.setProperty("org.jpox.autoCreateTables","true");
properties.setProperty("org.jpox.validateTables","false");
properties.setProperty("org.jpox.validateConstraints","false");

PersistenceManagerFactory pmfactory = JDOHelper.getPersistenceManagerFactory(properties);
PersistenceManager pm = pmfactory.getPersistenceManager();
Transaction tx = pm.currentTransaction();
tx.begin();
Inv inv = new Inv();
inv.setName("HardDisk");
inv.setValue("150");
pm.makePersistent(inv);
tx.commit();
pm.close();
}
}
Oracle table
------------
NAME VARCHAR2(10)
VALUE VARCHAR2(10)

Kindly address me where I'm doing wrong.
Sorry for such a long question.
Regards,
Kalpesh
Erik Bengtson
Ranch Hand

Joined: Dec 06, 2003
Posts: 90
Are you using an existing table?
If not, please enable the LOG4J in debug mode and send us.
By the way, it's better to post this type of question at our forum. Many other developers also can help.
Regards,
Erik
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Stable JDO implementation
 
Similar Threads
Are companies really using JBoss for production apps?
Open source object-relational mapping tools for Java
Publishing Java Class as a web service
Eclipse and JBoss
php-like content mgmt system