Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serializable Isolation level for SQLite Databases #4536

Closed
ClaudeTO80 opened this issue Apr 22, 2024 · 2 comments · Fixed by #4693
Closed

Serializable Isolation level for SQLite Databases #4536

ClaudeTO80 opened this issue Apr 22, 2024 · 2 comments · Fixed by #4693

Comments

@ClaudeTO80
Copy link

Hi all.

I am working on a personal project using DB connection both to SQLite and PostgreSQL. Due to nature of some insert statements, serializable transactions are required.

As far as I understood by reading Poco source code, PostgreSQL session implementation handles all kinds of transactions, while SQLite session implementation handles only Read committed one.
Moreover I read SQLite project documentation and it seems (if I didn't misunderstood) that SQLite handles serializable transactions if proper compile-time and run-time options are used.

I was wondering:

  1. if limitations to SQLite transactions in Poco library are due to historical or security reasons
  2. should it be possible handling all types of transactions in SQLite session implementation?

Thanks in advance.
Best things.

@aleks-f
Copy link
Member

aleks-f commented May 13, 2024

As far as I can remember, the reason for weaker transaction support in SQLite is because nobody so far had a need for those. I see no reason why it shouldn't be supported, but I can't promise when that would be done; you can do the work yourself and send pul request.

bas524 added a commit to bas524/poco that referenced this issue Jun 7, 2024
I've add transaction isolation support for SQLite
Warning! SQLite transactions are [serializable by design](https://
www.sqlite.org/isolation.html) but my implementation retuns false in
function hasTransactionIsolation and throw an exception in
setTransactionIsolation
@ClaudeTO80
Copy link
Author

@bas524 Thanks a lot for your reply and support. Close the issue.

@aleks-f aleks-f linked a pull request Sep 15, 2024 that will close this issue
@aleks-f aleks-f added the fixed label Oct 10, 2024
@aleks-f aleks-f added this to 1.14 Oct 10, 2024
@aleks-f aleks-f added this to the Release 1.14.0 milestone Oct 10, 2024
aleks-f added a commit that referenced this issue Oct 10, 2024
* fix #4536
I've add transaction isolation support for SQLite
Warning! SQLite transactions are [serializable by design](https://
www.sqlite.org/isolation.html) but my implementation retuns false in
function hasTransactionIsolation and throw an exception in
setTransactionIsolation

* disable shared cache in TearDown()

* chore(doc): reword documentation

* we should waitresult of select before rollback (#4718)

---------

Co-authored-by: Alexander B <ale.bychuk@gmail.com>
@matejk matejk moved this to Done in 1.14 Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants