Pedro Salgado wrote:
In tutorial 4 I found something like:Sure, this is much cleaner. But my code is only one line ;-)
factory = new OjbStorePMF();
Isn't this a better way to create a PersistenceManagerFactory?
Properties props = new Properties(); props.setProperty("javax.jdo.PersistenceManagerFactoryClass", "org.apache.ojb.jdori.sql.OjbStorePMF");
PersistenceManagerFactory pmf = JDOHelper.getPersistenceManagerFactory(props); PersistenceManager pm = pmf.getPersistenceManager();
Another question...
What are the limitations of this JDO plugin? Can I use it safely for makePersistent, deletePersistent and getObjectById and transaction management (these are the only methods I need)?
I don't know of any restriction wrt. the JDO programming model.
The only thing that is problematic is the query mechanism:
if a JDOQL query is processed, the JDORI load the complete extent (i.e. all instance of a class) and matches each object against the search criteria. This can be a performance killer for large tables.
unfortunately the JDORI plugin mechanims does not provide any interface to delegate queries down to the persistence kernel. SO OJB can't do any optimizations here and must load all instances of the extent and reach them back to the JDORI layers. This is one of the main reasons why we want to write our own JDO implementation.
The good news in your case: getObjectById() is not affected by this problem and works very efficiently.
cheers, thomas
Thank you,
Pedro Salgado
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
