. My
> question is : is there a mecanism that automaticaly update the changes in
> the database ?

Other than to go with EJB, I would say no.

I like to write my objects with a save method.  I then call the save() at
appropriate times to update the object and the objects generally are not
long lived in memory.  You could also implement the xxxListener interface
that User does and have the object save itself when it is removed from the
session.  It is important to account for the possibility of corrupt data (in
the event of a crash, etc.).

Town, an extension of Village, has some features that cover this as well.

There is not just one best way to do this.

----- Original Message -----
From: Hervé Guidetti <[EMAIL PROTECTED]>
To: Turbine <[EMAIL PROTECTED]>
Sent: Tuesday, June 27, 2000 12:16 AM
Subject: Re: Object Saving.


> Ok, this is really cool !
> But this works only for user objects (something like profile).
> Is there in Turbine a mecanism to have pesistant objects without to worry
> about modifications. I explain : I have got an object that represents an
> entry in a table of the database (ie ProductObject). If I modify the price
> of this product, I will have to worry about changing it directely in the
> database by creating a critieria and calling the doUpdate() method>
> Thanks.
> Hervé
>
> >
> > > If you save objects in the user permanent hashtable and they are
> > > serializable, they will be saved when the user object is removed from
> the
> > > session.
> >
> > for example:
> >
> > data.getUser().setTemp("data", object)
> >
> > You can then retrieve it with:
> >
> > data.getUser().getTemp("data");
> >
> > if you want it to persist longer than the session (as a serialized
byte[]
> in
> > the Visitor.OBJECTDATA column), replace set/getTemp with set/getPerm.
> >
> > i think this is a really cool automatic "feature" in Turbine.
> >
> > please note that the user must be "logged" in in order for set/getPerm
to
> > work properly. we should probably throw an exception if someone tries to
> use
> > set/getPerm and the data.getUser().hasLoggedIn() returns false.
> >
> > -jon
> >
> >
> >
> > ------------------------------------------------------------
> > To subscribe:        [EMAIL PROTECTED]
> > To unsubscribe:      [EMAIL PROTECTED]
> > Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
> > Problems?:           [EMAIL PROTECTED]
> >
> >
> >
> > ------------------------------------------------------------
> > To subscribe:        [EMAIL PROTECTED]
> > To unsubscribe:      [EMAIL PROTECTED]
> > Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
> > Problems?:           [EMAIL PROTECTED]
> >
>
>
>
> ------------------------------------------------------------
> To subscribe:        [EMAIL PROTECTED]
> To unsubscribe:      [EMAIL PROTECTED]
> Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
> Problems?:           [EMAIL PROTECTED]
>



------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?:           [EMAIL PROTECTED]

Reply via email to