transactions

Sequences not affected by transactions?

I have a table create table testtable( testtable_rid serial not null, data integer not null, constraint pk_testtable primary key(testtable_rid) ); So lets say I do this code about 20 times: begin; insert into testtable (data) values (0); rollback; and then I do begin; insert into testtable (data) values (0); commit; And f...

Hibernate MySQL transaction configuration issue

I'm having trouble starting a transaction with Hibernate and MySQL while running in JUnit. I'm getting a HibernateException which states: "No TransactionManagerLookup specified". I believe this error is because I don't have a proper configuration setting for hibernate.transaction.manager_lookup_class. I see that under the namespace of ...

ADO.NET Transaction and SQL Server 2008 Transaction

Hi. If i run stored procedure in ADO.NET with transaction enabled and SP begin its own transaction inside(with COMMIT TRANS). What happens when ADO.NET rollback transaction? Is transaction from SP rollbacked as well? Is DB in state as it was before calling ADO.NET? Thank you. ...

One active IB transaction the whole lifetime of a single user application

Are there any negative impacts when a single user application uses only one IB transaction, which is active as long the program runs? By using only CommitRetaining and RollbackRetaining. Background: I want to use IBQuery(s) and connect them to a DB Grid(s) (DevExpress), which loads all records into memory at once. So I want to avoid re-...

Spring programmatic transaction with parameter

I'm working on some data access logic with Spring, my question has to do with transactions. The transaction documentation http://static.springsource.org/spring/docs/2.5.x/reference/transaction.html shows that you can implement declarative or programmatic transactions. I've chosen to use the programmatic approach so that I have finer cont...

SqlException from Entity Framework - New transaction is not allowed because there are other threads running in the session.

I am currently getting this error: System.Data.SqlClient.SqlException: New transaction is not allowed because there are other threads running in the session. while running this code: public class ProductManager : IProductManager { #region Declare Models private RivWorks.Model.Negotiation.RIV_Entities _dbRiv = RivWorks.Mode...

Transactional objects in .NET

Hi! In user interfaces there is often a need to implement a cancel button when editing some entities. In WPF it would be nice if you could make your view model transactional. I will try to explain a little bit more in detail what I mean: The view model is connected to the model and exposes data in a way that's easier to handle for the ...

Does Hibernate auto-rollback programmatic transactions when unhandled exception occurs?

When working with programmatic transactions in Hibernate, is it necessary to explicitly call rollback if an exception occurs, or will the framework take care of calling rollback if there is an unhandled exception? The code below seems like the safe approach (albeit ugly code) to ensure rollback, but i'm wondering if there is a more elega...

Insert takes too long, code optimization needed

I have some code I use to transfer a table1 values to another table2, they are sitting in different database. It's slow when I have 100.000 records. It takes forever to finish, 10+ minutes. (Windows Mobile smartphone) What can I do? cmd.CommandText = "insert into " + TableName + " select * from sync2." + TableName+""; cmd.Execute...

Transactions in Castle ActiveRecord + NHibernate for dummies

I would like to do the following, all in a single atomic transaction: Read an object through ActiveRecord Save a new object through ActiveRecord Update another table via NHibernate Also, if by the time I finish the transaction, the value of the object I've read in step 1 has changed, I would like the transaction to fail. I've never ...

The Integrity of linked data entities on update

What is the best-practice for maintaining the integrity of linked data entities on update? My scenario I have two entities "Client and Invoice". [client is definition and Invoice is transaction]. After issuing many invoices to the client it happens that the client information needs to be changed e.g. "his billing addres...

Java: Rollback Database updates?

I have three methods that, together, save a node to the database. Currently, this does not achieve the desired effect of not committing the changes unless all the writes are successful. conn.setAutoCommit(false); writeNodeTable(node, newNodeNID); writeContentTypeBoutTable(node, newNodeNID); writeTerms(node, newNodeNID); ...

How do I implement transactions in Access?

Hello I am stuck implementing a transaction/rollaback feature on an access form. Here's the stripped down outline of what I've done: In the form's Load handler, I start the transaction dbEngine.BeginTrans gInTransaction = true Then, there's a "Cancel" button, whose Click handler goes like dbEngine.Rollback gInTransaction = false ...

PHP & mySQL: Simple code to implement Transaction - Commit & Rollback

Hi all, MY PLATFORM: PHP & mySQL MY SITUATION: I am trying to implement transactions within my code. I tried to follow examples, but it's not much help. I am running 3 queries and I wanted to write a transaction in such a way so that if any of the query(ies) fail, the whole transaction should roll back. I would really appreciate a si...

Are schema modifying commands transactional?

For example, if I drop a table then roll back the transaction is the table recreated? What are the limits to the schema changes that can be made in a transaction? If the above depends on the version of Sql Server, please say so... Background I am thinking of using some “select into” statements to create tables and then need to drop AL...

How do I pass transactions between threads for parallel execution?

I'd like to execute a task in parallel where each thread needs to have DB access but if one thread fails the transactions in all threads will fail. You can assume that the transaction is active before the threads are created and that it's committed after they complete. I'm also using a TransactionScope under the System.Transactions nam...

When does a db transaction written in ADO.NET actually begin?

One of the key things in database-intensive applications is to keep the transactions as short as possible. Today I was wondering when this transaction would actually begin: using (SqlConnection sqlConnection = new SqlConnection(connectionString)) { sqlConnection.Open(); /*(1)*/ SqlTransaction sqlTransaction = sqlConnection...

Why WCF needs DTC for transaction flow ???

Hi, I wonder why WCF needs MSDTC configured and started on both client and server, when I use transaction flow. (with network access enabled) After all, transactions in WCF are managed though SOAP messages using WsAtomicTransaction... So why in the hell the two DTCs need to communicate with each other ? Thanks for your response. ...

Is there a more efficient method than transactions?

insert into table1 ...; update table2 set count=count+1; The above inserts something into table1, and if it succeeds, updates the count field of table2. Of course this kind of thing can be handled by transactions, but transactions need to lock the table, which will be not efficient in a high concurrent system. And it can be even wors...

Invalid Jboss Datasources after redeploy

I'm developing an application tha uses seven datasources (ds) for MySql databases. I'm pretty satisfied with the result when it is working. However i'm getting are datasource related problems when I redeploy my aplication. Here is one of the seven ds I've configured in my my-application-ds.xml: <xa-datasource> <jndi-name>jd...