transactions

Rails transaction: does it matter on which ActiveRecord model class?

When I have 2 objects to save inside a transaction a = A.new(...) b = B.new(...) Does it matter on which model class I invoke the transaction method? A.transaction do a.save b.save end or B.transaction do a.save b.save end IMNO both use the same db transaction, because ActiveRecord can only handle one connection, thu...

How does EHCache implement its transactions?

Hi, The question might sound vague but I'm trying to understand the general concept of the EHCache transaction ability. Assuming I configure EHCache as a memory cache and I also configure it to cache a MyObject. Does EHCache clone the instance of MyObject I'm retrieving if this is done as a part of a transaction? I'm mainly asking bec...

Did anybody use WS-AtomicTransaction protocol to propagate transactions in WCF over the Internet?

Hi, Just curious, did anybody use WS-AT protocol to propagate transactions in WCF over the Internet in production(wsHttpBinding)? Is it hard to deploy/support? Is it a good approach to keep a WS-AT port open? Or maybe it is better to have a custom solution to support transactions? What do u think? ...

Nested procedures with transactions

Hi! I have the following problem. I have to stored procedures (debug messages double-indended): CREATE PROC innerProc AS BEGIN SELECT 'innerProc 1',@@TRANCOUNT BEGIN TRAN SELECT 'innerProc 2',@@TRANCOUNT ROLLBACK SELECT 'innerProc 3',@@TRANCOUNT END GO ----------------------------------------- CREATE...

Error: Timeout expired with transactions, MySql and Asp.net

I have a Asp.net web service that I connect to and that insert, update or delete max 30 rows in a large MySql table using transaction to make the process faster. The whole process should just run in a few secs. Sometimes I can see in the logs that the user gets error: Timeout expired. The timeout period elapsed prior to completion of th...

SQL Server, C#: Timeout exception on Transaction Rollback

Hey guys, I've got a strange problem. I have a .NET program and my process logic needs a long-running transaction (~20min) on a SQL Server 2005 database. That's ok, since nobody accesses the database in parallel. When something goes wrong, the transaction should be rolled back. Infrequently and without any visible pattern the Rollback(...

Spring transactions & hibernate: lazy initialization

From what I've read so far I had the understanding that using transactions would be the solution to hibernate's lazy loading problems. The session would be available during the whole transaction in the service layer without further adue. So maybe I misconfigured my transaction management? I'm actually a newb when it comes to spring and ...

Hibernate creates too many connections using @Transactional, how to prevent this?

Hello there, I'm fairly new to Hibernate and PostgreSQL, but so far it's going well, although I'm running into a problem now that I can't solve. I'm getting an error while filling the database on the very first operation (which is one transaction inserting or updating 1000 rows in the database). The error is: SQL Error: 0, SQLState: ...

SQL Server 2008 Transaction, rollback required?

Hi, I have a stored procedure that has a BEGIN TRANSACTION and COMMIT TRANSACTION statement. Within the transaction is a select query WITH(XLOCK, ROWLOCK). The transaction can potentially fail due to some calculations that cause an arithmetic overflow error if out of bounds values are supplied. This error would happen before any inser...

How can i do transaction between remote services ?

I have to do 2 job which is on remote services not belongs to me.I have to register or upgrade a product on first remote service and i have to get payment via VPOS on second service. Is it possible to make a kind of transaction in this case ? ...

When to use MessageQueueTransaction for simple cases?

I'm new to MSMQ and trying to understand when to use MessageQueueTransaction class. For example, is there any value to create a simple transaction just for putting a message in the MSMQ queue like this? using (MessageQueueTransaction t = new MessageQueueTransaction()) { t.Begin(); Message m = new Message(myString, formatt...

Aren't multiple transactions supposed to concur with em.getTransaction()?

When I execute: public void beginTransaction() { em.getTransaction().begin(); } following an active transaction started in the same way, I get the following exception: Exception Description: Transaction is currently active java.lang.IllegalStateException: Exception Description: Transaction is currently active at ...

SQL Server transactions / concurrency confusion - must you always use table hints?

When you create a SQL Server transaction, what gets locked if you do not specify a table hint? In order to lock something, must you always use a table hint? Can you lock rows/tables outside of transactions (i.e. in ordinary queries)? I understand the concept of locking and why you'd want to use it, I'm just not sure about how to implemen...

Why UPDATE blocks SELECT on unrelated rows?

Having the table, defined by script [1], I execute scripts in 2 windows of SSMS --1) first in first SSMS window set transaction isolation level READ UNCOMMITTED; begin transaction; update aaa set Name ='bbb' where id=1; -- results in "(1 row(s) affected)" --rollback and after 1) --2)after launching 1) select * from aaa --de...

How to make sure changes in the database that happen within a transaction are also seen by everything within that transaction

I've got a transaction that saves or updates a set of objects in a database. This is the code: @Transactional public void updatePDBEntry(Set<PDBEntry> pdbEntrySet) { for (PDBEntry pdbEntry : pdbEntrySet) { PDBEntry existingEntry = findByAccessionCode(pdbEntry.getAccessionCode()); if (existingEntry != null) { ...

Send mail as transactionally as possible

Hi all, I have a simple program that polls a DB table every so often and sends any mail that the table indicates is pending (using javax.mail). When the mail is sent I delete the DB entry. I have noticed two potential problems There's the potential to send a mail and then something crashes so the DB entry is still there. The next t...

In PHP, can I get MySQL to rollback a transaction if I disconnect without committing, rather than commit it?

If I run the following PHP, I would expect no value to be inserted into the test table, because I have a transaction that I haven't committed: $db = mysql_connect("localhost","test","test"); mysql_select_db("test"); mysql_query("begin transaction;"); mysql_query("insert into Test values (1);") or die("insert error: ". mysql_errror()); d...

Is it a recommended practice to send SMTP from with a C# TransactionManager transaction scope?

Trying to troubleshoot a questionable plugin a client is experiencing issues with in production, and one possible issue I see is the fact that they're sending SMTP synchronously from within our heavily-transacted C# web application. In the past I believe I've read or been told that sending SMTP synchronously from within a transaction is ...

performing mysql transactions with master and slave setup?

how do you deal with transactions when you have master and slave db setup? typically i do all the reads from slaves and writes from master but when performing transactions, it seems i need to do reads from master (the one which is performing the transactions) and so i can't have all my transactions all in one place ... im also using ze...

Debugging transactions in Java EE

I have an @Stateless EJB method in which I delete some entries from a database using JPA remove()'s throw an Exception that is annotated as @ApplicationException(rollback=true) I have no other transaction-specific annotations for the method (I set @TransactionAttribute(TransactionAttributeType.REQUIRED) but that should be the defau...