Hi Sarav,

I only suggested keeping the TorqueObject in memory because It is the
easiest way to do it. I would guess that the things that matter in step 7
are
- Torque thinks the object is new (either by really creating a new object
as yoo do, or by setting the isNew and isModified flags)
- the Torque object aready has got a pk set
So as you already have a new torque object, the only step which would be
required is to set the pk of the torque object to the desired value. Have
you tried that ?

         Thomas

Saravana Krishnan <[EMAIL PROTECTED]> schrieb am 09.12.2004 20:14:59:

> Hi Thomas,
>
>  This are the actual steps I do-
>
> 1 load the Torque object (internally loads a big tree of objs)
> 2 Convert it to business obj (only PK retained, business obj also a
>   tree representation.)
> 3 Make changes to business obj (tree structure can be changed too)
> 4 Convert business obj to Torque obj
> 5 Delete record on DB by using the PK stored inside business obj
> 6 Convert business obj to Torque obj
> 7 Save Torque obj
>
> For now I was generating new PKs each time I update. But in the near
> future I need the PK to be fixed between updates. Step 3 can take really
> long (30+ mins) because it needs a lot of user interaction. So I think
> storing the Torque obj in memory for that long when I really don't need
> any of the data will be a waste of memory in a web server. The previous
> version of the software is already having memory issues because of
> mistakes like this (I didn't code it ;-) ). Have any other suggestions
> for me?
>
> Thanks,
> Sarav
>
> On Thu, 2004-12-09 at 04:12, Thomas Fischer wrote:
> >
> >
> > Hi Sarav,
> >
> > Have you tried the following:
> > - load the object in question
> > - delete the object but keep a reference in memory
> > - call the object's methods setModified(true) and setNew(true)
> > - save the object
> >
> > Not sure whether this works with autogenerated ids, but it might be
worth
> > trying
> >
> >      Thomas
> >
> >
> > "Saravana Krishnan Kannan" <[EMAIL PROTECTED]> schrieb am 08.12.2004
> > 22:19:08:
> >
> > > Hi,
> > >
> > >   I have a table which generally uses autogenerated ids. But under
> > > some circumstances, I need to delete a record and create a new one
> > > with the same id. I can't use doUpdate here because deleting the
> > > record causes a cascaded delete of a big tree of records and thats
> > > the reason I'm doing the delete in the first place. How do I go
> > > about doing this? "This" meaning, creating a new record with a non-
> > > autogenerated id for a table whose idMethod is native. I know some
> > > flags need to be set, but I don't know what all flags need to be set
> > > to what value.
> > >
> > > Thanks in advance.
> > >
> > > ~Sarav
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to