db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Saravana Krishnan <saravkr...@uky.edu>
Subject RE: Setting non-autogened ids under native idMethod
Date Thu, 09 Dec 2004 19:14:59 GMT
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" <saravkrish@uky.edu> 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: torque-user-unsubscribe@db.apache.org
> > For additional commands, e-mail: torque-user-help@db.apache.org
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Mime
View raw message