0 Replies Latest reply on Feb 20, 2002 8:41 AM by alci

    EJB, Castor and Value Objects (La Fontaine)

    alci

      Hi,

      this is an architectural question on combining EJB / Castor JDO and Value Objects... (I'm quite new to J2ee)

      My idea was to :

      1) Get a reference to a Castor jdo in my facade session ejb
      2) Query the database for for a persistent object
      3) Return it as a value object to the web tier

      My first question is : could (sould) the returned value object (serilizable) be the same as the persistent object ?

      (right now, I just set all values of the value object using the persistent object get methods, and return the value object) ?

      Then, I've got the value object in the web tier. I render it on a html page. For now, that's fine.

      But what if I must update the data ?
      My session EJB is released after the web tier has queried the data. Then there can be a long time. Then, the web tier sends another query to update the data.
      Inbetween, who knows what happened to the data in the database ? So this is a king of long transaction.

      Does anyone have a tip on that ?
      (maybe I should use an entity bean ?)

      Thanks in advance,

      Franck Routier