transactions

database transactions and threads

I have functions lock(), unlock(), query1(), query2() and query3(). The query functions just run some query on a database and can be considered r/w access to it. They do not lock. My system is multithreaded. The functionality I want is: If lock() is called from thread p1, only queries from thread p1 will run and queries from all other t...

Django admin: turning off DB transactions

I noticed that by default, all updates in the django admin site are done as transactions. I need to either: - turn off transactions (globally or for a particular admin view) - inside of a save() method of an entity being saved via the admin interface, commit the transaction The reason is that I overrode the save() method, and am noti...

WCF Transactions over the Internet

I know this is a complex WCF configuration issue, but here is a high level question: Does WCF support Transactions over the Internet without SSL? All of our service methods are decorated with the TransactionFlow attribute, e.g.: [TransactionFlow(TransactionFlowOption.Mandatory)] This forces the caller to supply a transaction context...

AOP, Spring and transaction scoping

Hi, imagine a transactional, multithreaded java application using spring, jdbc and aop with n classes in m packages all taking part in database transations. Now let's say there is the need to scope an arbitrary set of classes within one transaction. Furthermore there is always one class T within the scope that commits the transaction whe...

Session.Transaction changes after Rollback (NHibernate)

I have the following code (simplified for the sake of discussion). What I don't understand is why the session.Transaction property returns a different transaction after a rollback. For instance, this means that the property Session.Transaction.WasRolledBack is of little help unless I store a reference to the first transaction and check...

Unable to enlist in a distributed transaction with NHibernate

I'm seeing a problem in a unit test where Oracle is thrown an exception with the message "Unable to enlist in a distributed transaction". We're using ODP.net and NHibernate. The issue comes up after making a certain number of commits to the database inside nested transactions. Annoyingly, this is failing on the continuous integration ser...

software transactions in c#

I have some C# code that needs to work like this D d = new D(); foreach(C item in list) { c.value++; d.Add(c); // c.value must be incremented at this point } if(!d.Process()) foreach(C item in list) c.value--; It increments a value on each item in a list and then tries to do some processing on them. If the proces...

Is there a way to force PHP into waiting until MySQL is finished with a transaction?

I'll admit I'm not 100 % on the inner workings of PDO and MySQL, so I'll give an example to make my question clearer. I'm making a rather crude browser based strategy game, because I think it's a fun way to learn PHP and databases. I was bug-testing the battle script when I came across a rather unexpected bug. I use Cron Jobs to call a ...

Executing a SQLCommand Without Specifiying a Transaction

Hi, I feel like I should be able to find the answer to this question but for the life of me I can't seem to get the information I'm looking for. We have some lists of data being fetched in our application via a SqlCommand performing a SELECT query on a SqlServer database. We do not explicitly setup a transaction on the SqlCommand, ins...

easy transactions using spring jdbc ?

I am working on a java app that uses Spring IOC and JDBC Template classes. I have a DAO class that has 4 methods : m1() to m4(). m1 performs multiple inserts and updates on table t1, m2 on table t2, m3 on t3, etc. The dao methods are used as follows: while(true) { //process & generate data dao.m1(data1); dao.m2(data2); dao.m3(...

Alternate to SqlTransaction exposing Events - C# ?

Hi, I want to perform some logging when a SqlTransaction is committed or rolledback. I see that SqlTransaction class does not expose any such events like OnCommit or OnRollback. damn! SqlTransaction class is sealed, I cant help it out with inheritance. Now, what must be the reason they have not allowed these events to happen ? Is th...

Per-session transactions in Django

I'm making a Django web-app which allows a user to build up a set of changes over a series of GETs/POSTs before committing them to the database (or reverting) with a final POST. I have to keep the updates isolated from any concurrent database users until they are confirmed (this is a configuration front-end), ruling out committing after ...

Does MSCRM web-service support database transactions?

One would assume with any web-based data application that database transactions would be an integral part of the design. Looking around at CrmService, I can't find anything that suggests that transactional 'CRUD's are available. Is it the case that this is not supported/implemented in MSCRM? If it is, and i have missed it, could someone ...

Pass current transaction or use DependentClone?

I have a WinForm application which uses SqlServer CE 3.5 as database. I use typed dataset queries for db operations. I need to use transactions for this operations. The problem is, they're scattered across different assemblies. My question is, what should I use to run all of them in a single transaction? Here's an example operation: //t...

SQL Scripts from dotnet with transactions

I have been trying to execute sql scripts from dotnet (C#) but the sql scripts could contain GO statements and I would like to be able to wrap the collection of scripts in a transaction. I found this question and the accepted answer got me going for handling the GO statements, but if I use a BeginTransaction it throws a InvalidOperation...

Controlling NHibernate ITransaction with StructureMap?

I'm using StructureMap as my IoC container and NHibernate as my ORM. I found an example online that shows how to have StructureMap build the ISessionFactory and the ISession so the Factory is a singleton and the Session is based on the HttpContext. This works great, but then I started using NH Profiler which told me I should always be ex...

Transaction

In explicit transaction, if i start the transaction by giving BEGIN TRANS but if i dont give COMMIT,ROLLBACK or END TRANS then what will happen to the application? ...

Why is an insert of 1M records slower without a transaction than inside a transaction?

I am doing some performance tests using .Net 3.5 against SQL Server. I am doing an insert of 1 million records. When I wrap this inside a transaction (either serializable, RepeatabelRead or ReadUncommited) it runs in under 80 seconds on my system. When I remove the transaction it runs in roughly 300 seconds. I would expect that using no ...

Is it possible to run multiple DDL statements inside a transaction (within SQL Server)?

Hi, I'm wondering if it is possible to run multiple DDL statements inside a transaction. I'm specially interested on SQL Server, even though answers with other databases (Oracle, Postgre at least) could also be interesting. I've been doing some "CREATE TABLE" and "CREATE VIEW" for the created table inside a transaction and there seems ...

What's the difference between an SQL transaction at the stored procedure level and one at the SqlConnection level?

Say a stored procedure on MSSQL Server uses an SQL transaction using BEGIN TRANSACTION/COMMIT TRANSACTION, how does that differ from beginning and commiting one using ADO.NET via SqlConnection.BeginTransaction()? ...