db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@mankin.org.uk
Subject Documentation and (slightly) strange update problem
Date Wed, 25 Feb 2004 10:11:45 GMT

On 25-Feb-2004 Scott Eade wrote:
> Gautam, Ajay wrote:
> 
>>I was wondering if there is a document that explains the inner workings of
>>ID_TABLE's NEXT_ID management. Or maybe someone on this list could elobrate
>>on the same in view of the following issues:
>>
> No document exists at this time.
> 

As a newcomer to Torque, I would add that the lack of comprehensive
documentation has been my biggest difficulty. Is there a documentation project
in hand? I think that such a project should even take precedece over fixing
bugs; if one at least has the wrinkles documented one can work around them, and
AFAICT most are not major.

To move on ... I encountered some unintuitive behaviour when doing an update.


I have a m:n join table. It looks something like

        create table link (
                PK integer auto_increment,      -- synthetic primary key
                parent integer references mastertable,
                child  integer references mastertable
        )

Now, I wanted to move a child from one parent to a different parent i.e. just
update the 'parent' field in the link. I therefore selected on the
(parent,child) pair, amended the parent value and called save(). This is where
things went wrong.

Torque tried to save using the same criteria that it had used to select, but I
had changed one of the values. It therefore did an INSERT instead of an UPDATE
when what I wanted was that it should do an UPDATE using the primary key.

The actual behaviour is clearly the intended behaviour. What I am questioning
is whether this is the correct behaviour. As we know from recent  postings,
every table must have a primary key otherwise save() does not save. Given that
there always is a primary key, should all UPDATEs *always* use that key and not
the selection criteria?

I worked around my problem, but good documentation would have made life much
easier.
-- 
                                       Never underexaggerate

Raphael Mankin
E-Mail: raph@panache.demon.co.uk
----------------------------------

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