Code Monkey home page Code Monkey logo

Comments (5)

mindplay-dk avatar mindplay-dk commented on August 23, 2024

You ever look at this? Just wondering.

from aura.sql.

pmjones avatar pmjones commented on August 23, 2024

(/me furrows brow) I recall looking at it, and thought I commented on closing it. I recall my comment being along the lines of, "Do the underlying engine support nested transaction natively? Do they permit rolling back to the last sub-transaction?" (I recall having other notes, but not what they were.)

from aura.sql.

mindplay-dk avatar mindplay-dk commented on August 23, 2024

Do the underlying engine support nested transaction natively?

They don't, or at least MySQL doesn't - that's sort of the point; it counts the transaction level, so that calls to transact(), during a previous call to transact(), does not lead to early commits. All nested calls to transact() need to succeed (return true) in order for the transaction to commit.

The main point though, is to achieve transaction semantics - as opposed to manually having to check conditions and call commit or rollback, potentially breaking semantics (by forgetting to commit or rollback) or forgetting to manually check inTransaction(), etc... That stuff gets wonky.

I've been doing it this way for a long time, on lots of projects, and it saved me a lot of headache.

from aura.sql.

pmjones avatar pmjones commented on August 23, 2024

They don't, or at least MySQL doesn't

(/me nods)

So SAVEPOINT and RELEASE (etc) don't quite do the trick for you? A brief googling revealed support in mysql, sqlite, pgsql, and sql server, though I don't know how recently.

from aura.sql.

mindplay-dk avatar mindplay-dk commented on August 23, 2024

AFAIK, in MySql this is supported by INNO only, but yes - you could use
that for sub transactions where available maybe, though that would give it
a very different meaning depending on the database.

I've never personally needed savepoints. I need transactions all the time,
and I don't like the non-transactional API most database APIs provide, so I
usually add in something like this. YMMV.
On Jun 2, 2015 11:19 PM, "Paul M. Jones" [email protected] wrote:

They don't, or at least MySQL doesn't

(/me nods)

So SAVEPOINT and RELEASE (etc) don't quite do the trick for you? A brief
googling revealed support in mysql, sqlite, pgsql, and sql server, though I
don't know how recently.


Reply to this email directly or view it on GitHub
#66 (comment).

from aura.sql.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.