On Jun 27, 8:24 pm, "Uwe C. Schroeder" <[EMAIL PROTECTED]> wrote:
>
> And on that note: if you're using SA with TG, SA issues a rollback on every
> transaction that is not an insert or update. So if you're having a stored
> procedure (which you trigger with "select * from stored_proc()" and that
> stored procedure actually does updates or inserts, you're going to lose
> changes - simply because SA issues a rollback on Select statements.
this issue can be worked around by using explicit transactions. i
also have a notion of SQL functions being marked as "transactional" to
help this issue. but this thread so far seems to be about the notion
of an entire request being marked as "transactional", which as it
turns out is a central concept of J2EE and others, which would also
eliminate the issue youre having.
> Quick fix for this is to modify SA to just issue a commit on every statement,
> so the TG transaction can roll back or commit without being affected. IMHO
> issuing a commit on a select shouldn't be more overhead than issuing a
> rollback - because the db should know what to do (in this case nothing)
this would be something that would need to be benchmarked. i do think
it would add some overhead. but beyond that, i dont like the idea of
unnecessary COMMITs for every SELECT statement at all.
>
> Maybe something to think about too, because I can't be the only one making
> heavy use of stored procedures (which are far more efficient than
> controller/model side code)
that a stored-procedure-oriented application is "far more efficient"
is *extremely* debatable and database-dependent as well. if you
really want COMMIT for every SELECT, i'd favor it being enabled via an
option passed to create_engine(). Beyond that I think the "model
implemented as stored procedure" style of development is much in the
minority these days, particularly within the "lightweight/open-source"
development community. just that the stored procedure changes the
semantics of SELECT to be a "write" operation reminds me of the
RESTful sin of using GET to post data.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pylons-discuss" 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/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---