db.ApplyUpdates & Update SQL Object

When we try to issue a applyupdates on a database object which has a query
component with  Cached updates = true and an UpdateSQLObject attached to
it,

the applyupdates works every alternate time

When we replace the db.applyupdate with myquery.applyupdate (ie. on the
Tdataset instead of
the Tdatabase ) , then it works without any problems.

Regards
Shahed.