transactions

A newbie question about database transactions

I know that database transactions are used to ensure all the statements in the transaction will be executed or none of them will. But what about locking and thread safety, for example if I have an sproc which affects multiple tables and I use a transaction in that sproc, that sproc is called from different clients at the same time, will...

hibernate DAO design

do i have to open and close session and transcation in each function (make object ,delete object ,findbyID) can u give me a DAO implenetation for findall (lazy initialization ). ...

Transactions in LINQ to SQL

Hello guys, I need some help regarding transactions in Linq to sql. Below is the typical transaction layout. If any operation fails, then all the operations are rolled back. mainTransaction (tScope) Operation 1 changes db.submitChanges() Operation 2 changes db.submitChanges() ... catch(TransactionEx...

SQL Server 2005 support for Oracle-style autonmous transaction

Within a transaction is there a way to have data committed within it even though the transaction is rolled back? We're writing audit/logging information inside a transaction but we want to keep that information even though the transaction has to roll back. We've see an article that tries to copy the Oracle way but what we're really look...

Trying to understand TransactionScope

I'm trying to make a quick dummy app so I can learn the ins and outs of System.Transactions. This app interacts with 2 different SQLExpress DBs. If I pull up my transaction statistics in component services, I can see a transaction start up in the outerScope when the second connection is opened. If failOuter is true the transaction aborts...

Is it okay if from within one stored procedure I call another one that sets a lower transaction isolation level?

I have a bunch of utility procedures that just check for some conditions in the database and return a flag result. These procedures are run with READ UNCOMMITTED isolation level, equivalent to WITH NOLOCK. I also have more complex procedures that are run with SERIALIZABLE isolation level. They also happen to have these same kind of chec...

Is an ADO.NET 2.0 Transaction on SQL Server 2005 automatically rolled back on exception?

If we begin a transaction, then do some db action, say insert, and an exception occurs, is the transaction automatically rolled back if I don't call transaction.rollback() in the catch/exception handler? Even if the transaction is rolled back, does that result in a memory leak, i.e. the transaction object and the connection object hang ...

How do I use TransactionScope in C#?

I am trying to use TransactionScope, but keep getting the exception below. The app is running on a different machine than the database, if that matters. I am using Sql Server 2005. "Network access for Distributed Transaction Manager (MSDTC) has been disabled. Please enable DTC for network access in the security configuration for MSDT...

Why doesn't TransactionScope work with Entity Framework?

See the code below. If I initialize more than one entity context, then I get the following exception on the 2nd set of code only. If I comment out the second set it works. {"The underlying provider failed on Open."} Inner: {"Communication with the underlying transaction manager has failed."} Inner: {"Error HRESULT E_FAIL has been re...

InnoDB deadlock with read-uncommited! - Java - Glassfish - EJB3 (JPA/Hibernate)

Hello I'm new here and need some help :) It's been several days that i got deadlock issues on a Java application with Glassfish - EJB3 with Mysql InnoDB Config: Mysql InnoDB: Ver 14.12 Distrib 5.0.51a, for debian-linux-gnu (i486) using readline 5.2 Application server: Glassfish v2.1 Persistance with EJB3 - JPA - Hibernate To make i...

using a transaction to avoid a race

I'm writing a daemon to monitor creation of new objects, which adds rows to a database table when it detects new things. We'll call the objects widgets. The code flow is approximately this: 1: every so often: 2: find newest N widgets (from external source) 3: foreach widget 4: if( widget not yet in database ) 5: add rows f...

Auditing transactions in an eCommerce add-on

Hi I'm puzzling over how I might achieve the following: We deal with a number of customers that have various eCommerce implementations, some using paypal, eBay store, .net cart and various others. We want to provide the customers with some simple code that they can add to their checkout process that will track the transaction and prov...

LLBLGen - TransactionScope or DataAccessAdapter.StartTransaction

I see there are two main options for managing transactions with llblgen. Method 1: using(DataAccessAdapter adapter = new DataAccessAdapter()) { adapter.StartTransaction(IsolationLevel.ReadCommitted, "TR"); try { // ... adapter.Commit(); } catch { adapter.Rollback(); throw; } ...

Testing for concurrency and/or transactional integrity in a web application with JMeter

I'm rather new to working with multiple threads in a database (most of my career has been spent on the frontend). Today I tried testing out a simple php app I wrote to store values in a mysql db using ISAM tables emulating transactions using Table Locking. I just wrote a blog post on the procedure Here: Testing With JMeter From my...

Emulating a transaction-safe SEQUENCE in MySQL

We're using MySQL with InnoDB storage engine and transactions a lot, and we've run into a problem: we need a nice way to emulate Oracle's SEQUENCEs in MySQL. The requirements are: - concurrency support - transaction safety - max performance (meaning minimizing locks and deadlocks) We don't care if some of the values won't be used, i....

Do I want to minimize the scope of @Transactional?

Not sure if 'scope' is the correct term here. I am using Spring for JPA transaction management (with a Hibernate underneath). My method to preform database transaction is private, but since you can only set @Transactional on a class or on a public method Since this mechanism is based on proxies, only 'external' method calls coming i...

Entity Framework - Using Transactions or SaveChanges(false) and AcceptAllChanges()?

Hi there, I have been investigating transactions and it appears that they take call of them selves in EF as long as i pass false to savechanges.. SaveChanges(false) and if all goes well then AcceptAllChanges() Question is what is something goes bad, don't have to rollback? or as soon as the my method goes out of scope its ended? Wha...

Transactions for read-only DB access?

There seem to be very different opinions about using transactions for reading from a database. Quote from the DeveloperWorks article Transaction strategies: Models and strategies overview: Why would you need a transaction if you are only reading data? The answer is that you don't. Starting a transaction to perform a read-only ...

identity to be incremented only if record is inserted

sql server 2005 : i have a column empid in employee table with identity on.if there is some error while inserting data into table .identity is incremented .i want identity to be incremented only if record is inserted .like if i have generated emp id from 1 to 5 and then on 6th record insertion error ocurrs.and on next record insertion id...

Why does DBMS_MVIEW.REFRESH have an implicit commit?

I noticed recently that calling dbms_mview.refresh(...), which refreshes materialized views in Oracle, has an implicit commit. Any ideas - other than "because it does" - why this action has an implicit commit? ...