You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Sandor KELEMEN <sk...@piros.zold.net> on 2003/01/30 01:31:31 UTC

JDO Query result: peristent or not

Hi,

I've just started to examine JDO. In my test application the
JDOHelper.isPersistent() call returns false for an instance returned as the
result of a query. Is it a bug or can you imagine a situation where this
could be a correct behaviour?

The relevant code:
----------------------------
pm.currentTransaction().begin();

// getProductById(): uses the pm w/o starting a new transation to lookup the
// Product object
Product toEdit = getProductById( pm, productId);

if ( toEdit != null)
{
  log.info( "persistent   = " + JDOHelper.isPersistent( toEdit));
  log.info( "product name = " + toEdit.getName());
}
else
{
  log.info( "NOT found");
}
----------------------------

Produces the following output:
persistent   = false
product name = TestProd

Any help would be greatly appreciated.

Best Regards,
Sanyi