Обсуждение: Re: PostgreSQL+ (Beta) and Active Server Pages with @TRANSACTION=REQUIRED

Поиск
Список
Период
Сортировка

Re: PostgreSQL+ (Beta) and Active Server Pages with @TRANSACTION=REQUIRED

От
Chris Gamache
Дата:
A person by the name of Eric was trying to encapsulate an ODBC connection in a
COM+ object (see thread "psqlODBC driver and COM+"

http://groups.google.com/groups?q=%22Unknown+connect+option+(Set)%22&hl=en&lr=lang_en&ie=UTF-8&oe=UTF-8&safe=off&selm=21a671cb.0205281138.1da6cb56%40posting.google.com&rnum=2
)

He did a trace and was on to something with SQL_ATTR_ENLIST_IN_DTC. Of course
we know that PostgreSQL doesn't support Distributed Transactions... Would it be
possible to just plug the hole up and make that staticly set to not enlist the
connection in DTC? I think that would get us one step closer to being able to
plug PostgreSQL into COM+ (be it MTS or whatever) ...

I'm nearly positive that MTS (and COM+ for that matter) _does_ provide a way to
work with non-distributed transactions. Why else would MS Access and other
inflexible database technologies work within MTS?

CG


--- Hiroshi Inoue <Inoue@tpf.co.jp> wrote:
>
> Maybe MTS requires Distributed transaction support but
> PostgreSQL(and of cource psqlodbc driver) doesn't support it.
> I'm not sure if MTS provides the option to work with non-
> distributed system.
>
> regards,
> Hiroshi Inoue
>     http://w2422.nsk.ne.jp/~inoue/


__________________________________________________
Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos & More
http://faith.yahoo.com

Unknown Connect Option (Set)

От
Chris Gamache
Дата:
Still can't find a way to create an ODBC database connection within an MTS
Transaction... Been digging deeper: Here's a sample connection from the
psqlodbc-100.log. I can provide a sample connection from the debug log, but it
is much more detailed and as a result quite a bit longer, and I don't think it
contains information that is any more useful than the regular log.

--[snip...]--
Global Options: Version='07.02.0001', fetch=100, socket=4096, unknown_sizes=0,
m
ax_varchar_size=254, max_longvarchar_size=8190
                disable_optimizer=1, ksqo=1, unique_index=1, use_declarefetch=1
                text_as_longvarchar=1, unknowns_as_longvarchar=0,
bools_as_char=
1
                extra_systable_prefixes='dd_', conn_settings=''
conn_encoding='O
THER'
conn=33947712, query=' '
conn=33947712, query='set DateStyle to 'ISO''
conn=33947712, query='set geqo to 'OFF''
conn=33947712, query='set ksqo to 'ON''
conn=33947712, query='BEGIN'
conn=33947712, query='declare SQL_CUR01DA0770 cursor for select oid from
pg_type
 where typname='lo''
conn=33947712, query='fetch 100 in SQL_CUR01DA0770'
    [ fetched 0 rows ]
conn=33947712, query='close SQL_CUR01DA0770'
conn=33947712, query='COMMIT'
conn=33947712, query='BEGIN'
conn=33947712, query='declare SQL_CUR01DA0770 cursor for select version()'
conn=33947712, query='fetch 100 in SQL_CUR01DA0770'
    [ fetched 1 rows ]
    [ PostgreSQL version string = 'PostgreSQL 7.2.1 on i686-pc-linux-gnu,
compiled by GCC egcs-2.91.66' ]
    [ PostgreSQL version number = '7.2' ]
conn=33947712, query='close SQL_CUR01DA0770'
conn=33947712, query='COMMIT'
conn=33947712, query='select pg_client_encoding()'
    [ fetched 1 rows ]
    [ Client encoding = 'SQL_ASCII' (code = 0) ]
conn=33947712, PGAPI_DriverConnect(out)='DRIVER={PostgreSQL+
(Beta)};DATABASE=et
c;SERVER=10.10.0.1;PORT=5432;UID=user;PWD=pass;ReadOnly=0;Protocol=6.4;F
akeOidIndex=0;ShowOidColumn=0;RowVersioning=0;ShowSystemTables=0;ConnSettings=;F
etch=100;Socket=4096;UnknownSizes=0;MaxVarcharSize=254;MaxLongVarcharSize=8190;D
ebug=1;CommLog=1;Optimizer=1;Ksqo=1;UseDeclareFetch=1;TextAsLongVarchar=1;Unknow
nsAsLongVarchar=0;BoolsAsChar=1;Parse=0;CancelAsFreeStmt=0;ExtraSysTablePrefixes
=dd_;LFConversion=1;UpdatableCursors=1;DisallowPremature=0;TrueIsMinus1=0'
CONN ERROR: func=PGAPI_SetConnectOption, desc='fOption=1207, vParam=124387564',
errnum=205, errmsg='Unknown connect option (Set)'
            ------------------------------------------------------------
            henv=31068000, conn=33947712, status=1, num_stmts=16
            sock=31067936, stmts=31067856, lobj_type=-999
            ---------------- Socket Info -------------------------------
            socket=1216, reverse=0, errornumber=0, errormsg='(NULL)'
            buffer_in=34082824, buffer_out=31026544
            buffer_filled_in=63, buffer_filled_out=0, buffer_read_in=63
