transactions

Using Transactions with Business Processes and the Repository pattern

I have a situation (I'm guessing is pretty standard) where I need to perform some business calculations and create a bunch of records in the database. If anything goes wrong at any point I need to roll everything back from the database. Obviosly I need some kind of transaction. My question is where do I implement transaction support. Her...

LINQ to SQL - Is it true that SubmitChanges() automatically starts a transaction?

I need to use transactions with LINQ to SQL and I was reading around to get familiar with it. Is it true that SubmitChanges is already transactioned? ...

Hibernate rollbacks

If I do the following session.getTransaction().rollback(); is it then ok/possible to start calling save/update/delete etc. on the same session object? Couldnt find the answer to this in the Hibernate Session/Transaction API, or in the Hibernate reference documentation. Or do you recommend me to close that Session object, open a new S...

MSSQL: What happens when an error occurs during trigger execution?

Regarding Update and Insert triggers for MS SQL Server, is there a way to make them atomic? In other words, if an error occurs during the trigger, is it possible to automatically roll back the original insert or update? ...

Need help in coding for transaction table

Hi all, I need help in how to transfer data from one account no to another account no in single table. In this customer will get his account no from dropdown list(it will come automitically thru his session) and customer has to write the destination account no in textbox and the amount he is transferring will be written in another textbo...

Is it possible to have a database transactions span multiple requests in rails?

Hello, I have a form which spans multiple pages. The way it is set up now is not ideal because it saves (to the database) each page when it is submitted. So if the user does not complete the form across all pages there would be an incomplete user registration saved in the database. I would like to 'rollback' the saves if the user doesn'...

How to Rollback Data in vb.net

Hi, I have a page in which there are 3 sections.In the first section,i have some details to save in the Database.I am saving these details through a StoredProcedure(sql) named Procedure1.The details are stored in a table named Table1.There is a Primary key in the table named "ID".This "ID" is inserted automatically in the table. In the...

How to be guaranteed transactional integrity in SQL Server 2005

I have what looked to me at first glance a very simple problem. I want to be able to obtain a unique key value with a prefix. I have a table which contains 'Prefix' and 'Next_Value' columns. So you'd think you just start a transaction, get the next value from this table, increment the next value in the table and commit, concatenate the ...

How would a SQL Server 2005 database lose a few days data?

Hi! I really need some help here. I'm the owner of a SQL Server Database application that lost three days data! I can't understand how or why. So here is the set-up. SQL Server 2005 32bit standard edition database on Windows 2000 server. (Database B) Database is in simple recovery mode The database is connected as a subscriber to ...

Maximum transaction size in PostgreSQL

I have a utility in my application where i need to perform bulk load of INSERT, UPDATE & DELETE operations. I am trying to create transaction around this so that once this system is invoke and the data is fed to it, it is ensured that it is either all or none added to the database. The concern what is have is what is the boundary condit...

Transactional theory

(I have a simple CRUD API in a DAO pattern implementation.) All operations (save, load, update, delete) have a transaction id that must be supplied. So eg. its possible to do: ... id = begintransaction(); dao.save(o, id); sao.update(o2, id); rollback(id); All examples excluding load invocations seems intuitive. But as soon as you sta...

Subversion: Can multiple copy operations be done in a single revision?

From what I understand about transactions in Subversion this should be possible in principle, but I don't know any tool that supports it. The background is that we are discussing a migration from PVCS Dimensions to Subversion, and the main feature cited as missing in Subversion is "Design Parts". A design part is an arbitrary collection...

Where is the best place to handle transactions in stored procedure or in application?

Hello gurus, When my C#.net application updates records in more than one table, I use transactions so if anything should fail during the transaction I can rollback. Which one is a better practice? -Use stored procedure with BEGIN TRANSACTION/ROLLBACK/COMMIT TRANSACTION; -Use TransactionScope in the application as below: using (...

SQL Transactions (b)locking Selects - is my understanding correct

We are using ADO.NET to connect to a SQL 2005 server, and doing a number of inserts/updates and selects in it. We changed one of the updates to be inside a transaction however it appears to (b)lock the entire table when we do it, regardless of the IsolationLevel we set on the transaction. The behavior that I seem to see is that: If yo...

TransactionScope and Isolation Level

Hello, we have a problem to use TransactionScope. TransactionScope get to us very good flexibility to use transactions across our Data Access Layer. On this way we can use transactions implicit or explicit. There are some performance boost again ADO.NET transactions, but at this time this is not really problem. However we have problem ...

SQL Server Transactions

When to use ado.net and SQL Server transactions? Are there any reasons why one would choose to use ado.net transactions over SQL Server transactions when there is only one SP or query fired against the database within that transactions. ...

Do DDL statements always give you an implicit commit, or can you get an implicit rollback?

If you're halfway through a transaction and perform a DDL statement, such as truncating a table, then the transaction commits. I was wondering whether this was always the case and by definition, or is there a setting hidden somewhere that would rollback the transaction instead of committing. Thanks. Edit to clarify... I'm not looking...

Transaction across basicHttpBinding

Hi, we currently have an asmx webservice which exposes a single method to make various updates to a Sql database, wrapped internally in a SqlTransaction. I am re-writing this service in WCF and we would like to split up the existing method into sub-calls accessed through various different WCF services. There is a restriction to use bas...

Spring: No transaction manager has been configured

Hi all, I've been wrestling with this problem for a while, and don't see a solution. Hope anyone can help me. I have a HibernateTransactionManager configured. However, I see the following message in the log file: DEBUG [http-8080-1] AnnotationTransactionAttributeSource.getTransactionAttribute(107) | Adding transactional method [cashIn...

Scoped/composite surrogate keys in MySQL

Here's an excerpt of my current database (changed the table-names for an easier understanding): Pet(ownerFK, id, name, age) Owner(id, name) Where id is always a surrogate key, created with auto_increment. I want to have the surrogate key Pet.id to be "scoped" by Pet.ownerFK or in otherwords, have a composite key [ownerFk, id] as my m...