transactions

Transaction handling in web apps

I have noticed in most Web applications that whenever there is a transaction involved in a train of pages, the transaction handling happens in the database layer. In a web application where there could be numerous users running such transactions, handling all the transactions could be a critical thing. I agree that the database layer is ...

Transaction options over Web Service calls

Does anyone have any insight into transaction options available over web-service calls? 1.) There are two applications that we have that need transactional communication between them. 2.) App1 calls a web service on app 2 and then makes some changes to its own db. the call on app2 and the changes to it's own db need to be co-ordinated. H...

.NET: Asynchronous rollback due to Transaction timeout

In a C# project, I have a (volatile) transactional resource enlisted in a System.Transactions.Transaction. When a transaction timeout occurs, the rollback is executed in a worker thread: Obviously, the transaction uses a timer and calls a timer callback when the timer elapses (there is very little documentation from MS on this issue). Th...

Integration Services and Isolation Level

We have a data-warehousing package that our clients run during the day against their live transactional system. On most clients this seems to work fine but on busy clients we get deadlocking errors. By default SSIS runs with an isolation level of Serializable which is the highest isolation level on SQL 2005. The SSIS package is only ...

How to execute inserts and updates outside a transaction in T-SQL

Hi, I have stored procedures in SQL Server T-SQL that are called from .NET within a transaction scope. Within my stored procedure, I am doing some logging to some auditing tables. I insert a row into the auditing table, and then later on in the transaction fill it up with more information by means of an update. What I am finding, is t...

What is the best way to maintain a record's edit history with Rails and ActiveRecord

What is the best/cleanest/easiest way to maintain the edit history of records in Rails? I'm looking for logging - who made the edits and when and the ability to rollback to earlier versions of records. My guess is that you would use ActiveRecord callbacks on updates or deletes and instead of updating/deleting records you would create a...

How does TransactionScope roll back transactions?

I'm writing an integration test where I will be inserting a number of objects into a database and then checking to make sure whether my method retrieves those objects. My connection to the database is through NHibernate...and my usual method of creating such a test would be to do the following: NHibernateSession.BeginTransaction(); //...

What is the best way to refresh a rollup table under load?

I created a table in my SQL Server 2005 database and populated it with summary and calculated values. The purpose is to avoid extensive joins and groupings on every call to the database. I would like this table to refresh every hour, but I am not sure the best way to do this while the website is under load. If I delete every record an...

How can I tell if I have uncommitted work in an Oracle transaction?

Is there a way to tell if I have uncommitted work (ie DML) in a transaction? Maybe a data-dictionary view I can query? A method to find this out both from within and outside of the session running the open transaction would be welcome. Thank you ...

Best way to work with transactions in MS SQL Server Management Studio

Let's say I have an SQL statement that's syntactically and sematically correct so it executes. How can I in managements studio (or any other sql tool I guess) test sql-statements and if I notice that they broke something rollback? (in a sepparate query). ...

Controlling WF persistence points transactions

I am using WF, and need to support transactions and persistence. I would like not to use the TransactionScopeActvity , but use my own transaction scope object, and still have a persistence point at the end which will be part of the transaction in the activity itself (similar to how the TransactionScopeActvity works on this aspect). I can...

Optimize Hibernate entities saving?

Hi Is there a way to reduce unnecessary/empty fields in SQL inserts and SQL updates? For example, I have a single hibernate entity class mapped to a table that has 10 columns. The populating of data is actually done in two phases. When the user submit a request, I will insert the request information into the table with the hibernate ent...

Implementing support for nested transactions using JDBC 3.0

Hi all, our legacy application uses JDBC 3.0. it supports transactions by implementing its own transaction manager that is capable of returning the same JDBC connection for each thread. The problem I recently discovered is that it doesn't support nested transactions: if a transaction is started inside an another transaction, then every ...

How much does wrapping inserts in a transaction help performance on Sql Server?

Ok so say I have 100 rows to insert and each row has about 150 columns (I know that sounds like a lot of columns, but I need to store this data in a single table). The inserts will occur at random, (ie whenever a set of users decide to upload a file containing the data), about a 20 times a month. However the database will be under conti...

Nested transactions in Sql Server

Imagine the follwoing scenario: I am using Sql Server 2005. I have a transaction that is calling, among others Sql statements, a stored procedure that also has a transaction inside. The outer transaction sometimes fails and it is rolledback after the stored procedure is called and commited successfully. My question is, does the storedPro...

Three tier layered application using Wicket + Spring + Hibernate. How would you handle transactions?

Hi, I'm thinking about using the Open Session In View (OSIV) filter or interceptor that comes with Spring, as it seems like a convenient way for me as a developer. If that's what you recommend, do you recommend using a filter or an interceptor and why? I'm also wondering how it will mix with HibernateTemplate and if I will lose the abil...

Is there a way to make transactions or connections read only in SQL Server?

I need a quick "no" for DELETE/UPDATE/INSERT, since 3p reporting tool allows users to write their own SQL. I know that I should probably add a new user and set permissions on tables/sp/views/etc..., and then create a new connection as restricted user. Is there a quicker way to force a transaction or connection in SQL Server to read o...

TransactionScope vs Transaction in linq2sql

What are the differences between the classic transaction pattern in linq to sql like: using( var context = Domain.Instance.GetContext() ) { try { context.Connection.Open(); context.Transaction = context.Connection.BeginTransaction(); /*code*/ context.Transaction.Commit(); catch(Exception e){ con...

How is a T-SQL transaction not thread-safe?

The following (sanitized) code sometimes produces these errors: Cannot drop the table 'database.dbo.Table', because it does not exist or you do not have permission. There is already an object named 'Table' in the database. begin transaction if exists (select 1 from database.Sys.Tables where name ='Table') begin d...

UnitOfWork Implementation

Hello everybody, probably I'm too n00b to understand this, but I was reading the Gabriel Schenker http://nhforge.org/wikis/patternsandpractices/nhibernate-and-the-unit-of-work-pattern.aspx UnitOfWork implementation and I really cannot get the point. Why does the UnitOfWorkImplementor.Dispose need to forward the dispose to the UnitOfWork...