Coder Social home page Coder Social logo

[dev2.0] Transactions about npoco HOT 9 CLOSED

zii-dmg avatar zii-dmg commented on August 20, 2024
[dev2.0] Transactions

from npoco.

Comments (9)

DejanMilicic avatar DejanMilicic commented on August 20, 2024

Begin/Completed are very handy when you implement Unit of Work pattern. Besides, it is bad practice to introduce breaking changes. And finally, good documentation is most important thing.

from npoco.

zii-dmg avatar zii-dmg commented on August 20, 2024

And what is difference between BeginTransaction/CompleteTransaction and Database.GetTransaction/Transaction.Complete for unit of work pattern (as Transaction wrapper use these methods inside)?

from npoco.

DejanMilicic avatar DejanMilicic commented on August 20, 2024

Nothing. That is the whole point. Breaking changes on one hand. What is on the other hand besides nitpicking?

from npoco.

zii-dmg avatar zii-dmg commented on August 20, 2024

Sorry but only nitpicking and no redundancy.

from npoco.

schotime avatar schotime commented on August 20, 2024

BeginTransaction/Complete/Abort need to be there when you can't directly surround the code with a using block etc.
I don't think it is an issue.

from npoco.

zii-dmg avatar zii-dmg commented on August 20, 2024

But you can use Transaction wrapper without "using block":

  • Database.GetTransaction = Database.BeginTransaction
  • Transaction.Complete = Database.CompleteTransaction
  • Transaction.Dispose = Database.AbortTransaction

It is 1-to-1 mapping + "using" if can/needed.

from npoco.

schotime avatar schotime commented on August 20, 2024

True, however then I would have to store the transaction object somewhere as well as the database object.

from npoco.

zii-dmg avatar zii-dmg commented on August 20, 2024

Partially true because you already have BaseTransaction property for this which not long ago was public.

from npoco.

schotime avatar schotime commented on August 20, 2024

BaseTransaction was not for this (was used to manage nested transactions). This has now as you have mentioned been made internal.

from npoco.

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.