Hmmm, seems the "set nocount on" trick now causes problems on deletes:
ConcurrentModificationError is thrown because "Updated rowcount -1
does not match number of objects updated 1".
Which seems strange because I thought rowcount -1 simply meant that
the count cannot be determined, not that there is something wrong.
There seems to be a supports_sane_rowcount check (for MySQL according
to the docs), wouldn't it make sense to treat a rowcount of -1 the
same?
Or should one just never use "set nocount on" when using the orm
(which would mean back to the original problem)?

Steven

On Mar 7, 5:28 pm, "polaar" <[EMAIL PROTECTED]> wrote:
> On Mar 7, 3:29 pm, Tim Golden <[EMAIL PROTECTED]> wrote:
>
>
>
> > <code>
> > from sqlalchemy import *
> > metadata = BoundMetaData ("mssql://VODEV1/TimHolding")
> > test = Table ("test", metadata, autoload=True)
> > result = test.insert ().execute (code = "ABC")
> > print result.last_inserted_ids ()
> > # => [1]
> > </code>
>
> > which is what I expected. If I explicitly set NOCOUNT OFF
> > for my session (in case it's on by default) using:
>
> >    metadata.engine.raw_connection ().execute ("SET NOCOUNT OFF")
>
> > then it still works.
>
> > Is my case the situation you're describing? Or have I
> > misunderstood somthing?
>
> My fault: I forgot to tell you that I was using a mapped class, and
> it's the sqlalchemy-generated 'select @@identity' that causes the
> problem. (you can see that it does that in the log output)


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

Reply via email to