transactions

Check Contraint Bypassing CATCH block in Distributed Transaction

Hello, I have a MSSSQL stored procedure performing a distributed transaction that looks like this: SET XACT_ABORT ON; SET NOCOUNT ON; BEGIN TRY BEGIN DISTRIBUTED TRANSACTION insert into LNKSRV.INST.dbo.zz (id, val) values (1, 'a'); insert into LNKSRV.INST.dbo.zz (id, val) values (2, 'b'); COMMIT TRANSACTION END TRY BEGIN C...

Going transactionless with Hibernate

Is there a way to pick-and-choose updates that Hibernate will wrap with a transaction? Inspired by EBay's drive to be transactionless whenever possible, I know of many updates in my application that don't need to be ACID writes. For example, there's an update that consists of a user id and an id for another table. Only one user can in...

How transaction should be handled while using Unit of Work pattern in a WinForm application

How transaction should be handled while using Unit of Work pattern in a WinForm application Should new UOW session be created when form is initialized? Disposed when form is exited? call UOW.commit() in every save? Please advice Any articles on this topic?? ...

Testing transactional code

Hello, I'm writing my own transaction-aware (IEnlistmentNotification) piece of code and am trying to test it using XUnit. All I need is to wait the transaction commited and test the outcome is what I expect. The thing is that transaction commitment happens in a separate thread, so I need to synchronize my test and piece of code I'm test...

How to do simple Spring JDBC transactions outside the IoC container?

The project I'm working on uses straight JDBC data access in all its boilerplate glory and doesn't use any transactions. I feel like using transactions and simplifying the way data access methods are written is important, especially with some changes being made currently. The project has been around for quite a while and isn't suited to ...

SharePoint 2007: How can I perform a series of operations within a transaction?

I would love to know how to perform a series of operations in a SharePoint context within a transaction. For example, I would like to be able to do something like the following: context.BeginTransaction(); listItemA.Update(); listItemB.Update(); context.CommitTransaction(); I know this isn't possible with the OOTB APIs, but someone h...

SQLite transaction doesn't work as expected

I prepared 2 files, "1.php" and "2.php". "1.php" is like this. <?php $dbh = new PDO('sqlite:test1'); $dbh->beginTransaction(); print "aaa<br>"; sleep(55); $dbh->commit(); print "bbb"; ?> and "2.php" is like this. <?php $dbh = new PDO('sqlite:test1'); $dbh->beginTransaction(); print "ccc<br>"; $dbh->commit(); print "ddd"; ?> and...

Efficient transaction, record locking

I've got a stored procedure, which selects 1 record back. the stored procedure could be called from several different applications on different PCs. The idea is that the stored procedure brings back the next record that needs to be processed, and if two applications call the stored proc at the same time, the same record should not be b...

Transactions in C#

Hi, In addition to this question: http://stackoverflow.com/questions/577080/preorder-tree-traversal-copy-folder I was wondering if it is possible to create a transaction that contains different calls to the database. ex: public bool CopyNode(int nodeId, int parentNode) { // Begin transaction. try { Method1(nodeId); Meth...

Patterns for implementing transactions outside of a database

I have to send an email, write to a file, and call a web service. To maintain consistency, all steps must happen. If any step throws an exception or errors out, all steps must be rolled back. Before I go rolling my own object ACID engine, are there any commonly accepted patterns for implementing ACID semantics at the object level? Bett...

Real-world uses of MySQL savepoints in web services?

Does anyone have experience they can share using MySQL savepoints (directly or via an ORM), especially in a non-trivial web service? Where have you actually used them? Are they reliable enough (assuming you're willing to run a fairly recent version of MySQL) or too bleeding-edge or expensive? Lastly, does anyone have experience with s...

Where can I find a good introduction on SQL locking and transaction strategies

I'm using locks and transactions a bit like a VBA excel programmer trying to write a multithreaded c++ server for the first time... I've tried to ask my coworkers for advice, but while we're all quite good (or so we think) at designing complex databases, writing fast and efficient queries, using index and constraints when it's needed, a...

Transactions with typed dataset and Sql Server CE

I have a WinForms application that interacts with a SqlCe local database. I manage db operations using BindingSources, TableAdapters and typed datasets.I have several operations scattered through several methods in two different classes that I need to perform in a transaction and I was thinking of using System.Transactions.Transaction or...

SqlTransaction has completed

I have an application which potentially does thousands of inserts to a SQL Server 2005 database. If an insert fails for any reason (foreign key constraint, field length, etc.) the application is designed to log the insert error and continue. Each insert is independent of the others so transactions aren't needed for database integrity. H...

Partial UPDATE command

I want to execute UPDATE command over a group of records, but it fails, because some records after the update would violate an table constraint. Is it possible to update only suitable records somehow? ...

SQL Server: Snapshot transaction problem with synonyms in Express Edition

We have 2 databases, say DB1 and DB2. DB1 contains all the stored procedures which access also data in DB2. DB1 uses synonyms to access the tables in DB2. (Using synonyms is a requirement in our situation) This works perfectly fine in all situations with SQL Server 2005 Developer Edition. However in the Express Edition, we get an excep...

Concurrency when using GORM in Grails

Let's say I have a counter function which updates a counter using raw SQL: public void updateCounter() { executeSql("UPDATE counter SET count_value = count_value + 1 WHERE id = 1;"); } The database would make sure that two concurrent calls to the counter are handled as expected - that all calls would update the counter with one i...

ASP .Net WorldPay Integration

Hi, I'm wondering whether anyone has any useful information on integrating WorldPay into an ASP.Net web application? I'm looking to take payments for a fixed amount directly from the web site, no shopping cart required. Essentially I'm just looking for some reference source code or a good article covering what's required. Does WorldPay...

Commiting only Specific Changes made inside a TRANSACTION which may ROLLBACK

This is a significant edit from the original question, making it more concise and covering the points raised by existing answers... Is it possible to have mulitple changes made to multiple tables, inside a single transaction, and rollback only some of the changes? In the TSQL below, I would NOT want any of the changes made by "myLogSP"...

How to use a single SqlTransaction for multiple SqlConnections in .NET?

I have SQL Server 2000, it doesn't support MultipleActiveResults. I have to do multiple inserts, and it's done with one connection per insertion. I want to begin a transaction before all insertions and finish it after all insertions. How do I do it? ...