transactions

Store LAST_INSERT_ID() in a transaction

Hi, I use codeigniter's database abstarction, and im doing a transaction with it. My problem is, that i have several inserts into several tables, but i need the insert id from the first insert query. Is there any way to store the last insert id for more than one following insert? I don't understand why, but the ci built in function doe...

Execute Statements in a Transaction - Sql Server 2005

hi, i need to update a database where some of the table have changed (columns have been added). I want to perform this action in a proper transaction. If the code executes without any problem then i will commit the changes otherwise i will rollback the database back to its original state. I want to do something like this: BEGIN TRANSA...

Declare global variables for a batch of execution statements - sql server 2005

hi, i have an SQL statement wherein i am trying to update the table on the client's machine. the sql statement is as follows: BEGIN TRANSACTION DECLARE @CreatedBy INT SELECT @CreatedBy = [User_Id] FROM Users WHERE UserName = 'Administrator' --////////////////////////////////////////////////////////////...

How to detect a pending JDO transaction?

I believe I am getting JDO commit Exceptions due to the transactions nesting although I'm not sure. Will this detect the situation where I am starting a transaction when another is pending? PersistenceManager pm = PersistenceManagerFactory.get().getPersistenceManager(); assert pm.currentTransaction().isActive() == false : "arrrgh";...

How can I save information to my database when information is to be saved in different tables?

I have to save the following variables to a database: string PoliciaID = Session["username"]; string PlacaAuto = Page.Request.QueryString["placaauto"]; string Carnet = Page.Request.QueryString["carnet"]; string Fecha = DateTime.Now; string TipoInfraccion = Page.Request.QueryString["tipo"]; Polic...

Transactions in MVC asp.net

Hi, Was wondering if there are any transactions support in asp.net for MVC 2? i.e. commit & rollback? I have a few slightly risky db transacts which i'd prefer firmed up with transactions. could the system transactions namespace be incorporated into a respository of db calls? ...

Atomikos vs JOTM vs Bitronix vs ????

I am new to JTA and it's underlying transaction managers. Can anyone explain the pros/cons of each of these? Feel free to add others I didn't list in title. Also, don't the major applications servers (WebSphere, JBoss, Glassfish) have their own JTA compliant transaction manager? In those environments, would you still use these third p...

"Undoing deletes" in webapplication?

Hi everybody, I have seen more and more of the websites that offers a undo option after pressing a delete button. How is the logic done behind the button? Is the item deleted by javascript and "dissapears" from the users screen and a scheduled delete added, that gives the user time to undo it or how does it work? What are the other op...

ADO.NET zombie transaction bug? How to ensure that commands will not be executed on implicit transaction?

e.g. When deadlock occurs, following SQL commands are successfully executed, even if they have assigned SQL transaction that is after rollback. It seems, it is caused by a new implicit transaction that is created on SQL Server. Someone could expect that ADO.NET would throw an exception that the commands are being executed on a zombie tr...

How to set the transaction isolation level of a

How do I set the global transaction isolation level for a postgres data source. I'm running on jboss and I'm using hibernate to connect. I know that I can set the isolation level from hibernate, does this work for Postgres? This would be by setting the hibernate.connection.isolation hibernate property to 1,2,4,8 - the various values o...

Two Phase Commit with IEnlistmentNotification interface

When Commit is called (for the implementation of IEnlistmentNotification) can I just throw an exception to indicate I want the transaction to rollback? ...

Spring transactions not committing

I am struggling to get my spring managed transactions to commit, could someone please spot what I have done wrong. All my tables are mysql InnonDB tables. My RemoteServiceServlet (GWT) is as follows: public class TrainTrackServiceImpl extends RemoteServiceServlet implements TrainTrackService { @Autowired private DAO dao; @Override ...

Rolling back call to stored procedure in MySql

I have a scenario where I need to insert, call and drop a stored procedure in several databases. This is done in a powershell script. I want to be able to roll back the changes made by the stored procedure if some situations occur further down the in the script. The problem is that I'm not able to roll back the changes made by the stor...

How Serializable works with insert in SQL Server 2005

G'day I think I have a misunderstanding of serializable. I have two tables (data, transaction) which I insert information into in a serializable transaction (either they are both in, or both out, but not in limbo). SET TRANSACTION ISOLATION LEVEL SERIALIZABLE BEGIN TRANSACTION INSERT INTO dbo.data (ID, data) VALUES (@Id, data) INSERT I...

Looking for solutions to book exercises of: "Transactional Information Systems"

Hello, I'm trying to learn more about transactions. I bought the following book: "Transactional Information Systems: Theory, Algorithms, and the Practice of Concurrency Control and Recovery" von Gerhard Weikum und Gottfried Vossen, Morgan Kaufmann Publishers, 2001. Unfortunately there are no solutions to the exercises in the book. I ...

Is automatic rollback of DAO integration tests with Spring Test a good practice?

If I were to annotate my DAO integration test methods with @Transactional, Spring Test will happily rollback any changes to the database after each test methods completes. These seems extremely convenient, because I can load the test data once with a @BeforeClass method and all clean up is handled for me. But I question whether this is...

What is the purpose of Managers / Transactions?

I'm building a spring application for the first time. I'm running into lots of problems with concurrency, and I suspect that there is something wrong with the way I'm managing the backend. The only difference I can see between my backend code and examples I've seen are manager classes. In my code, I have my model (managed by hibernate) ...

INSERT and transaction serialization in PostreSQL

I have a question. Transaction isolation level is set to serializable. When the one user opens a transaction and INSERTs or UPDATEs data in "table1" and then another user opens a transaction and tries to INSERT data to the same table, does the second user need to wait 'til the first user commits the transaction? ...

Atomic operations on several transactionless external systems

Say you have an application connecting 3 different external systems. You need to update something in all 3. In case of a failure, you need to roll back the operations. This is not a hard thing to implement, but say operation 3 fails, and when rolling back, the rollback for operation 1 fails! Now the first external system is in an invalid...

Transaction management with multiple models using single transaction commit and rollback

I am new to cakephp. I want to know if it is possible in cakephp to to handle multiple model commit and rollback with single transaction. I want to do some thing like this <?php function add(){ $transaction = begintransaction; if(model1->save()){ if(model2->save()){ if(model3->save(){ } ...