transactions Questions

5

Solved

How do I prevent such a race condition from occuring? I understand that transactions in Laravel are blocking for updates, but how do I prevent stale data from being used? Is there a way to lock the...
Winglet asked 4/3, 2017 at 7:52

3

Solved

I was wondering what's the default isolation level when using Django with PostgreSQL. Serializable Isolation? (https://www.postgresql.org/docs/9.1/static/transaction-iso.html#XACT-SERIALIZABLE) The...
Beaufert asked 19/2, 2017 at 18:48

4

Solved

I noticed that by default, all updates in the django admin site are done as transactions. I need to either: - turn off transactions (globally or for a particular admin view) - inside of a save()...
Break asked 14/6, 2009 at 14:54

4

Solved

Code examples of Android SQLite transactions that I've seen appear to automatically call db.setTransactionSuccessful() right before db.endTransaction(). I am wondering if that is actually best pra...
Singleaction asked 5/11, 2014 at 11:26

23

Solved

I am currently getting this error: System.Data.SqlClient.SqlException: New transaction is not allowed because there are other threads running in the session. while running this code: public c...
Delagarza asked 21/1, 2010 at 22:37

2

I'm currently playing with transactions in latest available docker image of MongoDB 4.1.4 (using Node 8.12.0 and Mongoose 5.3.8 as client). I've made a simple replica set with 3 mongo instances, ev...
Topsoil asked 5/11, 2018 at 13:31

4

Solved

Say I have multiple workers that can concurrently read and write against a MySQL table (e.g. jobs). The task for each worker is: Find the oldest QUEUED job Set it's status to RUNNING Return the ...
Paradox asked 15/6, 2020 at 18:24

1

I used @transaction.non_atomic_requests for the overridden save() in Person model as shown below: # "store/models.py" from django.db import models from django.db import transaction clas...
Visitor asked 8/12, 2022 at 9:42

3

Solved

I have an activity class that is annotated as a component that calls an action class: @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = NonRetryableException.cla...
Hydrolysis asked 3/8, 2016 at 4:50

2

Is there a way to run the django tests using multiple threads and force the race condition? I want to make sure that the code path that handles the transaction errors is executed. To be slightly mo...
Hexamethylenetetramine asked 23/3, 2014 at 6:38

3

Solved

I have a function, that does multiple queries on the same dataset and I want to ensure all the queries would see exactly the same data. In terms of SQL, this means REPEATABLE READ isolation level ...
Kweiyang asked 20/6, 2015 at 15:31

3

Solved

Consider I have a controller method get() which calls a few service methods working with database. Is it correct to make the entire controller method transactional or just every service method? I...
Changeling asked 16/12, 2010 at 16:7

6

I've tried putting the COMMIT TRAN in a if else loop, and I'm still getting this error. I have to enroll a student in a class. If the number of seats after enrollment falls in negative, I have to...
Majesty asked 25/4, 2014 at 14:32

4

Solved

I have the following scenario. I am using JPA, Spring: @Autowired SampleService service; @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class) public void PerformLogic...
Aorist asked 12/2, 2015 at 14:48

7

Solved

Lets say this is the situation: [Stored Proc 1] BEGIN BEGIN TRANSACTION ... exec sp 2 COMMIT END Now, if SP 2 - rolls back for whatever reason, does SP 1 - commit or rollback or throw e...
Leia asked 13/3, 2012 at 21:50

12

In my production error logs I occasionally see: SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction I know which query is trying to access the databas...
Whitener asked 14/5, 2011 at 7:7

2

Hello i've been trying to implement transanctions to my crud operations on my mongodb atlas using mongoose, i have tried to look up for tutorials and stuff, but there really aren't that many around...
Casady asked 23/12, 2019 at 21:17

2

Solved

I need to create a new database connection(session) to avoid an unexpected commit from a MySql procedure in my django transaction. How to set up it in django? I have tried to duplicate the databas...
Cosentino asked 24/6, 2019 at 8:59

2

I am working on an application which requires some double entry bookkeeping. Currently there are two endpoints /account /transaction While /account handles general data of the accounts, /transac...
Karen asked 30/10, 2015 at 15:17

4

I was using Django 1.5.1 and upgraded to Django 1.6.6. In Django 1.5.1, I was using select for update to guarantee atomic execution. # "views.py" from django.db import transaction def s...
Boettcher asked 22/8, 2014 at 15:58

3

I'm a last year college student and I'm doing my thesis right now. My title is "Index Suggestion based on Log Analysis". This project will analyze the PostgreSQL transaction log to give i...
Vineyard asked 20/2, 2019 at 7:10

2

Solved

I'm really unclear how atomic requests are set in Django. When ATOMIC_REQUESTS is set to True in the DB settings does that mean that all views now run in a transaction? What if I want only certain ...
Jenelljenelle asked 30/7, 2015 at 21:23

3

Solved

I have a problem with Postgresql repeatable read isolation level. I did make an experiment about repeatable read isolation level's behavior when phantom read occurred. Postgresql's manual says &quo...
Consciencestricken asked 4/4, 2019 at 13:0

4

Solved

I am using web3j to query the Ethereum blockchain. Now I want to check if a transaction was mined or just sent to the network. How can I achieve this?
Obbard asked 17/4, 2018 at 19:50

13

Solved

I understand the differences between optimistic and pessimistic locking. Now, could someone explain to me when I would use either one in general? And does the answer to this question change dependi...

© 2022 - 2024 — McMap. All rights reserved.