transactions

Entity Framework without Transaction?

Is there a way to use EF without transaction? I have very simple single insert and don't want to roll-back when something goes wrong as there may be a trigger logging then raising error from the DB side which I have no control over. I just want to insert then catch any exceptions but don't want to roll-back. ...

How to get JDBC connections obtained from a JNDI datasource to participate in a UserTransaction using Weblogic 10.3?

I am currently retrieving both a UserTransaction and a DataSource from a Weblogic 10.3 server using JNDI. I have set the Datasource up to 'Support Global Transactions' and to use 'Logging Last Resource' My hope was that by beginning a UserTranscation and then retrieving a JDBC connection from the Datasource the connection would partici...

Thread deadlock blocked on Hibernate transaction

I have one process which creates a database entity and then launches a second process. It then waits on the second process to find and update the database entity before completing its processing, and thereby committing the database entity. The trouble seems to be that since the initial process which performed the entity creation has no...

How to enforce WCF transaction flow contracts with two services in the same project?

I just read a fantastic article about WCF transactions and flow. Pretty much only left me with one unanswered question: I have a single project with two service methods defined: ServiceA.svc [OperationBehavior(TransactionScopeRequired = true)] OperationA() ServiceB.svc [OperationBehavior(TransactionScopeRequired = true)] ...

NHibernate Linq uses implicit transaction?

I'm using Ayende's NHibernate Linq version 2.1.2, available here, and when I use NHProf to inspect queries that use this method: public IQueryable<T> GetAll() { return Session.Linq<T>(); } It gives me the warning that I'm using an implicit transaction. Problem is, I'm using this in a repository to abstract out the database session...

How do I refactor three database operations that only differ by the method call?

I have three database operations like so: public void Add<T>(T entity) { using (var transaction = Session.BeginTransaction()) { if (entity is IEnumerable) { foreach (var item in (IEnumerable) entity) { Session.Save(item); } } else { ...

SQL atomic choose unused item from list and allocate to another table

I have a list of Channels. I need to use an available one of these if there is one and allocate it to a session. If no available ones are left over I need to create a new one and allocate it to the session, and let the calling routines know that it is a new Channel. I have the following implementation, which seems to work, but I was won...

MySql: transactions don't detect deadlocks?

Consider the following perl code: $schema->txn_begin(); my $r = $schema->resultset('test1')->find({id=>20}); my $n = $r->num; $r->num($n+1); print("updating for $$\n"); $r->update(); print("$$ val: ".$r->num."\n"); sleep(4); $schema->txn_commit(); I'm expecting that since the update is protected by a transaction, then if two proc...

Telling if a transaction has uncommitted updates

In our application, there's a database update that is committed only after a consequent update is being executed (both using the same transaction, of course). However, we've discovered a rare flow in which the user exits the application before the second update, causing the first to be discarded. I'm looking for a way to recognize this u...

Activity Monitor Problems in SQL Server 2005

I am looking at the Activty Monitor for SQL Server 2005 and we have some processes that are taking up large amounts of the CPU. When I look at what is trying to be run I get: set transaction isolation level read committed This code is not coming from any of our applications. What is causing it? What should be done? ...

T-SQL transactions and table locking

If I want to select all records in a table that have not been processed yet and then update those records to reflect that they have been processed, I would do the following: SELECT * FROM [dbo].[MyTable] WHERE [flag] IS NULL; UPDATE [dbo].[MyTable] SET [flag] = 1 WHERE [flag] IS NULL; How do I ensure that the UPDATE works on only th...

Best Practice for Application Tier Database Transactions

I have seen a number of different cftransaction examples and read different sites and still have not been able to find a definitive answer to what parts of cftransaction are necessary. What I am trying to accomplish is very simple: start a transaction run multiple inserts/updates close the transaction If there is an error at any time...

hibernate Lock wait timeout exceeded;

I am using hibernate, trying to simulate 2 concurrent update to the same row in database. Edit: I moved em1.getTransaction().commit to be right after em1.flush(); I am not getting any StaleObjectException, the two transactions committed successfully. Session em1=Manager.sessionFactory.openSession(); Session em2=Manager.sessionFactory....

How to judge whether or not a transaction succeeded or failed?

I'm using MySQL and PHP. Running this transaction: begin; .... commit; How should I judge whether it failed in PHP? ...

understand spring xml annotation metadata?

<context:annotation-config/> <context:component-scan... this is used for class that i need to annotated with @Repository @Service @Component... <context:spring-configured /> <context:component-scan... use if i need to use @Configurable <tx:annotation-driven transaction-manager="transactionManager" /> <context:component-sc...

How to configure transaction management for working with 2 different db in Spring?

I have 2 databases (MySql and HSQLDB). I configured 2 data sources and 2 EntityManagerFactory beans. I can also configure 2 correspondent JpaTransactionManager beans. But I don't know how to specify which of them should be used to manage transactions for concrete service-class. I want to use @Transactional annotation for that purpose, ...

How to handle transactions in dotnet world?

Hi, we are using linq-to-sql in a desktop project? How should we handle transactions? What about using transaction scope? ...

API HTTPOK 200 Postback handler from Ruby App

I'm building a sinatra Ruby app that interacts with Jambool Social Gold API (a virtual currency platform). After a transaction is complete (the user purchases points) Jambool sends a "postback" to "foo.com/postback?signature=foo". The API documentation says that it expects an OK response in the body of the postback (after I validate th...

Are long-living transactions acceptable?

I am thinking about using transactions in 2-tier WPF (or windows forms) applications in following way: We can begin new transaction when we open new form for editing data, edit and persist changes transparently in this transaction. Then we can click "OK" button and commit transaction, or "Cancel" button and rollback it. If we want to op...

How can I do multi Transaction in DBExpress

I am using DBExpress with blackfish. How can I do multi Transaction? I have several GRIDs all in editing at once and all will have to be saved at once. The begin editing and post are to be determined by the end user, as he works, and in different place of the application, so difficult to do in one only transaction. UPDATE: OK the pr...