Comments (9)
@MathMagique thanks for your comments! The ffodbc project is pretty much a hobby project to help me figure out how ODBC works, and how to get more speed out of it. Then I found turbodbc ;) would indeed be awesome if it would just work with pypy!
from turbodbc.
@keitherskine You understood the issue correctly, and I agree a core dump is not what you want to see ;-). And you could not catch it in the Python code (except for manually rolling back to avoid the issue altogether). That's the state with turbodbc<=1.0.1
.
In the upcoming release (and indeed the current status here at GitHub), turbodbc does the rollback you requested and as I have written above.
The fixes I did for #21 (just about an hour ago) should avoid similar errors in the future for situations when the server closes the connection abruptly etc.
So all in all: just wait for turbodbc 1.02 to come out (probably this weekend).
from turbodbc.
Just as a note for future argonauts crossing this sea, I had the same problem with pypyodbc.
Adding connection.rollback() solved the problem.
from turbodbc.
Hi Dirk! Weird how databases and database drivers behave differently; I have never seen such behavior with other databases. I will think about how best to avoid this issue as soon as I add automated tests for MSSQL (which will be soon).
One option could be to do a rollback
whenever a connection with uncommitted operations is closed. Another option would be to offer an autocommit
option as requested in #41.
from turbodbc.
Btw: I just had a look at your ffodbc project and your goal to be compatible with pypy. Turbodbc uses pybind11 for its Python bindings. The pybind11 developers are working on pypy support (see their issue pybind/pybind11#596), so when this lands, turbodbc should support pypy as well.
from turbodbc.
I just realized the terminate called
part. I think it would be sensible (for now) to raise an exception, but it should not terminate. That sounds like a bug.
from turbodbc.
This bug was caused by the connection being closed while there were still open transactions. While closing the connection, MSSQL complained about this. This lead to exceptions being thrown in C++ destructors, which (as of C++11) have an invisible noexcept
specification by default. This lead to the calls to terminate()
.
The issue is resolved by doing a rollback before disconnecting. This is safe because anything that was committed before is not affected by a subsequent rollback.
The issue was not spotted earlier because Exasol, MySQL, and PostgreSQL (my tested databases) all perform implicit rollbacks when closing connections with open transactions.
from turbodbc.
If I understand this issue correctly, and I've run a test, even if I wrap an exception handler around @dirkjonker 's test code, I'm getting a core dump. That's not good. I'm not sure how that can be trapped and handled in client code.
It would be nice if MS SQL rolled back any open transactions before disconnecting, but apparently it doesn't. So it would be very helpful indeed if turbodbc did a rollback before disconnecting anyway, just in case. (Unless this is being fixed by #21 ?)
from turbodbc.
Great! Many thanks!
from turbodbc.
Related Issues (20)
- can support jdbc? HOT 1
- ODBC error when trying to insert long string to MS SQL database HOT 1
- pip install fails on Python 3.11 HOT 2
- Encountered error while trying to install package turbodbc HOT 1
- Add support for pyarrow 10.0 HOT 2
- Store Procedures should return multiple result sets HOT 3
- Earthly testing failing on all combinations HOT 1
- Install/build error on MacOS 13.0.1 in Python 3.8.15 with pyarrow-10.0.1 but pyarrow-9.0.0 works HOT 13
- Azure SQL - Fractional second precision exceeds the scale specified in the parameter binding
- Not detecting installed numpy after installing turbodbc 4.5.6 with Python 3.11 HOT 1
- Arrow support doesn't work in 3.10 with pyarrow-9.0.0/10.0.1 on Ubuntu 22.04
- 4..5.10 produces ImportError with pyarrow-11.0.0 and Python 3.10 on Linux-x86_64 HOT 4
- Issues Parsing Multiple Result Sets HOT 2
- To build turbodbc with arrow support with pyarrow 12.0.0
- Add pyarrow 12.0.0 support
- How to set pre-connect connection attributes? HOT 1
- Advanced use: Arrow 'double' type as supported dtype -> is not a pyarrow dtype? HOT 1
- Using more than 2 threads
- How to deal with Snowflake string length reporting HOT 2
- turbodbc does not play well with poetry HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from turbodbc.