taking up this old thread again, sorry about the delay ...


> > another problem regarding transactions will be coming up: when testing
> > whether transactions are needed, criteria.containsObjectColumn(dbname)
> > only returns true when criteria is not empty...not always a valid
> > assumption, i think.
>
>I don't usually need transactions, so forgive me if this is obvious,
>but can you provide a use case for this and/or a patch which
>illustrates a fix for this insidious situation?
>Daniel
example:
working with turbine-release (turbine-src-2.1) code, i try to get all users :

Criteria crit = new Criteria();
User [] users = TurbineSecurity.getUsers(crit);

This results in a DataBackendException:
Failed to retrieve users: FastPath call returned ERROR ...

Problem lies in the call to super.elements() in method 
Criteria.containsObjectColumn -
with an empty Criteria object (no criterions in hashtable) this method will 
always return false,
resulting in BasePeer .doSelect (criteria) choosing the branch "no 
transaction needed",
resulting in postgresql Error.

But what to do doctor ??

in method Criteria.containsObjectColumn (dbname):
// check
if super.isEmpty()
     // i need the tableNames in order to get a TableMap
     // which i can ask whether it contains an object column
     // where do i get these from?
     // try to get the tableNames of the selected columns out of the 
criteria-object?



i am at a loss here ..
perhaps somebody who knows his way around criteria/criterion could point me 
in the right direction

thanks in advance
julia






---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to