isolation-level

Oracle transaction read-consistency ?

I have a problem understanding read consistency in database (Oracle). Suppose I am manager of a bank . A customer has got a lock (which I don't know) and is doing some updating. Now after he has got a lock I am viewing their account information and trying to do some thing on it. But because of read consistency I will see the data as ...

Read committed Snapshot VS Snapshot Isolation Level

Could some one please help me understand when to use SNAPSHOT isolation level over READ COMMITTED SNAPSHOT in SQL Server? I understand that in most cases READ COMMITTED SNAPSHOT works, but not sure when go for SNAPSHOT isolation. Thanks ...

Defining transaction isolation in BIRT

My BIRT report retrieves data using a SQL query (JDBC datasource). My SQL Server 2005 database is set to use snapshot transaction isolation. How do I define the transaction isolation mode in BIRT report designer ? Programatically it's done calling the datasource method setDefaultTransactionIsolation(4096) (4096 means snapshot isola...

How to figure the read/write ratio in Sql Server?

How can I query the read/write ratio in Sql Server 2005? Are there any caveats I should be aware of? Perhaps it can be found in a DMV query, a standard report, a custom report (i.e the Performance Dashboard), or examining a Sql Profiler trace. I'm not sure exactly. Why do I care? I'm taking time to improve the performance of my web a...

Which isolation level should I use for the following insert-if-not-present transaction?

I've written a linq-to-sql program that essentially performs an ETL task, and I've noticed many places where parallelization will improve its performance. However, I'm concerned about preventing uniquness constraint violations when two threads perform the following task (psuedo code). Record CreateRecord(string recordText) { using ...

Locking a table for getting MAX in LINQ

Hi Every one! I have a query in LINQ, I want to get MAX of Code of my table and increase it and insert new record with new Code. just like the IDENTITY feature of SQL Server, but here my Code column is char(5) where can be alphabets and numeric. My problem is when inserting a new row, two concurrent processes get max and insert an equa...

JPA and MySQL transaction isolation level

I have a native query that does a batch insert into a MySQL database: String sql = "insert into t1 (a, b) select x, y from t2 where x = 'foo'"; EntityTransaction tx = entityManager.getTransaction(); try { tx.begin(); int rowCount = entityManager.createNativeQuery(sql).executeUpdate(); tx.commit(); ...

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? ...

Application safe to use READ_COMMITTED_SNAPSHOT?

I have a large web application using a COM data access layer against an SQL Server 2005 database. By default, the isolation level is READ_COMMITTED. Now I understand how READ_COMMITTED_SNAPSHOT isolation level works, and reading MSDN it says you can turn it on transparently. However, I'm still sceptical. :) Is it guaranteed, in an implem...

Run app from a service using CreateProcessAsUser

I'm still trying to run an app calling it from windows service. I tried to use the way described by Scott Allen. It works. But still I can't bring the app to the screen to interact with it. Help me pls. Even if I'm telling it to run the service using my credentials it doesn't bring the app on my desktop. tell me please how to get the cu...

Is it possible silently run something as Administrator

How to trick UAC in Vista and Windows 7? How can I run something that needs not just administrator rights, but especially must be told to run as Administrator. I've tried start a process with given admin credentials, and even tried to use win32 function CreateProcessAsUser, but still unless I tell it manually "run as Administrator" it d...

Why insert TSQL statement block when transaction isolation level for another transaction is serializable with non-conflicting filter?

Serializable transaction isolation levels avoids the problem of phantom reads by blocking any inserts to a table in a transaction which are conflicting with any select statements in other transactions. I am trying to understand it with an example, but it blocks insert even if when the filter in the select statement is not conflicting. I ...

how to ensure data consistency

c# application. I am doing a select followed by update of a column in a table. I am putting these in a separate transaction with isolation level set to Serializable. I am doing this to achieve data consistency. But still I can check that multiple users are able to read (select) the same value and eventually trying to update with the sa...

Best Isolation Level to avoid deadlocks using an UPDATE sentence in Sql Server 2005

i need execute un update statement over an sql server table, this table is used by another process at the same time. because that sometimes deadlocks ocurs. wich Isolation Level do you recomend to avoid or minimize this deadlocks? ...

Logging JDBC/Hibernate/JPA transaction isolation levels

I'm working on a Flex/BlazeDS/Spring/JPA/Hibernate web application hooked up to a Microsoft SQL Server database. It seems to be locking the tables too aggresively. From my research, it looks like using the snapshot isolation policy is the best bet. I've set things up as such: <bean id="entityManagerFactory" class="org.springf...

What type of Transaction IsolationLevel should be used to ignore inserts but lock the selected row?

I have a process that starts a transaction, inserts a record into Table1, and then calls a long running web service (up to 30 seconds). If the web service call fails then the insert is rolled back (which is what we want). Here is an example of the insert (it is actually multiple inserts into multiple tables but I am simplifying for thi...

Sql client transactions from code vs database-controlled transactions

I've always done transactions from within stored procedures but now I need to wrap a bunch of "dynamic" statements executed from code against sp_executesql in a transaction. Specifically I need the READ UNCOMMITED isolation level for these in some cases (I know what that does, and yes, that's what I need). This is SQL2008. My question ...

Oracle transaction isolation

hi, I have a method SaveApp() which will deactivate the existing records and insert a new one. void SaveApp(int appID) { begin transaction; update; insert; commit transaction; } Let's say in database table SalesApp, I have 2 records with appID equal to 123; record 1, appID 123, inactive record 2, appID 123, active I...

How do I set the transaction isolation level in SQLAlchemy for PostgreSQL?

We're using SQLAlchemy declarative base and I have a method that I want isolate the transaction level for. To explain, there are two processes concurrently writing to the database and I must have them execute their logic in a transaction. The default transaction isolation level is READ COMMITTED, but I need to be able to execute a piece ...

transaction isolation level good explanation

Hi All, Does someone knows a good book where transaction isolation levels are explained with examples and advices in what case what isolation level to use ? Regards ...