db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brendan Miller" <bmil...@dotster.com>
Subject Torque/Village issues selects without bind variables on MyPeer.doDelete(criteria)?
Date Tue, 25 Sep 2007 17:53:06 GMT

I have a table that has no true primary key at the database (Oracle) layer.  The
only way for me to find a row is to use criteria.  I am trying to delete
this row.  I have

    Criteria criteria = new Criteria();
    criteria.add(FIELD_A, value_a);
    criteria.add(FIELD_B, value_b);
    criteria.add(FIELD_C, value_c);
    criteria.add(FIELD_D, value_d);

The implementation of BasePeer.doDelete() appears to use Village to
construct a where clause that does not use bind variables.  I have
tracked this down to BasePeer.processTables and Village's
TableDataSet.buildSelectString().  With Oracle, this is causing SQL
cache flooding that we avoid by using doPSSelect for normal queries.

Anyone have any ideas on how to delete the row/object without incurring
this SELECT without bind variables query?  I can alter my torque schema
to say that all four fields are primaryKey="true' but that didn't help. 
I can make any other changes to the Torque schema that people think will
help.  I may be able to persuade our Oracle DBA to adjust the table if
absolutely necessary.  The reason I can't simply do object.delete() is
because of the lack of primary and the Oracle timestamp SQL generation 
I reported in TORQUE-94.

If there's still a better way, I'd love to hear about it.

Does Torque/Village always do a SELECT first before it DELETEs?


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

View raw message