#3702: ado_mssql Introspection module
---------------------------------+------------------------------------------
Reporter: [EMAIL PROTECTED] | Owner: adrian
Status: new | Component: Database wrapper
Version: SVN | Resolution:
Keywords: ado_mssql mssql | Stage: Unreviewed
Has_patch: 1 | Needs_docs: 0
Needs_tests: 0 | Needs_better_patch: 0
---------------------------------+------------------------------------------
Comment (by [EMAIL PROTECTED]):
I just tried to use this today to do some testing on a rather large
database with a lot of tables.
I am using Python 2.5.1, Django 0.96 release, adodbapi 2.0.1, and pywin32
build 210 on Windows XP Pro SP2 connecting to SQL Server 2000 SP4 (whew
that is a lot of components).
I suspect that the error is not related to Django or this patch, but to
the adodbapi or pywin32 components. It appears that it is trying to
execute multiple statements inside of a single transaction, which MS SQL
server doesn't support.
Here is the output.
{{{
# This is an auto-generated Django model module.
# You'll have to do the following manually to clean this up:
# * Rearrange models' order
# * Make sure each model has one field with primary_key=True
# Feel free to rename the models, but don't rename db_table values or
field names.
#
# Also note: You'll have to insert the output of 'django-admin.py
sqlcustom [appname]'
# into your database.
from django.db import models
class ActionObjectPermissions(models.Model):
Traceback (most recent call last):
File "manage.py", line 11, in <module>
execute_manager(settings)
File "c:\python25\Lib\site-packages\django\core\management.py", line
1672, in execute_manager
execute_from_command_line(action_mapping, argv)
File "c:\python25\Lib\site-packages\django\core\management.py", line
1574, in execute_from_command_line
for line in action_mapping[action]():
File "c:\python25\Lib\site-packages\django\core\management.py", line
844, in inspectdb
relations = introspection_module.get_relations(cursor, table_name)
File "c:\python25\lib\site-
packages\django\db\backends\ado_mssql\introspection.py", line 27, in
get_relations
my_field_dict = _name_to_index(cursor, table_name)
File "c:\python25\lib\site-
packages\django\db\backends\ado_mssql\introspection.py", line 20, in
_name_to_index
return dict([(d[0], i) for i, d in
enumerate(get_table_description(cursor, table_name))])
File "c:\python25\lib\site-
packages\django\db\backends\ado_mssql\introspection.py", line 12, in
get_table_description
cursor.execute("SELECT TOP 1 * FROM %s" % table_name)
File "c:\python25\lib\site-packages\django\db\backends\util.py", line
12, in execute
return self.cursor.execute(sql, params)
File "c:\python25\Lib\site-packages\adodbapi\adodbapi.py", line 592, in
execute
self.executeHelper(operation,0,parameters)
File "c:\python25\Lib\site-packages\adodbapi\adodbapi.py", line 552, in
executeHelper
self._raiseCursorError(DatabaseError,tracebackhistory)
File "c:\python25\Lib\site-packages\adodbapi\adodbapi.py", line 407, in
_raiseCursorError
eh(self.conn,self,errorclass,errorvalue)
File "c:\python25\Lib\site-packages\adodbapi\adodbapi.py", line 38, in
standardErrorHandler
raise errorclass(errorvalue)
adodbapi.adodbapi.DatabaseError:
-----------
Strategy 1: Traceback:Traceback (most recent call last):
File "c:\python25\Lib\site-packages\adodbapi\adodbapi.py", line 540, in
executeHelper
adoRetVal=self.cmd.Execute()
File "<COMObject ADODB.Command>", line 3, in Execute
File "C:\Python25\lib\site-packages\win32com\client\dynamic.py", line
258, in _ApplyTypes_
result = self._oleobj_.InvokeTypes(*(dispid, LCID, wFlags, retType,
argTypes) + args)
com_error: (-2147352567, 'Exception occurred.', (0, 'Microsoft OLE DB
Provider for SQL Server', 'Cannot create new connection because in manual
or distributed transaction mode.', None, 0, -2147467259), None)
-----------
Strategy 2: Traceback:Traceback (most recent call last):
File "c:\python25\Lib\site-packages\adodbapi\adodbapi.py", line 540, in
executeHelper
adoRetVal=self.cmd.Execute()
File "<COMObject ADODB.Command>", line 3, in Execute
File "C:\Python25\lib\site-packages\win32com\client\dynamic.py", line
258, in _ApplyTypes_
result = self._oleobj_.InvokeTypes(*(dispid, LCID, wFlags, retType,
argTypes) + args)
com_error: (-2147352567, 'Exception occurred.', (0, 'Microsoft OLE DB
Provider for SQL Server', 'Cannot create new connection because in manual
or distributed transaction mode.', None, 0, -2147467259), None)
-----------
Strategy 3: Traceback:Traceback (most recent call last):
File "c:\python25\Lib\site-packages\adodbapi\adodbapi.py", line 540, in
executeHelper
adoRetVal=self.cmd.Execute()
File "<COMObject ADODB.Command>", line 3, in Execute
File "C:\Python25\lib\site-packages\win32com\client\dynamic.py", line
258, in _ApplyTypes_
result = self._oleobj_.InvokeTypes(*(dispid, LCID, wFlags, retType,
argTypes) + args)
com_error: (-2147352567, 'Exception occurred.', (0, 'Microsoft OLE DB
Provider for SQL Server', 'Cannot create new connection because in manual
or distributed transaction mode.', None, 0, -2147467259), None)
-----------
Strategy 4: Traceback:Traceback (most recent call last):
File "c:\python25\Lib\site-packages\adodbapi\adodbapi.py", line 540, in
executeHelper
adoRetVal=self.cmd.Execute()
File "<COMObject ADODB.Command>", line 3, in Execute
File "C:\Python25\lib\site-packages\win32com\client\dynamic.py", line
258, in _ApplyTypes_
result = self._oleobj_.InvokeTypes(*(dispid, LCID, wFlags, retType,
argTypes) + args)
com_error: (-2147352567, 'Exception occurred.', (0, 'Microsoft OLE DB
Provider for SQL Server', 'Cannot create new connection because in manual
or distributed transaction mode.', None, 0, -2147467259), None)
--- ADODBAPI on command:SELECT TOP 1 * FROM Action_Object_Permissions with
parameters: ()
}}}
--
Ticket URL: <http://code.djangoproject.com/ticket/3702#comment:3>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" 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/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---