transactions

NHiberate nested transaction blocking

I have an NHibernate Transaction that does some work and makes a call to a legacy method which uses DBTransactions to call several Stored Procedures. If any of these legacy method calls fail then the NHibernate Transaction should rollback. The problem is that the Legacy methods are using data in the database that the NHibernate transact...

transaction scope attribute in VB.NET

Hi, I need to ensure 2 calls are enlisted in a transaction Sub InsertOrder(order) ...insert order header SQL ....insert order items SQL (LOOP) End Sub I am aware I can accomplish this via a transaction scope, however, isn't there a "Attribute" available for this? Transaction.Scope()>_ Public Sub InsertOrder(order) End Sub ...

datastore transaction restrictions

in my google app application, whenever a user purchases a number of contracts, these events are executed (simplified for clarity): user.cash is decreased user.contracts is increased by the number contracts.current_price is updated. market.no_of_transactions is increased by 1. in a rdms, these would be placed within the same transacti...

SQLServer deadlock

Hi, I have a java application which is doing multiple concurrent CRUD operations on a database. I'm adding support for SQLServer but am having problems with deadlocking during concurrent deletes. After some investigation it appeared that the problem may be due to lock escalation on a particular table. In an attempt to fix it, I decide...

RollBack or Commit (Enterprise Library Transaction) over classes when other class get result in C#

I have a class which is mirror of table. public class Patient { public int Patient_id { get; set; } public string Name { get; set; } public string Address { get; set; } public bool Sex { get; set; } public Patient f_UpdatePatient(Patient _patient) { string QUpdate = " ...

In existing code I have found the money transfer procedure which isn't wrapped in transaction, should I panic?

In the existing code I am working with I have found the money transfer procedure which isn't wrapped in transaction, is it totally unacceptable or it is OK because there are all the needed sanity checks, i.e. that amount of money to transfer is greater than zero, and ORM level validation that balance is greater or equal to zero. Thanks ...

Nested transactions in sql server

Does sql server allow nested transactions? If so then whats the priority of transactions? ...

Will SQLite database really remain intact if the program is forcibly terminated when changing the database?

The SQLite documentation says it is transactional. The explanation in the linked article states that if a C++ program which has the SQLite C++ code statically linked into it is forcibly terminated (for example, TerminateProcess() in WinAPI) or crashes when a write is being performed the database remains intact - either fully updated or ...

How to protect a running column within Oracle/PostgreSQL (kind of MAX-result locking or something)

Hi, I'd need advice on following situation with Oracle/PostgreSQL: I have a db table with a "running counter" and would like to protect it in the following situation with two concurrent transactions: T1 T2 SELECT MAX(C) FROM TABLE WHERE CODE='xx' -- C for new : result + 1 SELECT MAX(C) FROM TABLE WHERE CODE='xx'; ...

How to use transactions with a datacontext

Can i use transactions with a datacontext, so i can rollback the state of the context after an error. And so yes, how does it work? ...

MSDTC (Distributed Transaction Coordinator) slow first-time startup

I've noticed that very simple distributed transactions take a good amount of time (3-4s) to complete on a first run. But if the same transaction scope is called again, it's much faster (30ms). It seems like MSDTC sort of goes to sleep after an hour. After the hour has passed, the next transaction to run will take 3-4s. I don't expect...

Is it possible to use more than one persistence unit in a transaction, without it being XA?.

Our application needs to use (read-only) a couple different persistence units pointing to different databases (different, commercial vendors as well). We do not have the budget to enable 2pc on one of them (Sybase). Is there a way to use these in a transaction without it having to be an XA transaction? We're using Websphere 6.1, Sybas...

TransactionTimeout with Oracle 11g

Using an Oracle 11g database. I have a service that is tagged with: [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall, TransactionTimeout="00:00:10")] The method itself looks like this: [OperationBehavior(TransactionScopeRequired = true)] [TransactionFlow(TransactionFlowOption.NotAllowed)] public OrderMess...

Client unexpectedly shutdown

I am working on a .net rich client server application, the client call the server thru web service, what could happen if the client is suddently shutdown(connection closed) when it is calling the server? will the server be able to dectect this? If the client is submitting a request to persist a set of data to server database, will the tr...

Troubleshooting consistent "SQLException: Lock wait timeout exceeded"

I have an application running Quartz 1.6.1 w/persistent job store, with MySQL 5.1 as the DB. This application used to boot up okay in Tomcat6. At some point, it began throwing the following exception upon EVERY boot: - MisfireHandler: Error handling misfires: Failure obtaining db row lock: Lock wait timeout exceeded; try restarting tran...

Cant the prepared statement be used throught the transaction, from php?

Hi again, guys. I work on a LAPP environment (linux apache postgresql php), and i'm just triyn to find out how to use the prepared statement within the transaction (if is possible). I hope code will explain better then words: Example 1, simple transaction: BEGIN; INSERT INTO requests (user_id, description, date) VALUES ('4', 'This do...

How can I chop down a transaction in Spring with JPA?

I have this code: run big query: Select all unprocessed objects from table A for each result create or update an output object in table B update input object: Set it to "processed" I'd like to have a transaction over the loop body, that is after one row of input is processed, the updated objects should be committed, so when th...

Multiple SQL Transactional Commands Across Different Database Connections

I am using the .NET 2.0/3.5 framework for my application. I need to run several SQL commands across multiple connections and each connection is on a different server (Oracle, SQL Server). I need to make sure these commands are transactional. For example: I need to perform an INSERT in a table on both Oracle and SQL Server databases, t...

Can you include linq-to-sql changes and ADO.NET dataset table adapter updates in a single transaction?

Here are the relevant technologies that I'm working with: Devart's dot Connect for Oracle (to facilitate Linq-to-Sql for Oracle). Strongly Typed ADO.NET Datasets. An Oracle database. Here's the challenge: My legacy code submits database updates with ADO.NET datasets and table adapters. I'd like to begin converting that code over to...

Remote Seam Persistence

Hi. I have a button in a .xhtml file which calls a javascript function which calls a java function remotely (in jboss seam environment). That java function has an entityManager.persist(object). Do you know why this line of code doesn't commit to the DB? It says something that a transaction hasn't started. I supose in a remote context i d...