On Monday, 24 June 2013 22:58:36 UTC-7, ucs wrote:
>
>   
>
> I have and do.
>
> This are my experiences for an now outdated version of SA (3.6), so your 
> mileage may vary. I'll get to the newer versions when I upgrade, but 
> considering nearly half a million lines of code that's probably not going 
> to be any time soon, since it means to rewrite every database query I have.
>
>  
>
> My first issue was the automatic rollback SA issues on statements it 
> considers not changing the database. Something like a 
>
> SELECT * FROM function_changing_the_db()
>
> is rolled back at the end of the statement. That makes sense for regular 
> selects, but not when selecting from a function. So I changed that core 
> function to not issue a rollback, so the changes from the function would 
> persist. If I recall correctly it was the execute method I changed, but I'd 
> have to go to the source to say for sure. Point is, if your stored 
> procedure doesn't store the changes you make, this is the issue (may be 
> fixed these days, I recall some discussion about calling stored procs back 
> in the day. Since it's much later now, this issue may not hit you anymore).
>
>  
>

That's s feature of the transaction integration package zope.sqlalchemy, 
rather than SQLAlchemy itself. It's tripped up several people, it probably 
isn't a sensible default. You don't need to change the core function, 
simply configure the ZopeTransactionExtension with 
``initial_state='changed'`` (example at bottom of docs here: 
https://pypi.python.org/pypi/zope.sqlalchemy.)
 
Laurence

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pylons-discuss+unsubscr...@googlegroups.com.
To post to this group, send email to pylons-discuss@googlegroups.com.
Visit this group at http://groups.google.com/group/pylons-discuss.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to