db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ashley Hayes <ashley.ha...@macalla.com>
Subject RE: why does Torque select all the data of an object prior to a save ( update )
Date Wed, 03 Dec 2003 13:52:50 GMT
Thanks for your input Giulio. I don't see how that locking could help. It
would just lock 
the table for the time between the save's Select and Update as opposed to 
from the population to save time

An initial select populates your object from the DB,
you may then update as the object as you wish and
WAIT an arbitrary amount of time before you save the object back
to the DB, only at this point does the second select occur. 
Even if this causing locking on the table, I don't see the benefit,
as the potential for a LOST WRITE still exists,e.g.

-------------------------- Time
---------------------------------------------------->
Thread 1:  Query object1                                             Update
object1 
Thread 2:       

              Query object1      Update object1

when Thread1 performs the update the object's table may get locked by the
SELECT and UPDATE 
but it still succeeds in updating the data.

so if the second select is only locking at update time, why do it at all?
Am I missing something?
A






-----Original Message-----
From: Giulio Vezzelli [mailto:giulio.vezzelli@infolog.it]
Sent: 03 December 2003 13:06
To: Apache Torque Users List
Subject: R: why does Torque select all the data of an object prior to a
save ( update ) 


I think Torque selects all data before saving to handle locking.

E.G. It makes sure that the data hasn't changed in the time between the
moment the business object was populated and the moment you ask to save... I
suppose...

Giulio Vezzelli
Infolog S.r.l.
Via Alfieri, 28
Modena - 41100
Telefono : +39-059-822446
Sito web : http://www.infolog.it
E-mail : giulio.vezzelli@infolog.it
 
 

> -----Messaggio originale-----
> Da: Ramesh Sabeti [mailto:rs@reazon.com] 
> Inviato: martedì 2 dicembre 2003 0.11
> A: 'Apache Torque Users List'
> Oggetto: RE: why does Torque select all the data of an object 
> prior to a save ( update ) 
> 
> Ashley,
> 
> Did you find an answer to your question, or find a solution?  
> I'm running into the same problem.  It's crashing the Oracle 
> server after a few days of use.
> 
> Ramesh.
> 
> > -----Original Message-----
> > From: Ashley Hayes [mailto:ashley.hayes@macalla.com]
> > Sent: Friday, October 17, 2003 3:15 AM
> > To: Torque-User (E-mail)
> > Subject: why does Torque select all the data of an object prior to a
> save
> > ( update )
> > 
> > Hi,
> > 	I was looking at the sql statements made by my torque
> application. I
> > noticed that if you retrieve an object from storage, SELECT 
> .... FROM
> ...
> > WHERE ...
> > 
> >  then update an attribute and call save , the all the data is
> retrieved
> > again and then the update statement executed
> > 
> > e.g. SELECT * FROM ... WHERE ID=1280
> >      UPDATE ... SET DATETIME = ?, STATUS_ID = ? WHERE ID = ?
> > 
> > The torque code that is causing this in  BasePeer:
> > public static void doUpdate(
> >         Criteria selectCriteria,
> >         Criteria updateValues,
> >         Connection con)
> >         throws TorqueException
> > {
> >  ....
> > }
> > 
> > Is this behaviour by torque design or the only way torque 
> can update 
> > records via the village library?
> > thanks
> > A
> > 
> > 
> ---------------------------------------------------------------------
> > 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

---------------------------------------------------------------------
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