db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Newton <new...@pingsite.com>
Subject Re: Can't delete row, either no delete or get "You must specify KeyDef..." exception.
Date Wed, 09 Mar 2005 16:00:25 GMT
Thomas Fischer wrote:

> You use the foreign keys also as primary key. In my experience, using 
> something which has another meaning as a primary key is not a good 
> idea. Can you try to add another column, e.g. user_role_id, as a 
> primary key,
> remove the primaryKey attribute from the other columns and try it again ?
> Just removing the primaryKey attribute is also not a good idea, as 
> Torque relies on having a primary key.
>
>
> Just a comment on your secondary problem (building the query by hand). 
> Looking at the source code, executeStatement is plain jdbc, just using 
> Torque's connection pool to execute your query. So I am very amazed 
> that this does not work. Did you look at the return value of 
> executeStatement ?
> It should give you the number of affected rows. If it is > 0 but you 
> still see the row you just deleted, then maybe it is a transaction 
> problem (not enough commits). Perhaps(if you use several databases at 
> once), the command might hit the wrong database

Hi everybody,

Thanks for all the input--I am still not sure what happened, but the 
problem seems to have resolved itself with disturbingly little input on 
my part :/

I never had a chance to use p6spy, but I think I was attempting to 
delete a combination of values that wasn't suppoed to be in the table 
anyway, perhaps violating some sort of constraint on the table. When I 
fixed my weird insert problem the weird delete problem went away.

Another side-issue might be that I'm using DBDesigner to design the 
tables, running it through a Ruby program that converts it into a Torque 
schema, then tweaking by hand to fix the problems I don't address in the 
conversion process (yet). I mayhave inadvertently not tweaked everything 
100%.

Again, thanks all for the input; problem resolved!

Dave

PS: I'll have the Ruby conversion program posted at some point during 
the next week or two if anybody wants to look at it or fix the stuff I 
just don't have time to deal with right now :)



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