conn=33947712, PGAPI_Disconnect
--[\snip...]--

The problem occurs in PGAPI_SetConnectOption ... I've looked at that routine in
options.c, and it seems like its receiving an fOption that it doesn't
understand:

It has the choice of
 SQL_ASYNC_ENABLE:
 SQL_BIND_TYPE:
 SQL_CONCURRENCY:
 SQL_CURSOR_TYPE:
 SQL_KEYSET_SIZE:
 SQL_MAX_LENGTH:
 SQL_MAX_ROWS:
 SQL_NOSCAN:
 SQL_QUERY_TIMEOUT:
 SQL_RETRIEVE_DATA:
 SQL_ROWSET_SIZE:
 SQL_SIMULATE_CURSOR:
 SQL_USE_BOOKMARKS:
 SQL_ACCESS_MODE:    /* ignored */
 SQL_AUTOCOMMIT:
 SQL_CURRENT_QUALIFIER:        /* ignored */
 SQL_LOGIN_TIMEOUT:    /* ignored */
 SQL_PACKET_SIZE:    /* ignored */
 SQL_QUIET_MODE:    /* ignored */
 SQL_TXN_ISOLATION:    /* ignored */
 SQL_ODBC_CURSORS:
 SQL_OPT_TRACE:
 SQL_OPT_TRACEFILE:
 SQL_TRANSLATE_DLL:
 SQL_TRANSLATE_OPTION:

and of course...
 default:

which gives that error... the culprit is fOption = 1207 which is an unknown
option... I have no idea what that maps to since its not in the isqlext.h file!
So! How can we (safely?) allow that option while connecting without crashing
the odbc driver. What is that option? How would we find out?

CG

__________________________________________________
Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos & More
http://faith.yahoo.com

Re: Unknown Connect Option (Set)

От
Hiroshi Inoue
Дата:
Chris Gamache wrote:
>
> Still can't find a way to create an ODBC database connection
> within an MTS Transaction... Been digging deeper: Here's a
> sample connection from the psqlodbc-100.log. I can provide a
> sample connection from the debug log, but it is much more
> detailed and as a result quite a bit longer, and I don't think it
> contains information that is any more useful than the regular log.

[snip]

> which gives that error... the culprit is fOption = 1207 which
> is an unknown option... I have no idea what that maps to since
> its not in the isqlext.h file!

isqlext.h isn't used under Windows and 1207 is
SQL_ATTR_ENLIST_IN_DTC. Unfortunately I have little
time to examine how to manage your situation.
How about changing from @TRANSACTION=REQUIRED to
@TRANSACTION=SUPPORTED ?

regards,
Hiroshi Inoue
    http://w2422.nsk.ne.jp/~inoue/

Re: Unknown Connect Option (Set)

От
Chris Gamache
Дата:
--- Hiroshi Inoue <Inoue@tpf.co.jp> wrote:

> isqlext.h isn't used under Windows and 1207 is
> SQL_ATTR_ENLIST_IN_DTC. Unfortunately I have little
> time to examine how to manage your situation.
> How about changing from @TRANSACTION=REQUIRED to
> @TRANSACTION=SUPPORTED ?

I understand about not being able to spend time on this issue. You've given me
a bit more information to go on. I can start doing some frankenstein mods to
the code now that I understand about SQL_ATTR_ENLIST_IN_DTC. Am I correct in
guessing that there's a resource that lists all the things an ODBC driver
could/should support (and that's how you knew that 1207 was
SQL_ATTR_ENLIST_IN_DTC)... Where would that be?

As for changing @TRANSACTION=REQUIRED to @TRANSACTION=SUPPORTED, that allows
the script to function, but it won't run in an MTS transaction. Rats! :)

CG


__________________________________________________
Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos & More
http://faith.yahoo.com