Revise MSDTC support.
authorHiroshi Inoue <inoue@tpf.co.p>
Fri, 21 Jun 2013 04:09:06 +0000 (13:09 +0900)
committerHiroshi Inoue <inoue@tpf.co.p>
Wed, 10 Jul 2013 14:28:14 +0000 (23:28 +0900)
commit9fd39495580ada6ff7d989d19fa9f83ed3b2c82e
treef07ca5fa488f0af68391f80a26d39946fdd1fd27
parent61d8cf283e73bd08d10785de03be2fce75fcda1a
Revise MSDTC support.
1. Remove pointlessly complicated AsyncThreads stuff. Instead use
   _beginthread() to clean up threads.
2. Make pgenlist.dll from the structure change of ConnectionClass.
   The driver dlls exports the functions described in connexp.h
   which are used by pgenlist.dll.

3. Isolate the current communication path if necessary.
   While an IAsyncPG object is alive, a ConnectionClass object (hereinafter
   refered to as conn-obj) is assigned to it. The assignment has to be
   changed in the following cases.

   a) SQLDisconnect() is called for the current connection handle which
      is assigned to an IAsyncPG object.
Allocate another conn-obj and move the current communication
path (*sock* member of the current conn-obj) to the new conn-obj.
The communicaation path is lost from the current conn-obj and
the new conn-obj is assigned to the IAsyncPG object.

   b) Another (global) transaction is about to begin but the current
      global transaction is not PREPARED yet.
Same as case a) but will open a new communication path for
the current conn-obj for the subsequent ODBC API calls.

   c) Another (global) transaction is about to begin and the current
      global transaction is already PREPARED.
Allocate another conn-obj and open a new communication path for
the conn-obj. The new conn-obj is assigned to the IAsyncPG
object only to issue COMMIT/ROLLBACK PREPARED command.

   communication pass (*sock* member of the current ConnectionClass
   object) to the new object and change the state of the current
   object NOT CONNECTED. The IAsyncPG object uses new object instead
   of the current object. In case b) the current object will open a
   new communication path.
32 files changed:
connection.c
connection.h
connexp.h [new file with mode: 0755]
convert.c
dlg_specific.c
dlg_wingui.c
drvconn.c
environ.c
inouealc.c
loadlib.c
loadlib.h
misc.c
misc.h
msdtc_enlist.cpp
mylog.c
mylog.h [new file with mode: 0755]
odbcapi.c
odbcapi30.c
odbcapi30w.c
odbcapiw.c
options.c
pgapi30.c
pgenlist.def
pgenlist.h
pgenlista.def
psqlodbc.def
psqlodbc.h
psqlodbca.def
results.c
setup.c
socket.c
statement.c