question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

allow commit() within run_transaction() callback

See original GitHub issue

Running the following yields psycopg2.InternalError: SAVEPOINT not supported except for COCKROACH_RESTART

I believe this is due to https://github.com/cockroachdb/cockroachdb-python/blob/master/cockroachdb/sqlalchemy/transaction.py#L54.

Why do we need savepoint_state.cockroach_restart? Considering that CockroachDB supports no other savepoint name, why not hard-code it and drop the conditional in the following functions: https://github.com/cockroachdb/cockroachdb-python/blob/master/cockroachdb/sqlalchemy/dialect.py#L158

Steps to reproduce:

docker run -p 26257:26257 cockroachdb/cockroach:v1.0 start --insecure

Then run the following code: https://gist.github.com/gpaul/648189354975992a2c285143d08be88a

This gives the following output using cockroachdb-python v0.1: https://gist.github.com/gpaul/14fa2967c42d4ccf6b223322a7967476

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:17 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
bdarnellcommented, Mar 20, 2018

It’s tracked in the main repo as https://github.com/cockroachdb/cockroach/issues/10735 although it’s not currently on the roadmap.

0reactions
bdarnellcommented, Sep 4, 2019

For django, there has been some movement: see the last few comments on https://github.com/cockroachdb/cockroachdb-python/pull/14

Read more comments on GitHub >

github_iconTop Results From Across the Web

Programming model for runTransaction is hard to use ... - GitHub
We basically assume that whenever commit() or rollback() are called, that you are done with the Transaction. In the event that either of...
Read more >
Transactions and batched writes | Firestore - Firebase - Google
A transaction consists of any number of get() operations followed by any number of write operations ... import { runTransaction } from "firebase/firestore";...
Read more >
Creating a post commit when using transaction in Spring
I have wrote a blog post about transaction synchronization in Spring and how to easily register after commit callbacks azagorneanu.blogspot.com/ ...
Read more >
Transactions - typeorm - GitBook
commit transaction now: await queryRunner.commitTransaction(). } catch (err) {. // since we have errors let's rollback changes we made. await queryRunner.
Read more >
com.google.cloud.firestore.Firestore.runTransaction java code ...
@Test public void failedTransaction() { try { firestore .runTransaction( new Function<String>() { @Override public String updateCallback(Transaction ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found