On Aug 1, 2009, at 1:16 PM, Miguel Lopes wrote:
> I know that the Form.save() method asks the bizobj to save.
> And the bizobj as a save method that gets a startTransaction argument.
>
> We are not suppose to override Bizobj.save(), at the cost of loosing
> the hook methods (unless we reconstruct them). So how can we do a
> transaction?
>
> I'm also aware of bizobj.beginTransaction, commitTransaction and
> rollbackTransaction. But where are these to be called? Certainly not
> in bizobj.save!?
The transaction details are handled differently for each different
backend, but the basic behavior is that the first bizobj to be
involved in the save starts and ends the transaction automatically
without you having to code anything.
> How can we deal with multiple tables commits?
I assume that by this you mean multiple *unrelated* tables? Because
related tables are handled as I mentioned above. For unrelated tables,
you would need to create a special method in one of the bizobjs to
manually start the transaction by calling beginTransaction(), and then
call the save of itself and the other bizobjs involved, and then call
the commit/rollback as required.
-- Ed Leafe
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message:
http://leafe.com/archives/byMID/[email protected]