Randy Syring
unread,May 29, 2009, 2:37:12 AM5/29/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sqlalchemy
I have been having a weird thing happen when using pyodbc with mssql.
The create table statements work, but none of the INSERT statements
do. For example, when I run code and echo, I get this:
(TCSData) F:\Inetpub\TCSData\src\tcsdata-dist\tcsdata>pysmvt broadcast
initapp
calling: action_pysapp_initapp
2009-05-29 02:22:17,194 INFO sqlalchemy.engine.base.Engine.0x...a350
BEGIN
2009-05-29 02:22:17,210 INFO sqlalchemy.engine.base.Engine.0x...a350
INSERT INTO
users_permission (name) VALUES (?); select scope_identity()
2009-05-29 02:22:17,210 INFO sqlalchemy.engine.base.Engine.0x...a350
[u'webapp-c
ontrolpanel']
2009-05-29 02:22:17,210 INFO sqlalchemy.engine.base.Engine.0x...a350
COMMIT
But there is nothing in that table when I am done committing. I
profiled the server, and here is the code sequence that it shows:
set implicit_transactions on
exec sp_datatype_info 93, @ODBCVer = 3
SET IMPLICIT_TRANSACTIONS OFF
BEGIN TRANSACTION
declare @P1 int
set @P1=1
exec sp_prepexec @P1 output, N'@P1 nvarchar(19)', N'INSERT INTO
users_permission (name) VALUES (@P1); select scope_identity()',
N'webapp-controlpanel'
select @P1
exec sp_unprepare 1
IF @@TRANCOUNT > 0 COMMIT TRAN
If is switch to adodbapi, then the insert works just fine.