Re: ROP, prePersist() and missing values

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Wed May 02 2007 - 09:28:08 EDT

  • Next message: Gary Jarrel: "Re: Error loading project after selecting DBCPDataSourceFactory"

    Hi Marcin,

    this is not a bug, rather a limitation of the current ROP protocol.
    We need to improve it in this area to send back the server-end
    changes. Would you mind to log a Jira issue please? (although I
    vaguely recall we discussed it before... wonder if there's already a
    Jira?)

    Andrus

    On Apr 29, 2007, at 7:31 AM, Marcin Skladaniec wrote:
    > 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 : Wed May 02 2007 - 09:28:42 EDT