transactions

Spring - how to gather informations during rollbacks in declarative transaction management

Hi, Could please anybody tell me If it is safe and recommended to catch SQL and other exceptions within @Transactional methods ? When programmatic transaction management is used, I can simply catch the exception and do whatever I want, but I don't know if I don't break the transactional AOP system by catching these exceptions that would...

Do we have to have to enable MSDTC to use TransactionScope?

Do we have to have to enable MSDTC to use TransactionScope? I am using TransactionScope and I had error message telling me that the MSDTC not enabled. So I have enabled it. Why am I having this error message? Is that normal? What`s MSDTC use? Is transactionScope SQLSecver specific? ...

Hwo to configure a JDO transaction to simulate creating a database sequence in App Engine Java?

This syntax does not produce unique values across different Fetch Groups: @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) private long id; So I've written the method below to simulate generating a database sequence for my Order model. But what I'm not sure about is what the transactional state needs to be configured as here ...

Error in DataReader is not closed

Can anyone help me on how this error came up There is already an open DataReader associated with this Connection which must be closed first. the error fails when it trying to read this code. transConn = mySqlConn.BeginTransaction(IsolationLevel.ReadCommitted) Is there is a connection between the Datareader and in initializing the tr...

How to do to use different connections in Doctrine ?

Hi all, I tried to use several transactions in Doctrine (v1.2.2). Here my test: // Open a new database connection $cnx1 = Doctrine_Manager::connection('mydsn'); // $cnx1 will be named '0' // Open a second database connection $cnx2 = Doctrine_Manager::connection('mydsn'); // $cnx2 will be named '1' // Start a transaction on connection...

UserTransaction issue in java

I have existing project which uses 2 database (DB2),and the records which are saved in the 2 databases are related.So the transactions need to be maintained.Eg whenever a new thing is to be added then entries must be done to x number of tables in Database1 and and y number of tables in database2. Now in the code that is preexisting(devel...

Preferable way to write Delphi database apps with transactions & data-aware components

Hi, What is the preferable way to write Delphi database applications using transactions and also data-aware components? I have to write a client app that access InnoDB tables, and do some master-detail kind of things inside transactions. After doing some research on transactions (from general point-of-view), then I humbly make a conclu...

grails: maintain transactional context from Service to Controller

Hi Have a transaction in a grails Service class on which a rollback flag is set: TransactionAspectSupport .currentTransactionInfo() .transactionStatus .setRollbackOnly() what happens is that when we return to the Controller an exception: org.springframework.transaction.UnexpectedRollbackE...

What are locking, deadlocking issues in financial operations?

Subquestioning SQL - when should you use “with (nolock)” In one local financial institution I was rebuked by their programmers for expressing them my opinion that (their programmers' obsession with) (b)locking issues in their MS SQL Server 2005 database(s) did not make much sense to me. What are the possible issues with possible locki...

How to implement two-phase commit in a .Net REST WCF service?

I'm building RESTful web service, and I want to allow it to participate in distributed transactions. An example scenario would be that my REST service might save a file on a server somewhere, and at the same time the caller marks this file as saved in its database. However, if either the file server is full, or if his database call f...

What are the disadvantages of implementing transactions away from the database?

We know that there are some scenarios that require us to implement transactions in code, such as SqlTransaction/TransactionScope in .Net framework. The questions are: What are the overheads (besides speed)? Does it gets worse if we add more layers between the transaction and the DB? If yes, then what are the overheads and what cause ...

Else statement bug or transaction effect ?

Hi all, I'm using the following code in sql server 2005. BEGIN TRANSACTION; CREATE TABLE dbo.MyTable ( idLang int NOT NULL IDENTITY (1, 1), codeLang nvarchar(4) NOT NULL ) ON [PRIMARY]; IF @@ERROR = 0 BEGIN PRINT 'before_commit'; COMMIT TRANSACTION; PRINT 'after_commit'; END ELSE BEGIN PRINT 'before_rollback'; ROLLBACK...

Multithreaded JMS code : CLIENT_ACKNOWLEDGE or transacted session

Edited Question : I am working on a multithreaded JMS receiver and publisher code (stand alone multithreaded java application). MOM is MQSonic. XML message is received from a Queue, stored procedures(takes 70 sec to execute) are called and response is send to Topic within 90 sec. I need to handle a condition when broker is down or appli...

How to debug DTC issues?

I have a unit test for some code that occasionally throws a "The transaction has already been implicitly or explicitly committed or aborted." exception. Google gives me lots of wonderful hits but none that I've read seem to apply. If I run the unit test locally the exception is never thrown. If I run it on the build server manually the...

Controlling inner transaction settings from outer transaction with Spring 2.5

I'm using Spring 2.5 transaction management and I have the following set-up: Bean1 @Transactional(noRollbackFor = { Exception.class }) public void execute() { try { bean2.execute(); } catch (Exception e) { // persist failure in database (so the transaction shouldn't fail) // the exception is not re-thrown } } Bean2 ...

Mysql transaction question

My code: mysql_query("SET AUTOCOMMIT=0"); mysql_query("START TRANSACTION"); insert_query, update_query1, update_query2 mysql_query("COMMIT"); update_query3 Why does update_query3 query doesn't work if I put it after COMMIT? It works if I put it before the COMMIT. Why is that? It's really strange. Thank you ...

What should your transaction management strategy be for an e-commerce system?

What is the general pattern or approach to managing transactions in a web-based e-commerce system? How do you handle the situation where more than one user tries to buy the last item, for example? ...

Transaction in firebird 1.5

How to make transaction using IB Expert? I need a manual or something like begin transaction create table someTable(a int,b int) insert into someTable values(1,2) insert into someTable values(3,4) commit transaction but working in Firebird to see the syntax. ...

Can we rollback to original state after we have used DBCC CHECKIDENT to restart Identity column count ?

Currently on some operations I have to delete the old data and insert new one. But I noticed that inspite of deleting data the identity column did not reset and continued from its last max value. So i used the DBCC CheckIdent for achieve the same all this is taking place within a trasaction. Can i rollback the transaction back to the int...

jdbc transaction management : when releasing resources and distributed transactions

hello i'm a beginner java developer and this is one question in a list i'm posting since i've started porting a very old web service . I'm trying to improve the access to db and i'm finding a lot of code i believe migth be dangerous, but being not so experienced with java i cannot be sure . Actually i've a class which manages the db conn...