transactions

Isolated committing of transaction in SQL

I have a n-tier C# ASP .Net application server which uses stored procedures to communicate with the database. I have a service layer which rolls back all ADO .net transactions if an exception is thrown, using TransactionScope.requiresNew. In my stored procedure, I want to track login attempt numbers, so we want to keep the transaction...

Transactions in LINQ To SQL

I am using LINQ To SQL and calling stored procedures to insert the new rows. Does the code below demonstrate an appropriate set of steps? I want to insert (other fours) only if all four inserts are passed otherwise rollback all four inserts. public bool InsertNewInquiry(Inquiry inq) { using (var transaction = new TransactionSco...

Blocking write locks with transacted NTFS

According to the MSDN documentation, transactional NTFS doesn't seem to allow one to block on opening a file for write - instead the open operation fails with ERROR_SHARING_VIOLATION. I'd like to block on writes instead - how can I do this? Ideally I'd like the following properties for the solution: Works over a network share (so no l...

Rollback @ Stored Procedure on Oracle

I don't know if thats right but for some reason my stored procedure is not rolling back after an exception occurs. So my insert statement is commited even when i get an exception Did i forgot something? PROCEDURE SP_USUARIO_INSERT ( pUSU_IDUSUARIO IN OUT ENG.USU_USUARIO.USU_IDUSUARIO%TYPE, pUSU_CDUS...

Spring Transaction Annotations - Execute on Success

Hi, I'm using Spring application events within my service layer to notify the wider system when specific events occur. The issue I have is that the events are fired within a transactional context (I'm using Spring's @Transactional annotation). The danger is that I fire an event and then the transaction fails on commit (can happen when u...

Testing Attribute Behavior

Hi, I’m using SharpArch with SharpArch.Contrib’s [Transaction] attribute. The Transaction attribute is added to an application service method and if an exception is thrown during that method then any changes to any domain objects are rolledback. From all appearances this works well. However, I’m writing NUnit tests to confirm that ex...

Using TransactionScope with System.Data.OracleClient - TransactionAbortedException

My system write some data to a SQL Server DB (2008), extracts it later and processes it some more, before writing it to an Oracle (10g) DB. I've wrapped my SQL Server interactions in a TransactionScope but when I try the same think with my Oracle interactions I get a `TranactionAbortedException - "The transaction has aborted". Remove ...

.NET: Serialize objects into transactional environment

I need a way to serialize objects in a transactional context. Given the following pseudo-code: transation.Begin() try{ serializeObj(obj1); serializeObj(obj2); serializeObj(obj3); } catch(Exception){ transaction.RollBack(); } transaction.Commit(); I want that, after this code runs, or all the objects had been serialize...

Oracle transaction isolation

hi, I have a method SaveApp() which will deactivate the existing records and insert a new one. void SaveApp(int appID) { begin transaction; update; insert; commit transaction; } Let's say in database table SalesApp, I have 2 records with appID equal to 123; record 1, appID 123, inactive record 2, appID 123, active I...

Why NHibernate auto-truncates instead of throwing an exception on save?

Hi, I have been studying the Summer Of NHibernate Tutorials and when I have reached the Session 04: Exploring Transactions and Concurrency -just like in the tutorial- I wanted to create a SAVE test which should fail because of an invalid object. The purpose is to test if it can rollback the transaction properly. Idea is to create an i...

Lost transaction with JPA unique constraint?

I have a field with an unique constraint: @Column(unique=true) private String uriTitle; When I try to save two entities with the same value, I get an exception - but another exception than I exected: java.lang.IllegalStateException: <|Exception Description: No transaction is currently active at org.eclipse.persistence.interna...

Connection pool problem with Spring and programmatic transaction management

Hi everyone ! I need your help in order to solve connection pool problem with Spring. I’m using Spring with Java 1.4 (no annotation). Here is the datasource and the connection pool definition: <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> <property name="driverClassName"> <...

Find previous value of a DB record from transaction logs?

Trying to track down a bug in an application, but need to confirm whether a column value was changed on a particular record in SQL 2005. How can I query the transaction logs for the record's previous column values? ...

Spring @Transactional wrapping 2 methods

Hello I'm a Spring newby. I use the @Transactional annotation for my dao methods: @Transactional public Person getById(long id) { return new Person(jdbcTemplate.queryForMap(...)); } @Transactional public void save(Person person) { jdbcTemplate.update(...); } and I've set up the transaction manager like this: <tx:annotation-...

NServiceBus: Aren't MSMQ Transactions BAD?

I am learning about NServiceBus and MSMQ. I was told that transactional queues in MSMQ are BAD and using them is really bad for performance. Does anyone know why? I am guessing this comes from the notion that it uses DTC and everyone knows that the DTC is not really a scalable solution. It seems to me that there are a couple of reaso...

How do I set the transaction isolation level in SQLAlchemy for PostgreSQL?

We're using SQLAlchemy declarative base and I have a method that I want isolate the transaction level for. To explain, there are two processes concurrently writing to the database and I must have them execute their logic in a transaction. The default transaction isolation level is READ COMMITTED, but I need to be able to execute a piece ...

WF4: Persistance and DTC

Hi ! I'm building a workflow host that will manage WorkflowApplication instances. Instances will use SqlWorkflowInstanceStore. Tables and logic for SqlWorkflowInstanceStore are in the same database as my other tables and logic that I'm writing into with persistence participants. I'm not using AppFabric. My question is: do I need DTC...

SQL Server: rollback after insert that contains an output inserted fails mysteriously.

A rollback after an insert that contains an output statement fails with "The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION." If the output statement is removed, then it works. Is there an explanation for this behavior? Example: create table test(i integer primary key) go begin transaction insert into test (i) va...

How do I ensure data integrity for objects in google app engine without using key names?

Hi- I'm having a bit of trouble in Google App Engine ensuring that my data is correct when using an ancestor relationship without key names. Let me explain a little more: I've got a parent entity category, and I want to create a child entity item. I'd like to create a function that takes a category name and item name, and creates both ...

Simple Transactions

I have 2 linq 2 SQL statements I'd like to be in a transaction (the SQL server is remote, outside firewalls etc) all other communication works but when I wrap these 2 statements in a TransactionScope() I begin having to configure MSDTC which we did, but then there are firewall issues (I think) is there a simpler way? the basics of what ...