transactions

In which layer would you implement transactions using asp.NET TransactionScope?

I have a service, business and data access layer. In which layer should I implement transactions using asp.NET transactionscope? Also, is nesting Transactions a good thing because I had problems with that? ...

NHibernate Transactions on Reads

I have read the documentation and explanation on why it is highly recommended to use transactions on read operations in NH. However, I still haven't totally "bought" into it yet. Can someone take a stab at explaining it without just telling me to RTFM, which I have already done? ;) ...

Spring Transaction with Sybase

I am using Spring in my Web Application , with the underlying database as Sybase. I have 3 complex stored procedures to be executed. The procs , have create table and drop table commands to hold temporary result sets. The tables are created in the user db space , rather that in the tempdb space. Hence, I am faced with the need to ensu...

how to translate this (see the code below )to C# ?

how to translate this to C# import java.io.*; import java.net.*; class SimpleServer { private static SimpleServer server; ServerSocket socket; Socket incoming; BufferedReader readerIn; PrintStream printOut; public static void main(String[] args) { int port = 8080; try { port = Integer.parseInt(arg...

Dealing with RollbackException in Java

Hey, Is there any way to "replay" transaction? I mean, sometimes I get RollbackException and rollback the transaction. Can I then "clone" the transaction and try again, or once rollback is called, transaction is lost? I really need the changes, and really don't want to trace every change for rerunning later... thanks, udi ...

What if my process is too long for transaction timeout duration?

Hi, I would like to know what are the best practices, if you have a quite long lasting process that ends up with a transaction timeout and which should definitely be possible to rollback if any exception is thrown within? Imagine that all along the application set timeout duration is quite enough but for such a specific one it is not ...

Rolling back identifiers NHibernate

I would like to get NHibernate to roll back the identifier of any entities saved during a transaction if the transaction is aborted. I am using NHibernate 2.1.0, and it doesn't do this by default. I came up with the following solution, which works up to a point: public class RevertIdentifiersEventListener : DefaultSaveEventListener { ...

Nervous Running Queries (SQL Server): What do you think about this?

I'm a frequent SQL Server Management Studio user. Sometimes I'm in situations where I have an update or delete query to run, but I'm afraid some typo or logic error on my part is going to cause me to make undesired, massive changes to a table (like change 1000 rows when I meant to change 2). In the past, I would just clench my fists ...

NHibernate - Why does Delete() call fail to delete but delete through HQL works?

Considering the following code blocks, why does call to HQL work but call to delete() not work? As a background, I'm using NHibernate over IBM.Data.DB2.Iseries driver. Come to find out, journaling on the AS400 is turned off so I can't use transactions. I'm not the AS400 admin or know anything about it so I don't know if having journaling...

SQL Server Race Condition Question

(Note: this is for MS SQL Server) Say you have a table ABC with a primary key identity column, and a CODE column. We want every row in here to have a unique, sequentially-generated code (based on some typical check-digit formula). Say you have another table DEF with only one row, which stores the next available CODE (imagine a simple ...

TransactionScope automatically escalating to MSDTC on some machines?

In our project we're using TransactionScope's to ensure our data access layer performs it's actions in a transaction. We're aiming to not require the MSDTC service to be enabled on our end-user's machines. Trouble is, on half of our developers machines, we can run with MSDTC disabled. The other half must have it enabled or they get th...

Question on locking and transactions on MyISAM table

Hello, I have a counter field in a myisam table. To update the counter value in a multitasking environment (web server, concurrent queries from PHP) I need to lock the record for update. So I do it like this: START TRANSACTION; SELECT Counter FROM mytable ... FOR UPDATE; UPDATE Counter value or INSERT INTO mytable; // let's make s...

Tokyo Tyrant transaction support

I've noticed that rufus-tokyo and other apis support transactions in Tokyo Tyrant. I couldn't find any mention of the transaction support in the TT docs (http://1978th.net/tokyotyrant/spex.html#clientprog) Is that transaction support simulated? Or is there a way to do a server-side transaction using the C api? ...

Data committed even though System.Transactions.TransactionScope.Commit() not called

Under what circumstances can code wrapped in a System.Transactions.TransactionScope still commit, even though an exception was thrown and the outermost scope never had commit called? There is a top-level method wrapped in using (var tx = new TransactionScope()), and that calls methods that also use TransactionScope in the same way. I'm...

How to find out where a COMMIT might be happening?

I'm refactoring some code, converting a number of related updates into a single transaction. This is using JDBC, MySQL, InnoDB. I believe there is an unwanted COMMIT still happening somewhere in the (rather large and undocumented) library or application code. What's the easiest way to find out where this is happening? There must be s...

MySql unique id for several records

I use one table withe some casual columns such as id, name, email, etc...also I'm inserting a variable numbers of records in each transaction, to be much efficient I need to have one unique id lets call it transaction id, that would be the same for each group of data which are inserted in one transaction, should be increment. What is the...

Recover from SQL batch-abort errors inside a transaction? Alternative?

I'm looking for a way to continue execution of a transaction despite errors while inserting low-priority data. It seems like real nested transaction could be a solution, but they aren't supported by SQL Server 2005/2008. Another solution would be to have logic to decide if an error is critical or not, but it would seem that's not possibl...

InnoDB Transaction Help - Select then if Not Found Add Unique Row

Hi all! I have a mysql table that contains IPAddress parts TABLE `EndPoints`( `EndPointId` BIGINT(19) UNSIGNED NOT NULL AUTO_INCREMENT , `IpPart1` TINYINT(3) UNSIGNED NOT NULL , `IpPart2` TINYINT(3) UNSIGNED NOT NULL , `IpPart3` TINYINT(3) UNSIGNED NOT NULL , `IpPart4` TINYINT(3) UNSIGNED NOT NULL , PRIMARY KEY ...

mySQL - Prevent double booking

I am trying to work out the best way to stop double 'booking' in my application. I have a table of unique id's each can be sold only once. My current idea is to use a transaction to check if the chosen products are available, if they are then insert into a 'status' column that it is 'reserved' along with inserting a 'time of update' th...

QSqlDatabase::transaction and other open transaction, block or fail ?

I am dealing with Sql Server and Oracle through Qt, when using QSqlDatabase::transaction() on a database connection. When another user/connection has a transaction open on the same database does the transaction() call block until the other transaction is finished or fail ? ...