#13 ForeignKey doesn't respect Transaction

closed-fixed
nobody
General (126)
5
2003-11-04
2003-11-03
Anonymous
No

When using ForeignKeys with transactions,
the "performJoin" function doesn't check for
_SO_perConnection, and thus doesn't us the transaction
connection for lookup of Objects.

Join.py line 105

Sollution check for _SO_perConnection, and when
needed use _connection as second argument in Object
lookup (see SQLObject.py line 814)

Rolf Theunissen
rolf@noxs.nl

Discussion

  • Logged In: NO

    def performJoin(self, inst):
    ids = inst._connection._SO_selectJoin(
    self.otherClass,
    self.joinColumn,
    inst.id)

    if inst._SO_perConnection:
    return self._applyOrderBy([self.otherClass(id,
    connection=inst._connection) for (id,) in ids if id is not None],
    self.otherClass)
    else:
    return self._applyOrderBy([self.otherClass(id) for (id,)
    in ids if id is not None], self.otherClass)

     
  • Ian Bicking
    Ian Bicking
    2003-11-04

    Logged In: YES
    user_id=210337

    Fixed in CVS.

     
  • Ian Bicking
    Ian Bicking
    2003-11-04

    • status: open --> closed-fixed