Coding Monks

Coding Monks

Share

This channel is about programming tutorials, problem-solving and practices. Please visit our youtube channel for more tutorials.

https://www.youtube.com/channel/UCjbONC4dqlKuZgXgA7BgxDA?view_as=subscriber

23/08/2023

New freelancer is trying to explain the project to his client. đŸ¤Ŗ

09/08/2023

In fact, the whole Internet is nothing more than a series of Inter-connected networks.

08/08/2023

āĻ—āϤ ā§Š āφāĻ—āĻ¸ā§āϟ, ⧍ā§Ļā§¨ā§Š āϞāĻŋāĻœā§‡āĻ¨ā§āĻĄāĻžāϰāĻŋ āϏāĻĢāϟāĻ“ā§Ÿā§āϝāĻžāϰ āχāĻžā§āϜāĻŋāύāĻŋ⧟āĻžāϰ āĻŦā§āϰāĻžāĻŽ āĻŽā§āϞ⧇āύāĻžāϰ(Bram Moolenaar) āĻŽāĻžāϰāĻž āϝāĻžāύāĨ¤ āϤāĻŋāύāĻŋ āϞāĻŋāύāĻžāĻ•ā§āϏ āϏāĻŋāĻ¸ā§āĻŸā§‡āĻŽā§‡āϰ āϜāύāĻĒā§āϰāĻŋ⧟ āĻāĻĄāĻŋāϟāϰ Vim āĻāϰ āĻ¸ā§āϰāĻˇā§āϟāĻž āĻāĻŦāĻ‚ āĻŽā§‡āχāύāĻŸā§‡āχāύāĻžāϰ āĻ›āĻŋāϞ⧇āύāĨ¤

28/07/2023
22/07/2023

😄

11/01/2023

What is Database Transaction?
Database transaction is a set of queries treated as one unit of work.
Transaction Lifespan:
A transaction begins with BEGIN keyword. It says to the database that you are about to start a new transaction with multiple queries. Then you can write queries (1,2,... whatever you need), and when each query executes successfully and you are satisfied you should commit it by using the COMMIT keyword. This commit tells the database that the changes I have done during the whole lifespan of the transaction, persist these things in the disk.
But things can necessarily go wrong. Maybe one of your queries is not executed properly or you are not satisfied, then you should forget about all the changes you have done before this query during the transaction lifetime. The ROLLBACK helps to undo or roll back all changes.
Two types of database transactions:
Explicit Transaction: You should define the transaction boundary explicitly with BEGIN keyword, and COMMIT after ex*****on. ROLLBACK for unsatisfied cases.
Ex:
BEGIN tx1
Query1â€Ļ.
Query2â€Ļ.
â€Ļâ€Ļ
COMMIT tx1
Or
ROLLBACK tx1
Implicit Transaction: The implicit transaction begins before the statement is executed and ends (commit or rollback) after the statement is executed.
Ex:
BEGIN tx1
Query1â€Ļ.
COMMIT tx1
ROLLBACK tx1 (if something is wrong)
BEGIN tx2
Query1â€Ļ.
COMMIT tx2
ROLLBACK tx2 (if something is wrong)
If you run queries without explicitly transaction boundary every time an implicit transaction wraps around every individual statement to save the changes to DB. For example, Alice wants to send $100 to Bob, and your first query deducted $100 from Alice's account successfully, but something went wrong when you tried to credit/update it in Bob’s account. In this scenario, $100 is lost in space (maybe it can handle it in a tricky way), and you should again undo all queries that executed successfully. But with an explicit transaction, until your queries execute successfully and the ex*****on of COMMIT, it won’t save in DB. If get something wrong in the query ex*****on, ROLLBACK will undo everything by itself. There is no need to consider which one has changed or not.
A transaction could change data, or it could be read-only as well.
NB: If you find conceptually wrong something, cordially requested to drop a comment.


Written by: Shrikanta Mazumder

07/12/2021

What is CallBack?
A callback is a function passed as an argument to another function

29/11/2021

Javascript hoisted declarations, but not initializations

Create your own shapes using SwiftUI 31/07/2021

Create your own shapes using SwiftUI Boom! Let's create different kind of shapes that you want using SwiftUI. Here I use xcode 12 and iOS 14 to create this project.I only created three shapes. B...

28/07/2021

SwiftUI comes with a few built-in features for state management. In particular, it introduces a wrapper named . When a property annotates with , SwiftUI automatically stores it somewhere in your app. It listens to the change of the value. When the state changes, SwiftUI will recompute those views and update the application appearance.

Want your school to be the top-listed School/college in Patenga?
Click here to claim your Sponsored Listing.

Telephone

Website

Address


Patenga