OpenInformix / IfxPy

Informix native Python driver for scalable enterprise and IoT solutions.
Other
46 stars 22 forks source link

Getting error on calling commit() method #70

Open parthiv11 opened 2 years ago

parthiv11 commented 2 years ago
>>> con.commit()
Exception: [OneDB][OneDB ODBC Driver]Driver not capable. SQLCODE=-11092

The above exception was the direct cause of the following exception:
Traceback (most recent call last):
    return_value = IfxPy.commit(self.conn_handler)
SystemError: <built-in function commit> returned a result with an error set

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\UserName\AppData\Local\Programs\Python\Python37\lib\site-packages\IfxPyDbi.py", line 573, in commit
    raise _get_exception(inst)
IfxPyDbi.Error: IfxPyDbi::Error: SystemError('<built-in function commit> returned a result with an error set')

Help me please to solve this..

jsagrera commented 2 years ago

Did you create the database with logging (e.g., "create database test with log")? Any transaction op (like commit) will fail if you are connected to a non-logged database

parthiv11 commented 2 years ago

@jsagrera can i found if current database is logged or not by using ifxpy

jsagrera commented 2 years ago

You can run the following SQL:

> select name,is_logging,is_buff_log from sysmaster:sysdatabases where name='stores7';

name         stores7
is_logging   1
is_buff_log  0

1 row(s) retrieved.

>
parthiv11 commented 2 years ago

is there any direct method/function in ifxpy

jsagrera commented 2 years ago

An Informix database needs to have logging to be able to support transactions. You can change the mode (logging) of the database with the ondblog command (but will require a backup). More info here: https://www.ibm.com/support/pages/how-change-database-logging-mode-using-ondblog-command

parthiv11 commented 2 years ago

Ok thank you so much sir @jsagrera

parthiv11 commented 2 years ago

@jsagrera why InformixAlchemy is not publish on Pypi ??

jsagrera commented 2 years ago

I guess because it is still on the "development" phase.