Questions tagged [transactions]

A set of interrelated operations that must all succeed in order for any of them to succeed. Failure of any operation results in a rollback of all operations in the transaction.

In computer science, transaction processing is information processing that is divided into individual, indivisible operations, called transactions. Each transaction must succeed or fail as a complete unit; it cannot remain in an intermediate state.

Transaction processing is designed to maintain a system's Integrity (typically a database or some modern filesystems) in a known, consistent state, by ensuring that interdependent operations on the system are either all completed successfully or all canceled successfully.

Since most, though not necessarily all, transaction processing today is interactive the term is often treated as synonymous with online transaction processing

16096 questions
6
votes
3 answers

How to make a series of non database methods mimic transactions.

I have several method calls I need to perform that need to be "transactional" but I am unsure how to implement this aside from try/catch/finally. Background Application is console based. Application will have multiple threads A database is…
Robert H
  • 11,520
  • 18
  • 68
  • 110
6
votes
2 answers

best practices for using sqlite for a database queue

I am using an sqlite database for a producer-consumer queue. One or more producers INSERT one row at a time with a new autoincremented primary key. There is one consumer (implemented in java, uses the sqlite-jdbc library) and I want it to read a…
Jason S
  • 184,598
  • 164
  • 608
  • 970
6
votes
8 answers

MSDTC issue with transactions in ADO.NET Entity Framework

in our current project we are using ADO.NET Entity Framework as data layer for the application. There are some tasks which require to run in a transaction because there's a lot of work to do in the database. I am using a TransactionScope to surround…
Alexander
  • 3,724
  • 8
  • 42
  • 50
6
votes
2 answers

Timeout with TransactionScopeOptions.Suppress

Found this line in an application I just took over, and it doesn't make much sense. using (new TransactionScope(TransactionScopeOption.Suppress, new TimeSpan(1,0,0))) { This occurs immediately inside a nservicebus message handler method and covers…
Sign
  • 1,919
  • 18
  • 33
6
votes
1 answer

How do I test manual DB transaction code in Django?

I'm transferring data from a legacy system into Django. In order to ensure the current database's integrity, I'm committing everything manually. However, when writing unit tests, the transactions won't rollback properly. Since TestCase is probably…
strongriley
  • 1,093
  • 1
  • 15
  • 12
6
votes
1 answer

Implementing Spring ChainedTransactionManager according to the "best efforts 1PC" pattern

The best effort 1PC is nicely described in this post. The author, David Syer, who works for SpringSource, provided an implementation of a ChainedTransactionManager extending the Spring AbstractPlatformTransactionManager class. This particular…
Giovanni Botta
  • 9,626
  • 5
  • 51
  • 94
6
votes
1 answer

MYSQL If statement in transaction causing error

I have the following MYSQL query: START TRANSACTION; SELECT sport_id INTO @a FROM sports WHERE sport_id = 2 FOR UPDATE; UPDATE sports SET sport_name = 'Table Tennis' WHERE sport_id = @a; if (@a > 1) then COMMIT; ELSE ROLLBACK; END…
Luke
  • 22,826
  • 31
  • 110
  • 193
6
votes
3 answers

Transaction required exception on execute update for JPQL update query

I get this error when I try to run this code. Error: javax.persistence.TransactionRequiredException: executeUpdate is not supported for a Query object obtained through non-transactional access of a container-managed transactional EntityManager…
user2233876
  • 61
  • 1
  • 1
  • 2
6
votes
1 answer

How do I keep an OleDbConnection from trying to enlist in a distributed transaction?

I am using OleDB to connect to an excel file using this connection string @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source={0};Extended Properties=""Excel 12.0 Xml;HDR=YES""" But when I do this (which is inside a TransactionScope()) using…
JeremyWeir
  • 24,118
  • 10
  • 92
  • 107
6
votes
3 answers

Concurrent reading and updating in a database table

I have an Oracle database that I access using Devart and Entity Framework. There's a table called IMPORTJOBS with a column STATUS. I also have multiple processes running at the same time. They each read the first row in IMPORTJOBS that has status…
L-Four
  • 13,345
  • 9
  • 65
  • 109
6
votes
1 answer

spring-data JPA: manual commit transaction and restart new one

I have a method for importing data. In case the import is large it can not run within a single transaction without potentially causing an OutOfMemoryError due to huge transaction statement cache. What I want is to manually commit after n records in…
beginner_
  • 7,230
  • 18
  • 70
  • 127
6
votes
1 answer

How to set the timeout on a NHibernate transaction

I need a lot of DB processing done in a single transaction, including some processing using NHibernate. To make everything work in the same transaction, I'm using NHibernate's Session to start it, and enlist the the commands for the other work in…
k.c.
  • 1,755
  • 1
  • 29
  • 53
6
votes
1 answer

how to change isolation level?

I am using EF 4.0, and I would like to use the isolation level serializable, because in a transaction I would like to block a register when is read. Well, in SQL Server I try to change the isolation level with this command: SET TRANSACTION ISOLATION…
Álvaro García
  • 18,114
  • 30
  • 102
  • 193
6
votes
2 answers

Febelfin CODA (Coded Statement of Account) 2.3 Only used in Belgium?

I'm tasked with writing some code that interprets CODA files that come from (different) (Belgian) banks. CODA files stands for Coded Statement of Account files, and seems to be the Belgian name for textual files that have a line for each bank…
Michiel Cornille
  • 2,067
  • 1
  • 19
  • 42
6
votes
1 answer

Ember-data: how to share and update a object in transaction between controller actions?

I've found on GitHub a good working example for ember-data under https://github.com/dgeb/ember_data_example and try to extend it by nested resource ('has_many: comments'). In the original example a new transaction is created every time the edit view…
1 2 3
99
100