transactions

Spring @transactional does not start a transaction while testing with JUnit4

I have following configuration. <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5....

Grails: Declarative Transactions

class ExtHotelApiService extends HotelApiService { static scope = "singleton" static transactional = true def save(params) { params.hotels.each{ht-> try{ transactionalSave(ht) } catch(Exception e) { /* exceptions handling */ } } } @Transactional(readOnly = false, propagation = Propagation.REQUIRES_NEW, rollBack...

Correct replacement for ExecuteScalarInTransaction Subsonic 2.2

I'm upgrading an application from Subsonic 2.0.3 to the latest 2.2 version. What's the best practice way to replace the ExecuteScalarInTransaction(command, transation) method? Here's a sample of a method I'm replacing: public static void ActivateAccount(int parentId, int childId, int playMode) { SqlConnection conn1 = DataUtil.Get...

"Journaling" or "transactions" design pattern?

I'm looking to implement an object that is journaled, or has a persistent transaction in it. That is, the object contains data (a Map perhaps). As changes are made to the data, those changes are held separately, sandboxed if you will, so that any outside object can either reference the base state (before the changes) or can access the la...

Problem implementing declarative transactions

Hi I want to implement transaction control at the function level. What i want is something like this. class MyService{ static transactional = false @Transactional(readOnly = false, propagation = Propagation.REQUIRES_NEW) public def saveCountry(){ Country co = new Country(name:'mycountry') co.save() createState...

Block a row from reads whilst sp executes

Hi, I have many .NET processes reading messages from an SQL Server 2008 DB table and processing them one at a time. I implement a simple SP to 'lock' the row that is being read by any one process, to avoid any two processes processing the same row. BEGIN TRAN SELECT @status = status FROM t WHERE t.id = @id IF @status = 'L' BEGIN ...

How to get a real time within PostgreSQL transaction?

As far as I understand now() returns the same time during the whole PostgreSQL transaction? But how to get real time? Also, I am interested if there any configuration parameter to limit duration of transaction, so that after this period expiration transaction would immediately fail or somehow else prohibit following queries? ...

SqlException timeout causing TransactionInDoubtException

A TransactionInDoubtException is being thrown, the cause is a SQLException due to a SQL Timeout. But I don't understand the connection. Any tips on how to make the create a SQLException for a timeout appreciated too. How can a SQLException cause a TransactionInDoubtException? Is it because the TransactionManager has DB stuff to close b...

short and easy question on spring nested transactions

Hi, If I have the transactionable methods A,B,C and A calls B,C ; then, C throws exception that is not caught inside A. My question is if B will be rolled back or not? Please note that nested transactions are disabled by default so A, B, C are all transactionable by themselves. Thanks ...

Alter Table in SQL Server Transaction

I'm trying to write this transaction where I'm trying to add a column to a table using TRY..CATCH and TRANSACTION. Here's my code. But the problem is the column already exists in the table and the catch block should execute, but the catch block is not executing and the transaction is not being rolled back and also the select error_number...

iPhone view navigation problem

Hi, i've a 3 views based app. To navigate from different views i use the delegate method, for example in the second view i've a delegate which is the reference to the first view and when i want to pass from the second to the first view, i call a method of the delegate which made a simple : [self dismissModalViewControllerAnimated:YES]; ....

Container Managed Transactions (CMT) for Web Services in JBoss

I'm exposing my EJBs (3.0) as Web Services deployed to JBoss AS 5.1 (using annotations @WebService ,etc). I 'm very satisfied with JBoss's transaction management, especially automatic rollbacks on exceptions. My question is, will Web Service endpoints also behave the same way as remote/local EJBs? or would I lose the Container Managed T...

How should I skim money off a transaction between 2 people on my site?

This is sort of not relevant to programming but I think it also is: MY site is being built around people selling products through the site and customers buying the product through it. I'll then shave a % off the top of the sale. As far as skimming a % of the sale off the top, what is the order of events that should take place to do tha...

(hibernate) table altered after failed commit

I'm new to hibernate. I have a transaction that fails with a HibernateException, yet the table is altered after the commit. Here is the code: public StoreResult store(Entry entry) { Session session = HibernateUtility.getSessionFactory().openSession(); Transaction transaction = session.beginTransaction(); try { ...

Transaction in VS2008 and SQL Server 2005 Stored Procedure

If I'm already using transactions in my stored procedure, is it feasible to use transactions in VS 2008 to call the procedure multiple times? What I am trying to do is re-use my insert single record stored procedure which already uaes transactions. I want to insert multiple records using this insert single record stored procedure, and r...

Auction style transaction on GAE and BigTable

Hello, what would be the best way to create mechanism that ensures that for example: Two people won't buy same item at the same time in auction based on GAE application using BigTable? If someone could enlighten me with "under the hood" kind of description I would be grateful. ...

ADO.NET Transaction does not enlist commands after first connection is opened and closed

I'm having trouble with using an Oracle Global Temporary Table on one of our servers. Here's the details of what I'm trying to accomplish. Create OracleConnection. Begin an OracleTransaction from that connection. Create an OracleCommand to insert a single value into an Oracle global temporary table (GTT). e.g. insert into MY_GTT (SO...

Serializable transaction appropriate for this scenario?

edit: SQL Server 2005 I have a customer application running on 5 separate servers. Each application is looking at a single scheduling table. I want to be sure that no machine can access the same record at the same time as any other machine. Each server is capable of processing 1 row only at a time. Basically, the application just se...

Doctrine : Rollback failed. There is no active transaction.

Rollback failed. There is no active transaction. I am getting the above error when i tried to rollback. I googled the issue and few suggested to disabling the autocommit..... How do we disable autocommit? Is there any other reason for the above error? I am using MYSQL and Zend and my php.ini file loaded the required drivers Thanks i...

How .NET Transactions are working on Sql Server Database When conducted a small analysis

I did a simple test to understand how transactions work in .net Sample code on which my transaction test was done is _sqlHelper = new SqlHelper(true); try { _sqlHelper.ExecuteNonQuery(SpName.sp_UpdateRoomStatus.ToString() , Parameters.SqlParam<int?>("DepartmentId", this.DepartmentId, SqlDbType.Int) ); _sqlHelp...