transactions

Is there an open-source solution to XA-transactional file access in Java?

Hi, Is it possible to make XA-transactional access to the file system in Java? I want to manipulate files within the boundaries of a transaction and my transaction must participate in a distributed transaction via JTA (so I guess the file system needs to be accesses as a XAResource). I don't need support for fine-grained read/write fil...

How to ensure that only table row will be created with a particular state ?

I have a domain object that looks something like this: class UserStuff { String userid; boolean primordial; } In the table, primordial is a TINYINT. A User can have possibly many UserStuff. What I want to ensure is that only one row (the first row created) will have primordial == 1. All subsequent rows will have primordial ==...

How to name the following pattern based on messaging and unit of work (XA)?

I'm having a difficulty with naming the pattern used commonly by the application I've been working on for a while. Just to set the scene: this is a JEE application that uses messaging (JMS) a lot, persist data in relational database (JDBC) and relies on global transactions (XA) managed by the application server (JTA). The pattern I'm ta...

java servlets: better way to do multiple inserts and locking tables?

I'm currently running the follow code segment in a java servlet using the suggested PareparedStatement class. It is currently inserting inventory data into a SQL Server database of an accounting system. I have two problems. Because the insert statements insert data into 3 different tables, should I move these sql statements to tsql ...

Hibernate calls flush on find- causes not-null error

Hi I have a process which updates a tree to the database, and in doing so, performs reads to check for duplicates entities. I'm finding that trying to do a criteria.uniqueResult() midway through this process causes the following error: org.hibernate.PropertyValueException: not-null property references a null or transient value ...

Is there a way to test a potential zombie transaction to see if it can be rolled back?

If a sql call fails, say to timeout due to deadlock, the transaction can turn into a zombie transaction-- I guess either my code or framework code does the rollback. The SqlTransaction isn't null, but it is a zombie can throws an error if you try to do a Rollback(). I can't find the .IsZombie property. // Make sure the transaction is ...

What happens if a message is rolled back in MQ?

Hi, I receive a message from a WebSPhere MQ queue. I try to process and if i receive some exceptions i want to rollback the message to the MQ Queue. I have no problems in doing the same. What happens to the message? Does it go to the bottom of the queue? If i try and pull a message from the queue would i receive the same message that ...

Using transactions with subsonic

In my web application I've to keep audit of the user actions. So whenever user takes an action I update the object on which action is taken and keep audit trail of that action. Now If I first modify the object and then update audit trail but the audit trail fails then what? Obviously I need to roll-back changes to modified object. I c...

Transaction with Read Committed Isolation Level and Table Constraints

Does table constraints execute in the same transaction? I have a transaction with Read Committed isolation level which inserts some rows in a table. The table has a constraint on it that calls a function which in turn selects some rows from the same table. It looks like the function runs without knowing anything about the transaction ...

How can you enable transactions with IBM.Data.DB2.iSeries for stored procedures

I am trying to write a client which executes a series of DB2 iSeries Stored procedures in DB2. I am using the IBM.Data.DB2.iSeries provider and need all my calls to be within a .NET transaction. Seems like everything is ignored and data being committed.Any pointers... ...

Do I really need to use "SET XACT_ABORT ON"?

if you are careful and use TRY-CATCH around everything, and rollback on errors do you really need to use: SET XACT_ABORT ON In other words, is there any error that TRY-CATCH will miss that SET XACT_ABORT ON will handle? ...

SSIS Transactions - Large Record Sets

I am wondering how SSIS deals with transactions with large data sets. I have a 'large' data set of about 150,000 rows, each of which needs to be validated against business rules as part of an ETL from a staging database to the live database. If any of the records fail their business rules, no records should end up in the live database (...

EnterpriseServicesInteropOption for .NET to COM+ call

I need to carry out some database updates, part of which will go through a COM+ component (that will be enabled for transactions), and others through standard LINQ to SQL, and I want both updates to part of one transaction. I intend to use a TransactionScope to allow .NET and COM+ transactions to synchronise. However having read the doc...

Row insertion order entity framework

I'm using a transaction to insert multiple rows in multiple tables. For these rows I would like to add these rows in order. Upon calling SaveChanges all the rows are inserted out of order. When not using a transaction and saving changes after each insertion does keep order, but I really need a transaction for all entries. ...

Transaction Action with Ruby On Rails

I have a complex action inside controller that performs several update queries to the database. How can I make this action acts like transaction without any structural refactoring? ...

Is it possible to do mysql database transactions and rollbacks with php?

example: making a payment transfer from user A to user B. Account of user A: -10 USD Account of user B: +10 USD if there is an transaction, and something goes wrong, everything gets undone. So with transactions it will not happen that account of user A gets decreased by 10, while account of user B does not get increased by 10. I know t...

Is there a way to use TransactionScope with an existing connection?

I have some code that works like the advised use of TransactionScope, but has an ambient connection instead of an ambient transaction. Is there a way to use a TransactionScope object with an existing connection, or is there an alternative in the .Net framework for this purpose? ...

Transactions .NET

I've just begon using Transactions in .NET and I have a problem. In a function (in my DAL) I use a transaction scope. On the end of the function I trigger the Complete() function. Now I have a test for this function which also uses a transaction scope. On the end of this test function I do not trigger the complete() function so that my...

Using TransactionScope with MySQL and Read Lock

I have the following situation: If have a MySQL db with a InnoDB table which I use to store unique numbers. I start a transaction, read the value (eg. 1000471), store this value in another table and update the incremented value (100472). Now I want to avoid that somebody else even reads the value while my transaction is running. If I w...

How do you access data that has been inserted using a ADO.NET transaction?

I'm trying to get the data that has been successfully input into the database via ADO.NET transaction. Once you've called trans.Commit() there doesn't seem to be a way of getting back the data that has been committed since all identity columns that were created during the transaction are 'virtual' since it is an offline dataset until co...