transactions

NHibernate, TransactionScope and locking

I am trying to use TransactionScope with NHibernate in order to call several methods in one transactions. Data repository methods are like this: public virtual void Save(T dataObject) { try { using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required, new TransactionOptions { IsolationLevel = I...

How do I share a transaction across a set of parallel tasks

I have a TransactionScope object and I want to use it for all the tasks created using Parallel.ForEach, how do I achieve this? I want to writing to a message queue in parallel, 20-50 messages, message queue is transactional: using (var queue = new MessageQueue(_exportEndpoint)) { var label = string.Format("{0} ComponentId - {1}...

transaction isolation level good explanation

Hi All, Does someone knows a good book where transaction isolation levels are explained with examples and advices in what case what isolation level to use ? Regards ...

what is practical use of System.Transactions?

I have seen System.Transactions namespace, and wondered, can I actually make a RDMBS with this namespace usage? But when I saw some examples, I do not understand how System.Transactions does anything beyond simple try catch and getting us success/failure result? This is the example on MSDN's website, I know it may be very simple but I...

Facebook connect database transaction help

I am trying to implement a simple login system with facebook, but I need users to pick a username. What I was thinking was to get all the information I need from facebook, request permissions, then add the information to the database, redirect to a form asking for a username and then add that to the database, to the same entry. I think ...

Two transactions seem to block each other but none of them is waiting

I have two transactions running in a mysql database, neither of which seems to make any progress. Both hold some locks but as far as I understand they don't conflict. Both transactions are in state "ACTIVE" (I would have expected that one of them be in a waiting state if it were blocked by the other). I've attached the "TRANSACTIONS" ...

How can I see from which TransactionManager given transaction is created in Spring 3.0

In my spring configuration I have two transaction managers defined for two different databases. Is there a way in spring to check on runtime whether given method is running inside transaction and secondly (and more importantly) from which transaction manager was this transaction created. ...

Ehcache element <cache/> does not allow attribute "transactionalMode"?

According to the Ehcache documentation, starting with version 2.0, an Ehcache cache may participate in a JTA transaction based on the value of attribute transactionalMode on element <cache/>. If this is true, then why does Ehcache, when it encounters this attribute in my Ehcache configuration file, throw the following exception and comp...

WCF Custom Message Writing With Transaction Support

Hi All I'm using a custom message that inherits the System.Servicemodel.Channels.Message. My custom message get IEnumerable collection which pulled from a database. The WCF service is transactional (which is already tested). MS-DTC is enabled. Problem is, that when the protected override void OnWriteBodyContents(XmlDictionaryWriter...

Size of a Database transaction - Number of records

Hi, I have to insert approximately 96,000 rows in a table based on certain calculations. The business requirements is to have this operation in a single transaction, i.e. either all the entries are made successful or none. I am using MySQL and I could see the operation takes much more time than expected.. I shut down the operation afte...

Acceptable Business Layer and Data Access Layer Pattern That Supports ADO.Net Transactions

I have a problem that is essentially what was briefly discussed in StackOverflow but I want to clarify the philosophy, pattern, and actual use of ADO.Net transactions. I have a .Net 2.0, VB.Net application that accesses a Sybase database using OleDB. I many cases that look something like this - starting in the DAL: Class PersonClass ...

Suggested replication type?

I have 2 similar tables in different servers, data in certain columns can only be changed by server A while data in other columns can only be changed by server B. However, I need these tables to always be consistent (1 minute schedule). Is this the kind of scenario that "Transactional replication with updatable subscriptions" solves? ...

Records write locked on a RepeatableRead

I have a SQL Server query (using the LLBL ORM, if that is important to the question) that is doing a large fetch on a set of related tables. This query is being performed in a transaction with the Isolation Level of Repeatable Read, and is being filtered by two 'state' columns in the main table of the query. Will the records being 'wri...

How do I use MySQL transactions in PHP?

I'm sorry, this is a very general question but I will try to narrow it down. I'm new to this whole transaction thing in MySQL/PHP but it seems pretty simple. I'm just using mysql not mysqli or PDO. I have a script that seems to be rolling back some queries but not others. This is uncharted territory for me so I have no idea what is goin...

Spring Transaction propagation issue

I am using Transaction management with Spring and Hibernate. My situation is as follow: I have got bean A which is sorrounded by transaction and it call bean B which is defined with transaction including the attribute 'PROPAGATION_REQUIRED' B in this case doesn't open new transaction but uses the exsiting one (saw in the logs: 'Partici...

Transaction for sequential numbering in LINQ to SQL.

I have a scenario where just before I insert a JobCard record, I need to generate an ID number (not the identity column PK), that is an increment of the last ID number in the DB. How do I wrap this in a transaction in LINQ to SQL so that no other JobCard record can be inserted between the time I select the last ID number and insert my J...

When to commit NHibernate transactions in ASP.NET MVC 2 application?

First, some background: I'm new to ASP.NET MVC 2 and NHibernate. I'm starting my first application and I want to use NHibernate, because I come from JSP + Struts 1 + Hibernate web applications. No one seems to be talking about this, so I guess it must be pretty obvious. Still I scratch my head because I can't find a solution that accomp...

How to deal with TransactionScope during debugging?

I have WebService that is hosted by ASP.NET web site. Inside the TransactionScope object is used to handle transactions: using (TransactionScope scope = new TransactionScope()) { ... scope.Complete(); } The problem is that during debugging, when I am going through each line in step-by-st...

PHP Accounting and Transaction System (Buy/Open Source or Build?)

I'm trying to integrate an accounting solution into a web app I am developing. I need to be able to post recurring transactions, one time transactions, invoice people, etc. Do most sites do this custom in-house or integrate with some type of accounting system API. I know basically everyone needs to use a merchant account to process cred...

How can I force Rails to synchronize transactions to a MySQL table across connections?

I have a high-traffic site that records web hits in a table, Hits. There's logic in place so that duplicate hits are discarded (where the definition of what defines a hit as duplicate is arbitrary for the purposes of this example). Problem: with multiple web servers running (against the same DB), two or more hits can arrive at the same ...