Questions tagged [sqltransaction]

An SQL-transaction is a unit of work that is performed against a database. Transactions are units or sequences of work accomplished in a logical order. Executing SQL-statements in Transactions, can ensure data integrity and handle database errors.

An SQL-transaction is a unit of work that is performed against a database. Transactions are units or sequences of work accomplished in a logical order.

A transaction is the propagation of one or more changes to the database. For example, creating, updating, or deleting a record from the table. Transactions are used to ensure data integrity and to handle database errors, by collecting SQL queries into a group and executing all of them together, as one unit of work.

Properties of Transactions: Transactions have the following four standard properties, usually referred to by the acronym ACID:

  • Atomicity: ensures that all operations within the work unit are completed successfully; otherwise, the transaction is aborted at the point of failure, and previous operations are rolled back to their former state.
  • Consistency: ensures that the database properly changes states upon a successfully committed transaction.
  • Isolation: enables transactions to operate independently of and transparent to each other.
  • Durability: ensures that the result or effect of a committed transaction persists in case of a system failure.
233 questions
0
votes
1 answer

SSIS - Sql transaction rollback throwing error

I have created an SSIS 2012 package with a for loop container planned to run continuously (infinite loop) so that it can process an incoming Excel file as soon as it is dropped into a designated drop directory. The processing involves first clearing…
0
votes
0 answers

SQL statements locking recurrently

Hello I am facing a critical issue since 2 weeks, where all the tables involved in below trigger are getting locked in a some scenario and not loading the view pages in the web application in the production region. Below SQL statement is hit…
0
votes
1 answer

how to use SQL Transaction in laravel 5.4?

how to use Sql Transaction in this code sample. i tried but transaction is not working properly. my database engine is InnoDB. DB::transaction(function() use($request ) { $user = User::$request->only('name','mobile','address'); $userSave =…
pankaj
  • 1
  • 17
  • 36
0
votes
0 answers

SqlConnection Transaction Management Approach

I am currently working on a SharePoint 2013 project with custom application pages development. On one of those pages, there are multiple insert / update to database table operations. Here are the sample code I am working with: Product.cs class…
0
votes
0 answers

what is the best way to insert multiple rows to production table in sql

I want to know what is the best practice to insert multiple rows from a source table into a destination table. Both source and destination tables are on a production database meaning delete or update transactions are being performed 24/7 on the…
shaadi
  • 161
  • 2
  • 4
  • 21
0
votes
5 answers

Selecting from a SQL table but there is an exception thrown

I get this error when I want to read the table: System.Data.SqlClient.SqlException (0x80131904): Incorrect syntax near ','. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action1…
Persian LionKing
  • 304
  • 1
  • 5
  • 19
0
votes
1 answer

In SqlTransaction.BeginTransaction() if returing Ident_current before commit(), what value should return

I am using SqlTransaction.BeginTranaction and Commit methods. I am calling a stored procedure after BeginTransaction and before Commit. And the stored procedure returns Ident_Current, should it return the last inserted value in that table or…
0
votes
1 answer

Ensuring single add into SQL table

I have a DocumentJob table that contains jobs to be performed against a given document. Each row in the table has jobId, documentId and jobstatus. Multiple threads / processes would be attempting to add to this table at any given time (using the…
shekhar
  • 1,372
  • 2
  • 16
  • 23
0
votes
0 answers

Nested sql transaction in .Net

I have two methods which start sql transaction and commit (or rollback) the connection inside the method. public void Method1(SqlConnection connection) { var trans = connection.BeginTransaction(); // do some work trans.Commit(); // or…
developer
  • 1,401
  • 4
  • 28
  • 73
0
votes
1 answer

Get information when transaction commits or rollsback in .NET. Any transaction

I am desiging a log system for my program and I need to know when any transaction in my system commits or rollsback. Since I open my connection from one place and also begin transactions from one place I have 'BEGIN TRANSACTION' covered but rollback…
Robert
  • 2,407
  • 1
  • 24
  • 35
0
votes
1 answer

How to re-execute all commands in a rolled back SqlTransaction instance?

I execute several SQL Transactions from my ASP.NET application. One transaction executes several stored procedures one after another. Transactions are quite long running ones. When two instances of my application i.e. two different processes are…
Learner
  • 4,661
  • 9
  • 56
  • 102
0
votes
3 answers

Q : hibernate spring transaction is synchronized ? If not , how i update db safe thread?

My question is first, hibernate spring transaction is synchronized ? And if they not what happen if I will begin two transaction at same time with same object ? I will be happy to show you this example : I have a Player object and a Ship…
mayan anger
  • 2,322
  • 2
  • 11
  • 19
0
votes
0 answers

SqlConnection.BeginTransaction(IsolationLevel.ReadUncommitted).Commit();

Folks I ran into a bit of code and I'm a tad confused about whats going on. I'm working to refactor the code to instead process a handful of SqlCommands rather than the single SqlCommand that it currently works with. It's my hope all SqlCommands…
Bill Roberts
  • 1,127
  • 18
  • 30
0
votes
1 answer

Conditional insert in SQL

I was looking for an example of data consistency over tables by using ACID transaction. I saw the example here : http://microservices.io/patterns/data/shared-database.html summery is as follow: CUSTOMER table has a column CREDIT_LIMIT. we want to…
Danial
  • 703
  • 1
  • 11
  • 26
0
votes
1 answer

SQL transaction statement in vb.net

I'm making a project that is linked to Microsoft SQLServer, used to enter, remove, edit data about customers and orders. The full system works, however I've been advised to use transactions rather than regular SQL statements to add/remove/edit data…
user6579928