transactions

What is the 'best' way to do distributed transactions across multiple databases using Spring and Hibernate

I have an application - more like a utility - that sits in a corner and updates two different databases periodically. It is a little standalone app that has been built with a Spring Application Context. The context has two Hibernate Session Factories configured in it, in turn using Commons DBCP data sources configured in Spring. Curr...

Distributed Processing: C++ equivalent of JTA

I'm developing a mission-critical solution where data integrity is paramount and performance a close second. If data gets stuffed up, it's gonna be cata$trophic. So, I'm looking for the C/C++ version of JTA (Java Transaction API). Does anyone know of any C or C++ libraries that supports distributed transactions? And yes, I've googled it...

How do I use a remote MSMQ transactionally?

I am writing a Windows service that pulls messages from an MSMQ and posts them to a legacy system (Baan). If the post fails or the machine goes down during the post, I don't want to loose the message. I am therefore using MSMQ transactions. I abort on failure, and I commit on success. When working against a local queue, this code works ...

SQL Server 2000 and System.Transactions.TransactionScope()

Is it possible to create LIGHTWEIGHT transactions using TransactionScope() with SQL2000? Or if not, is there a workaround using CommitableTransaction and/or something similar? So the answer is, basically, "If you want local-to-1-server-transactions on SQL2000, don't use TransactionScope()". ...

transaction isolation problem or wrong approach?

I was helping out some colleagues of mine with an SQL problem. Mainly they wanted to move all the rows from table A to table B (both tables having the same columns (names and types)). Although this was done in Oracle 11g I don't think it really matters. Their initial naive implementation was something like BEGIN INSERT INTO B SELECT...

Transaction encapsulation of multi-process writes

I have a database scenario (i'm using Oracle) in which several processes make inserts into a table and a single process selects from it. The table is basically used as a intermediate storage, to which multiple processes (in the following called the Writers) write log events, and from which a single processes (in the following referred t...

What's the difference between DTCPing and DTCTester?

I've used DTCTester before to diagnose MSDTC problems. However, I just noticed DTCPing seems to do about the same thing. What's the difference between these two? From what I can tell so far, DTCPing needs to run on both client and server machines, whereas DTCTester only needs to run from the client. Are there any other differences? ...

Sql Server 2005 SSIS unable to enlist SYBASE distributed transaction

Good morning, I know very little (arguably nothing) about SYBASE setup, but I do know SSIS is having trouble enlisting SYBASE in a distributed transaction. Has anyone been able to make this work? The SSIS Runtime has failed to enlist the OLE DB connection in a distributed transaction with error 0x80004005 "Unspecified error". This h...

Best Practices for Performing Sequential Operations

Hi, What is the best way to perform a couple of tasks together and if one task fails the next tasks should not be completed? I know if it were the database operations then I should have used Transactions but I am talking about different types of operations like the following: All tasks must pass: SendEmail ArchiveReportsInDatabase ...

Should web applications use explicit SQL transactions?

Consider a regular web application doing mostly form-based CRUD operations over SQL database. Should there be explicit transaction management in such web application? Or should it simply use autocommit mode? And if doing transactions, is "transaction per request" sufficient? ...

How do I make IEditableObject.EndEdit atomic?

If I have an Address class that implements IEditableObject, I might have EndEdit implementation like this: public void EndEdit() { // BeginEdit would have set _editInProgress and save to *Editing fields if (_editInProgress) { _line1 = _line1Editing; _line2 = _line2Editing; _city = _cityEditing; ...

How do I make IEditableObject.EndEdit atomic?

If I have an Address object which implements IEditableObject, I might have EndEdit implementation like this: public void EndEdit() { // BeginEdit would set _editInProgress and update *Editing fields; if (_editInProgress) { _line1 = _line1Editing; _line2 = _line2Editing; _city = _cityEditing; _...

How do you determine if a JDBC Connection was retrieved from a JTA enabled DataSource or straight JDBC?

I'm using a vendor API to obtain a JDBC connection to the application's database. The API works when running in the application server or when running in a stand-alone mode. I want to run a series of SQL statements in a single transaction. I'm fine with them occurring in the context of the JTA transaction if it exists. However, if it doe...

.NET TransactionScope class and T-SQL TRAN COMMIT and ROLLBACK

I am current writing an application that will require multiple inserts, updates and deletes for my business entity. I am using the TransactionScope class to guarantee all the stored procedures can commit or roll back as a single unit of work. My question is, I am required to also use COMMIT TRAN and ROLLBACK TRAN is each of my stored p...

LINQ to SQL and Concurrency Issues

Hi, We are trying to build a High-Volume Orders Record System. There are three primary tables: 1. Orders 2. OrderDetails 3. OrderShipment The Shipment table contains n record per order and any record shipment entry can be changed before the Customer accepts th order, after which it is frozen. (A business requirement) Although this may...

Oracle - How does transaction, rollback segment and the undo_retention parameter work ?

I'm no DBA, and I'm having a bit of a hard time understanding Oracle's transaction management process. From what I understood by reading some reliable-looking pages on the Internet (most notably this AskTom note -- but don't bother with the comments), when a transaction is commited, the new data is not reported on the actual data block ...

Maintiaining SQL Transactions over web service calls in .Net

How do I perform a database transaction where I create a new record then make a call to a web service using the new record ID returned from the database which will also manipulate the same database? I could obviously update all tables directly from the same SQLConnection object but the logic within the web service call is subject to chan...

MSDTC and Oracle transaction locks after abort has been called?

I’m running into problems using MSDTC and Oracle. It’s a .net application and I’m using the TransactionScope class to control the transactions. The problem is that, sometimes, if the transaction is rolled back (scope.Dispose is called without having called scope.Complete), it stays in “Aborting” state for a long time, not releasing the ...

"The operation is not valid for the state of the transaction" error and transaction scope

I am getting a "The opertaion is not valid for the state of the transaction" error when I try to call a stored procedure that contains a SELECT Statement. Here is the structure of my calls public void MyAddUpdateMethod() { using (TransactionScope Scope = new TransactionScope(TransactionScopeOption.RequiresNew)) { using...

In MS SQL Server, is there a way to "atomically" increment a column being used as a counter?

Assuming a Read Committed Snapshot transaction isolation setting, is the following statement "atomic" in the sense that you won't ever "lose" a concurrent increment? update mytable set counter = counter + 1 I would assume that in the general case, where this update statement is part of a larger transaction, that it wouldn't be. For exa...