Hi all,
Has anybody recognized/tackled the issue of trying to run database
transactions when a "get satchmo configuration" call is involved? We
have a rather complex fulfillment procedure and because
satchmo.configuration.models._safe_get_siteid (version 0.8) does a
commit it means we can't use db transactions in a procedural way (i.e.
I don't expect side-effects from "get" operations). This seems flawed
yet I would expect some reaction from the community, so wonder if
there is a known workaround.

We're still using 0.8 but I recognize the problem still exists in
livesettings on trunk (please don't recommend upgrading - of course we
have our reasons :) Below is a very simple example of what we're
trying to deal with (in pseudocode):

@transaction.commit_manually
function fulfill_order:
    try:
        prepare order (with db changes)
        attempt CC capture through satchmo payment module
        update order (with db changes)
        commit
        return happy page
    except:
        rollback
        return angry page

The commit occurs with every attempt to get config (and thus calls
_safe_get_siteid), so I can't rely on my rollback to be effective -
changes have already been committed before the exception is handled.

So, any thoughts/solutions/suggestions?

Thanks,
 -rob

-- 
You received this message because you are subscribed to the Google Groups 
"Satchmo users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/satchmo-users?hl=en.

Reply via email to