ROP, prePersist() and missing values

From: Marcin Skladaniec (marci..sh.com.au)
Date: Sun Apr 29 2007 - 00:31:53 EDT

  • Next message: Peter Schröder: "AW: Jgroups config file"

    Hello

    In our application we utilise prePersist on server to update some
    information about the committed object (ie. createdOn), but there is
    a problem, the values set in the prePersist are not returned with the
    object to the client. Re-fetching the object gives all the correct
    values. Example:

    on server prePersist :

    public void prePersist() {
    super.perPersist();
    setCreatedOn(new Date());
    }

    on client:

    Apple apple = (Apple) context.newObject(Apple.class);
    logger.debug("before commit, created on : " + apple.getCreatedOn());
    context.commitChanges();
    logger.debug("after commit, created on : " + apple.getCreatedOn());
    apple.setPersistenceState(PersistenceState.HOLLOW);
    logger.debug("after refresh, created on : " + apple.getCreatedOn());

    the output :

    before commit, created on :null
    after commit, created on :null
    after refresh, created on :Sun Apr 29 14:21:25 EST 2007

    Is that a bug ? We have caching turned off at the moment, so this
    should not be an issue. Also, I have not tested postPersist(),
    preUpdate() and postUpdate(), but I assume that it will be the same.
    Marcin



    This archive was generated by hypermail 2.0.0 : Sun Apr 29 2007 - 00:32:42 EDT