Dear All,
XTA (XA Transaction API,
http://www.tiian.org/lixa/XTA.html)
is a new API that has been developed inside the LIXA project to support
two phase commit transactions in the context of FaaS (Function as a
Service) and microservice oriented, polyglot applications.
The API already supports C and C++ languages; it aims to support many more, at the bare minimum Python, PHP and Java.
I'm currently working on supporting Python with PostgreSQL and MySQL, this mail thread is related to Python/MySQL.
XTA
is implemented in C language and XTA for Python is generated using
SWIG: I would like to repeat the approach for all the languages that
provides drivers derived from MySQL C API
# initialize XTA environment
Xta_Init()
# create a new MySQL connection
# Note: using _mysql or MySQLdb functions
rm2 = MySQLdb.connect("localhost", "lixa", "", "lixa")
or
rm2 = _mysql.connect("localhost", "lixa", "", "lixa")
# create a new XTA Transaction Manager object
tm = TransactionManager()
# create an XA resource for MySQL
#
# how to retrieve MYSQL * from rm2 ?
xar2 = MysqlXaResource(rm2.???, "PostgreSQL", "dbname=testdb")
Looking at the last statement, the stack is:
- XTA native C library expects "MYSQL *" to register the connection handler
- XTA C++ wrapper expects "MYSQL *" as the first parameter to construct the object
- _mysql.connect() and MySQLdb.connect() do not provide me something equivalent to MYSQL *, at least it seems so to me.
Thanks in advance for your help.Regards,
Ch.F.