Single-statement 'write consistency' on read committed?

Please note that in the following I'm only concerned about single-statement read committed transactions. I do realize that for a multi-statement read committed transaction Oracle does not guarantee transaction set consistency without techniques like select for update or explicit hand-coded locking.
According to the documentation Oracle guarantees 'statement-level transaction set consistency' for queries in read committed transactions. In many cases, Oracle also provides single-statement write consistency. However, when an update based on a consistent read tries to overwrite changes committed by other transactions after the statement started, it creates a write conflict. Oracle never reports write conflicts on read committed. Instead, it automatically handles them based on the new values for the target table columns referenced by the update.
Let's consider a simple example. Again, I do realize that the following design might look strange or even sloppy, but the ability to produce a quality design when needed is not an issue here. I'm simply trying to understand the Oracle's behavior on write conflicts in a single-statement read committed transaction.
A valid business case behind the example is rather common - a financial institution with two-stage funds transfer processing. First, you submit a transfer (put transfer amounts in the 'pending' column of the account) in case the whole financial transaction is in doubt. Second, after you got all the necessary confirmations you clear all the pending transfers making the corresponding account balance changes, resetting pending amount and marking the accounts cleared by setting the cleared date. Neither stage should leave the data in inconsistent state: sum (amount) for all rows should not change and the sum (pending) for all rows should always be 0 on either stage:
Setup:
create table accounts
acc int primary key,
amount int,
pending int,
cleared date
Initially the table contains the following:
ACC AMOUNT PENDING CLEARED
1 10 -2
2 0 2
3 0 0 26-NOV-03
So, there is a committed database state with a pending funds transfer of 2 dollars from acc 1 to acc 2. Let's submit another transfer of 1 dollar from acc 1 to acc 3 but do not commit it yet in SQL*Plus Session 1:
update accounts
set pending = pending - 1, cleared = null where acc = 1;
update accounts
set pending = pending + 1, cleared = null where acc = 3;
ACC AMOUNT PENDING CLEARED
1 10 -3
2 0 2
3 0 1
And now let's clear all the pending transfers in SQL*Plus Session 2 in a single-statement read-committed transaction:
update accounts
set amount = amount + pending, pending = 0, cleared = sysdate
where cleared is null;
Session 2 naturally blocks. Now commit the transaction in session 1. Session 2 readily unblocks:
ACC AMOUNT PENDING CLEARED
1 7 0 26-NOV-03
2 2 0 26-NOV-03
3 0 1
Here we go - the results produced by a single-statement transaction read committed transaction in session 2, are inconsistent � the second funds transfer has not completed in full. Session 2 should have produced the following instead:
ACC AMOUNT PENDING CLEARED
1 7 0 26-NOV-03
2 2 0 26-NOV-03
3 1 0 26-NOV-03
Please note that we would have gotten the correct results if we ran the transactions in session 1 and session 2 serially. Please also note that no update has been lost. The type of isolation anomaly observed is usually referred to as a 'read skew', which is a variation of 'fuzzy read' a.k.a. 'non-repeatable read'.
But if in the session 2 instead of:
-- scenario 1
update accounts
set amount = amount + pending, pending = 0, cleared = sysdate
where cleared is null;
we issued:
-- scenario 2
update accounts
set amount = amount + pending, pending = 0, cleared = sysdate
where cleared is null and pending <> 0;
or even:
-- scenario 3
update accounts
set amount = amount + pending, pending = 0, cleared = sysdate
where cleared is null and (pending * 0) = 0;
We'd have gotten what we really wanted.
I'm very well aware of the 'select for update' or serializable il solution for the problem. Also, I could present a working example for precisely the above scenario for a major database product, providing the results that I would consider to be correct. That is, the interleaving execution of the transactions has the same effect as if they completed serially. Naturally, no extra hand-coded locking techniques like select for update or explicit locking is involved.
And now let's try to understand what just has happened. Playing around with similar trivial scenarios one could easily figure out that Oracle clearly employs different strategies when handling update conflicts based on the new values for the target table columns, referenced by the update. I have observed the following cases:
A. The column values have not changed: Oracle simply resumes using the current version of the row. It's perfectly fine because the database view presented to the statement (and hence the final state of the database after the update) is no different from what would have been presented if there had been no conflict at all.
B. The row (including the columns being updated) has changed, but the predicate columns haven't (see scenario 1): Oracle resumes using the current version of the row. Formally, this is acceptable too as the ANSI read committed by definition is prone to certain anomalies anyway (including the instance of a 'read skew' we've just observed) and leaving behind somewhat inconsistent data can be tolerated as long as the isolation level permits it. But please note - this is not a 'single-statement write consistent' behavior.
C. Predicate columns have changed (see scenario 2 or 3): Oracle rolls back and then restarts the statement making it look as if it did present a consistent view of the database to the update statement indeed. However, what seems confusing is that sometimes Oracle restarts when it isn't necessary, e.g. when new values for predicate columns don't change the predicate itself (scenario 3). In fact, it's bit more complicated � I also observed restarts on some index column changes, triggers and constraints change things a bit too � but for the sake of simplicity let's no go there yet.
And here come the questions, assuming that (B) is not a bug, but the expected behavior:
1. Does anybody know why it's never been documented in detail when exactly Oracle restarts automatically on write conflicts once there are cases when it should restart but it won't? Many developers would hesitate to depend on the feature as long as it's not 'official'. Hence, the lack of the information makes it virtually useless for critical database applications and a careful app developer would be forced to use either serializable isolation level or hand-coded locking for a single-statement update transaction.
If, on the other hand, it's been documented, could anybody please point me to the bit in the documentation that:
a) Clearly states that Oracle might restart an update statement in a read committed transaction because otherwise it would produce inconsistent results.
b) Unambiguously explains the circumstances when Oracle does restart.
c) Gives clear and unambiguous guidelines on when Oracle doesn't restart and therefore when to use techniques like select for update or the serializable isolation level in a single-statement read committed transaction.
2. Does anybody have a clue what was the motivation for this peculiar design choice of restarting for a certain subset of write conflicts only? What was so special about them? Since (B) is acceptable for read committed, then why Oracle bothers with automatic restarts in (C) at all?
3. If, on the other hand, Oracle envisions the statement-level write consistency as an important advantage over other mainstream DBMSs as it clear from the handling of (C), does anybody have any idea why Oracle wouldn't fix (B) using well-known techniques and always produce consistent results?

I intrigued that this posting has attracted so little interest. The behaviour described is not intuitive and seems to be undocumented in Oracle's manuals.
Does the lack of response indicate:
(1) Nobody thinks this is important
(2) Everybody (except me) already knew this
(3) Nobody understands the posting
For the record, I think it is interesting. Having spent some time investigating this, I believe the described is correct, consistent and understandable. But I would be happier if Oracle documented in the Transaction sections of the Manual.
Cheers, APC

Similar Messages

  • Read committed isolation level must not produce nonrepeatable read

    Hi,
    I am sql server DBA. But i am trying to improve myself in oracle too.
    I read isolation levels in oracle. And it says, In read committed isolation level , oracle guarantees the result set that contains committed records at the beginning of reading operation.
    İf it is guaranteed , how does nonrepeatable read can occur? It must not occur then.
    I think , I misunderstood something .
    can you explain me?
    Thanks

    >
    I read isolation levels in oracle. And it says, In read committed isolation level , oracle guarantees the result set that contains committed records at the beginning of reading operation.
    İf it is guaranteed , how does nonrepeatable read can occur? It must not occur then.
    >
    See the 'Multiversion Concurrency Control' section in the database concepts doc. It discusses this and has a simple diagram (can't post it) that shows it.
    http://docs.oracle.com/cd/B28359_01/server.111/b28318/consist.htm
    >
    As a query enters the execution stage, the current system change number (SCN) is determined. In Figure 13-1, this system change number is 10023. As data blocks are read on behalf of the query, only blocks written with the observed SCN are used. Blocks with changed data (more recent SCNs) are reconstructed from data in the rollback segments, and the reconstructed data is returned for the query. Therefore, each query returns all committed data with respect to the SCN recorded at the time that query execution began. Changes of other transactions that occur during a query's execution are not observed, guaranteeing that consistent data is returned for each query.
    Statement-Level Read Consistency
    Oracle Database always enforces statement-level read consistency. This guarantees that all the data returned by a single query comes from a single point in time—the time that the query began. Therefore, a query never sees dirty data or any of the changes made by transactions that commit during query execution. As query execution proceeds, only data committed before the query began is visible to the query. The query does not see changes committed after statement execution begins.
    >
    The first sentence is the key:
    >
    As a query enters the execution stage, the current system change number (SCN) is determined.
    >
    Oracle will only query data AS OF that SCN that was determined.
    If you now rerun the query Oracle repeats the process: it determines the SCN again which could be newer if other users have committed changes.
    That second execution of the query may find that some rows have been modified or even deleted and that new rows have been inserted: nonrepeatable read.
    If you use the SERIALIZABLE isolation level then that second query will use the SCN that was determined at the very START of the transaction. For the simple example above it means the second query would use the SAME SCN that the first query used: so the same data would be returned.
    Table 13-2 in that doc (a few pages down) lists the isolation levels
    >
    Read committed
    This is the default transaction isolation level. Each query executed by a transaction sees only data that was committed before the query (not the transaction) began. An Oracle Database query never reads dirty (uncommitted) data.
    Because Oracle Database does not prevent other transactions from modifying the data read by a query, that data can be changed by other transactions between two executions of the query. Thus, a transaction that runs a given query twice can experience both nonrepeatable read and phantoms.

  • Reading committed data

    Hi,
    I have some questions about read committed isolation level.
    When does a read committed cursor get and release read locks on the records it is traversing?
    For example say we have records a,b,c,d and e stored in the BDB database in that order. if the cursor is at record a will it be holding read locks to b,c,d,and e and give those locks up only when it passes those records. in other words if am reading through a read committed cursor am I guaranteed to get a consistent view of a set of records?
    Also, what does the read committed isolation mean for database read operations within a read committed transaction. When are locks to the read records given up?
    Thanks,
    pooja

    Mark,
    I have studied the transaction guide and it does not
    seem to be very clear on whether consistent view of
    data can be obtained through a read committted
    cursor. Another source of information is the database literature describing the ANSI isolation modes. JE happens to implement the 4 standard ANSI isolation modes using record locking, but the behavior of these modes conforms to the standard.
    it says that if you need to read data in
    single direction read committed cursors are good but
    what if the record values need to maintain some
    invariant. For example we store configuration values
    for an object in seperate keys. If these values are
    being changed while we are reading them through a
    read committed cursor we either want all of the old
    values or all of the new values. We do not want some
    old and some new values. What isolation level do we
    need to use?If you write several records using a txn, those changes are not visible to any other txn or non-txn cursor until the txn is committed. Txns provide atomicity for that reason. The writer should use a txn and the reader can use READ_COMMITTED or any higher isolation level.
    --mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How to concatenate all the fields in a single statement with tilda..

    hi, i have 10 fields, i have to concatenate those fields seperated with tilda... and put into the application server...in a single statement,
    kindly suggest me hw to write..?
    Thanx in Advance.
    Akshitha.

    Hi.....
    Just see the following code...
    It solves your requirement.....
    REPORT  ZCSV_SPFLI_APP.
    TABLES :
      SPFLI.                               " Flight
      FIELD-SYMBOLS : <FS>. "TYPE C.
    DATA T_SPFLI LIKE STANDARD TABLE OF SPFLI .
    DATA W_CHAR(20) TYPE C.
    DATA W_TYPE .
    DATA:
      BEGIN OF T_TABLE OCCURS 0,
        LINE TYPE STRING,
      END OF T_TABLE.
    SELECT * FROM SPFLI INTO TABLE T_SPFLI.
    LOOP AT T_SPFLI INTO SPFLI.
      DO.
        ASSIGN COMPONENT SY-INDEX OF STRUCTURE SPFLI TO <FS>.
        IF SY-SUBRC NE 0.
          EXIT.
        ELSE.
          MOVE <FS> TO W_CHAR.
          IF SY-INDEX EQ 1.
            T_TABLE-LINE = <FS>.
          ELSE.
            CONCATENATE T_TABLE-LINE '~' W_CHAR INTO T_TABLE-LINE.
          ENDIF.
        ENDIF.
      ENDDO.
      CONDENSE T_TABLE-LINE.
      APPEND T_TABLE.
    ENDLOOP.
    LOOP AT T_TABLE.
      WRITE / T_TABLE-LINE.
    ENDLOOP.
    OPEN DATASET 'YH647_SPFLI' FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
    IF SY-SUBRC NE 0.
      MESSAGE ' File is Not Opend' TYPE 'S'.
    ENDIF.
    LOOP AT T_TABLE.
      TRANSFER T_TABLE-LINE TO 'YH647_SPFLI'.
    ENDLOOP.
    CLOSE DATASET 'YH647_SPFLI'.
    This reads flight detail and makes the separated by '~' and  stores in the application server (<b>OPEN_DATASET, TRANAFER , CLOSE DATASET</b>)
    Reward points if useful.........
    Suresh........

  • How to block reading in "read commited"?

    I wrote following code in my sp:
    select id into tempflag from table where conditions....
    if tempflag is null then
    insert xx into table
    else
    do something else
    end if;
    commit;
    Now let's assume this sp is excuted 2 times at almost same time, 1st transaction has inserted data but not commited yet, and 2nd transaction still not able to read the new inserted data, so it inserted data again. The result is I got 2 data in table, which is what I don't want to see.
    What I want is, when 1st transaction not commited yet, 2nd transaction should be blocking at the select statement, this should prevent the second time inserting.
    Actually this is the default behavior in MSSqlserver(read commited), but I found it quite different in Oracle.
    So how can I implement the above idea? Or any other better solutions? I'm new to Oracle.

    874717 wrote:
    I wrote following code in my sp:
    select id into tempflag from table where conditions....
    if tempflag is null then
    insert xx into table
    else
    do something else
    end if;
    commit;
    Now let's assume this sp is excuted 2 times at almost same time, 1st transaction has inserted data but not commited yet, and 2nd transaction still not able to read the new inserted data, so it inserted data again. The result is I got 2 data in table, which is what I don't want to see.
    What I want is, when 1st transaction not commited yet, 2nd transaction should be blocking at the select statement, this should prevent the second time inserting.
    Actually this is the default behavior in MSSqlserver(read commited), but I found it quite different in Oracle.
    So how can I implement the above idea? Or any other better solutions? I'm new to Oracle.Just put a unique constraint in ID column of your table. I guess that will do the job for you.
    Following piece of code is not necessory
    select id into tempflag from table where conditions....
    if tempflag is null thenDont try to select the table and check if the ID already exist. Just have a unique constraint defined and perform your insert.

  • Can't update while select is active in read-committed mode

    Hi
    This is my business logic:
    I m selecting the values from three tables by UNION ALL and i m geting the record set in while loop at the same time i try to insert the values which is getting from select statement in the First Table in the same while loop.
    my problem is when i try to insert into the same table the following error is occured
    "can't update while select is active in read-committed mode"
    Now what can i do ? please give me ur solution ...
    Thankx
    Merlina

    depending on how many values you have, you could store the results in memory, a vector or similar collection.
    Then close the select statement, and insert the values from your vector into the table.... should work then.
    Or, there may be a way of creating an updatable resultset ?
    This question is better directed at the
    "Java Database Connectivity (JDBC) & Transactions (JTA/JTS)" section of the forum. Maybe post a questions there, ensuring you give the URL of this question here too to avoid cross-posting.
    regards,
    Owen

  • Swapping two integers in a single statement.

    Hi All
    Is it possible to swap two integer values in a single statement.
    Help me out.
    Thanks in anticipation

    You want one statement? That would be something like
    this, then:x+=(y=-(y-(x-=y)));You are
    welcome to test it, I don't wish to be associated with
    it in any way.Doesn't work because the initial value of x is stored right at the beginning, and then used as the operand of the += at the end of the expression evaulation.
    However, following the same line of thinking I recast it into something that did work, using += and -=, and finally into this form, which also works.
    x=(x^=y)^(y^=x)Which is all very well, but generates more code than simply using a temporary variable, and would have to be documented on every occurrence to explain that this really was a swap. I'm at a loss to see how this is better than
    int t; t=x; x=y; y=tThey both fit on one line.
    Sylvia.

  • You can only specify the READPAST lock in the READ COMMITTED or REPEATABLE READ isolation levels

    Hi, I have a piece of code that works fine in SSMS as T-SQL. When I put the T-Sql inside a SP, I get the error :
    You can only specify the READPAST lock in the READ COMMITTED or REPEATABLE READ isolation levels
    The script starts is as follows (only select)
    SET NOCOUNT ON
    Set Transaction Isolation Level Read Committed
    Set Deadlock_Priority Low
    Select......
    From MyTable WITH (NOLOCK)
    GROUP BY .....
    Order BY ....
    works fine as I said in SSMS as T-SQL but the SP generates the following
    Msg 650, Level 16, State 1, Procedure usp_TotalMessages, Line 15
    You can only specify the READPAST lock in the READ COMMITTED or REPEATABLE READ isolation levels.
    By the way, when it says line 15, from where we should start counting, is it from The USE DB statement which includes comments as well as Set ANSI....or should we start counting from the Alter PRocedure statement
    Thanks in advance

    Set Transaction Isolation Level Read Committed
    Set Deadlock_Priority Low
    Select......
    From MyTable WITH (NOLOCK)
    GROUP BY .....
    Order BY ....
    First you define transactionlevel = "Read Committed", then you use a query hint "NOLOCK" which is equivalent to "Read Uncommitted"; so what do you want now, committed or uncommitted, you have to decide.
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • When shared locks are relesed in read committed.

    hi,
    https://msdn.microsoft.com/en-us/library/cc546518.aspx
    following lines are form above link
    "shared locks are acquired for read operations, but they are released as soon as they have been granted"
    Q1) Are they released after the stmt is executed " select * from a" or they are realease after the row is read and it continues with second row.
    Q2) As far as acquiring of shared lock is concerned i think they are acquired row by row , and mean  while other transaction can update rows which are not having shared lock till now , like last rows?
    yours sincerley

    That means.
    if a stmt select three rows.
    Q1)Then will it get shared lock for first row, reads it, release the lock, then take shared lock on second row and read it then release it again after reading the second row , then it will get thired row lock ....?
    Q2) As far as acquiring of shared lock is concerned i think they are acquired row by row , and mean  while
    other transaction can update rows which are not having shared lock till now , like last rows?
    Q1) Yes, in read committed mode when your query does not have any hints to change the behavior, if a query is only reading data from a table (like a SELECT statement), then the lock on each row is taken just before the row is read, the row is read, the lock
    is freed and it goes on to the next row and does the same process on that row (lock, read, free).
    Q2) Yes, the locks are acquired on a row basis.  Since they are then freed, your query will not stop other connections from updating rows in the table(s) you are reading except for the vary short period of time the lock is held on each row.  So
    your query could read lock row 1, read row 1, free the lock on row1, get a lock on row 2 and be in the process of reading row 2 when some other connection updates row 1.  That connection would be allowed to update row 1.
    Tom

  • Update multiple rows & columns using a single statement

    I have the following table with tablename - emp
    first_name last_name age
    aaa bbb 31
    56
    78
    ggg hhh 36
    2nd & 3rd row contain null values (no data) in first_name & last_name column . I want to update those two rows with data using a single statement. How do I do it?
    I was thinking may be something like the following:-
    UPDATE emp
    SET first_name= , last_name=
    CASE
    WHEN age = 56 THEN 'ccc', 'ddd'
    WHEN age = 78 THEN 'eee', 'fff'
    ELSE first_name, last_name
    END
    -----------------------------------------------

    Can you give an example of a nested decode statement.
    test@ora>
    test@ora>
    test@ora> --
    test@ora> drop table t;
    Table dropped.
    test@ora> create table t as
      2  select rownum x, cast(null as varchar2(10)) y from all_objects
      3  where rownum <= 10;
    Table created.
    test@ora>
    test@ora> select x, y from t;
             X Y
             1
             2
             3
             4
             5
             6
             7
             8
             9
            10
    10 rows selected.
    test@ora>
    test@ora> -- You want to change the values of y to 'a' through 'j' for x = 1 through 10
    test@ora> -- and y = 'X' otherwise
    test@ora> --
    test@ora> -- Let's say the limit on the number of components were 12
    test@ora> -- Then your decode statement would've been:
    test@ora> --
    test@ora> update t
      2  set y = decode(x,
      3                 1, 'a',
      4                 2, 'b',
      5                 3, 'c',
      6                 4, 'd',
      7                 5, 'e',
      8                    'f');
    10 rows updated.
    test@ora>
    test@ora>
    test@ora> select x, y from t;
             X Y
             1 a
             2 b
             3 c
             4 d
             5 e
             6 f
             7 f
             8 f
             9 f
            10 f
    10 rows selected.
    test@ora>
    test@ora> -- As you can see you are unable to:
    test@ora> --
    test@ora> -- change y to 'g' if x = 7
    test@ora> -- change y to 'h' if x = 8
    test@ora> -- change y to 'i' if x = 9
    test@ora> -- change y to 'j' if x = 10
    test@ora> -- change y to 'X' otherwise
    test@ora> --
    test@ora>
    test@ora> -- What you would do then is -
    test@ora> -- (i)  Let the 11 components remain as they are and
    test@ora> -- (ii) Introduce a nested decode function *AS THE 12TH COMPONENT*
    test@ora> --
    test@ora>
    test@ora> rollback;
    Rollback complete.
    test@ora>
    test@ora> --
    test@ora> update t
      2  set y = decode(x,
      3                 1, 'a',
      4                 2, 'b',
      5                 3, 'c',
      6                 4, 'd',
      7                 5, 'e',
      8                 decode(x,
      9                        6,  'f',
    10                        7,  'g',
    11                        8,  'h',
    12                        9,  'i',
    13                        10, 'j',
    14                            'X')
    15                );
    10 rows updated.
    test@ora>
    test@ora> select x, y from t;
             X Y
             1 a
             2 b
             3 c
             4 d
             5 e
             6 f
             7 g
             8 h
             9 i
            10 j
    10 rows selected.
    test@ora>
    test@ora>HTH
    isotope
    Extrapolate that to 255 components and you get 254 + 255 = 509 components. And so on...
    Message was edited by:
    isotope

  • Combine select and update into single statement,without bind-variable

    I have a problem, that I think is not possible to solve the way I want to, but I just wanted to check before leaving the idea...
    I am looking for a way to combine the select and the update statement into one single statement. This is what I wan't to achive: select some data, and update the data selected before returning them.
    On this site http://www.psoug.org/reference/update.html I see that the following are possible:
    var bnd1 NUMBER
    var bnd2 VARCHAR2(30)
    var bnd3 NUMBER
    UPDATE employees
    SET job_id ='SA_MAN', salary = salary + 1000,
    department_id = 140
    WHERE last_name = 'Jones'
    RETURNING salary*0.25, last_name, department_id
    INTO :bnd1, :bnd2, :bnd3;
    I need to have this as a single statement, and cannot use bind-variables. So I was hoping that something like this could be possible:
    UPDATE customer c
    SET c.HAS_CREDIT ='1'
    WHERE c.HAS_CREDIT = '0'
    RETURNING c.CUSTOMER_NO, c.FIRSTNAME, c.LASTNAME
    where c.HAS_CREDIT = '1'
    But this doesn't compile, complaining of missing into (ORA-00925: missing INTO keyword). And even though I would like this to be possible because this would solve my current problem, I think it would be very confusing. For instance; would the where clause of the returning part be operating after the update or before?
    Any comments or suggestions on how to get it work in a single statement, or should I just leave this path straight away?

    Hi,
    RETURNING only works with bind variables, see
    http://download-uk.oracle.com/docs/cd/B19306_01/appdev.102/b14261/returninginto_clause.htm#sthref3006
    The real problem is that the form of RETURNING clause with bind variables is only valid for single row update or insert statements.
    To update (or insert) multiple rows and return the data, you will need to use
    RETURNING BULK COLLECT INTO clause. See
    http://download-uk.oracle.com/docs/cd/B19306_01/appdev.102/b14261/tuning.htm#sthref2236
    Cheers,
    Colin

  • Cant' update while select is active in read-committed mode

    Hi All
    I try to execute my java program the following error is comming
    "cant' update while select is active in read-committed mode"
    I am using prepraredStatement. The query is running successfully in QueryTool or Toad. But the Error is coming while execute this line
    "stmt.executeUpdate(); "
    pleaes solve my problem..
    Thankx

    <br>Mmm, it seems same question Re: insert data problem</br>
    <br>Nicolas.</br>

  • ( if snapshot isolation level is enable in db.) Is the version chain is generated if any read commited transation is executed or it only gnerates version chain, if any snapshot transaction is in running status.

    hi,
    I have enable snapshot isolation level, in my database all queries execute in read commited isolation only one big transaction uses snapshot isolation.
    q1)i wanted to know if snapshot silation transaction is not running but database is enable for snapshot ,then will the normal 
    queries using read commited will create versions or not.
    yours sincerley.

    Enabling snapshot isolation level on DB level does not change behavior of queries in any other isolation levels. In that option you are eliminating all blocking even between writers (assuming they do not update
    the same rows) although it could lead to 3960 errors (data has been modified by other sessions). 
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • SP2013 Bug Report: Health Reports - You can only specify the READPAST lock in the READ COMMITTED or REPEATABLE READ isolation levels.

    There appears to be an error when trying to view Health Reports from Central Administration. A simple fix within a SharePoint Stored Procedure fixes the problem. I get the error message "You can only specify the READPAST lock in the READ COMMITTED or
    REPEATABLE READ isolation levels." when just trying to click "View Health Reports" --> Go in CA.
    I have found the same problem in some blog posts which leads me to believe this is a bug:
    Problems Viewing Health Reports in SharePoint 2013
    From the blog post "I managed to work around it by altering the
    proc_GetSlowestPages stored procedure and commenting out the
    WITH (READPAST) line. "
    This also worked for me. It would be great if a fix could be released for this problem as it seems to cause other problems as well (site analytics freezes).

    Hi Dennis
    Hope you had found the hotfix and installed it.
    For the benefit of others who visit this thread SharePoint Server 2013 Client Components SDK hotfix package addresses this issue.http://support.microsoft.com/kb/2849962
    Regards
    Sriram.V

  • Multiple LABVIEW GPIB Commanding alternating Write followed by read many times

    Hi,
    I am trying to convert my labwindows C program over to Labview.  This is a VISA GPIB application.  I have seen how you can send multiple
    commands in Labview by sending the commands separated by semicolons.  However with my instrument.  I need to write one command
    then immediately read the command. and report the results to a text window for user visual verification.
    In C is sent around 47 or so commands to the instrument just to be sure all of these parameters have the correct configuation.  I did this with a
    Array of strings with each element a string command.  then simply used a for loop in C to send to visa ViPrintf function.  Always one write and one read followed by displaying the command string and the response to the instrument.
    I would like to do the same thing in Labview. 
    Thank You for your help,
     Gary
    Message Edited by golson on 07-14-2009 04:02 PM

    OK. So what's your question? LabVIEW has VISA functions as well. VISA Write and VISA Read. LabVIEW has loops. LabVIEW has arrays. Thus, you can create an array the same way you did in LabWindows, and drive a loop with that array, and send a write followed a read.
    Perhaps you can clarify what you're asking for. 
    Have you looked at/gone through the tutorials? To learn more about LabVIEW it is recommended that you go through the tutorial(s) and look over the material in the NI Developer Zone's Learning Center which provides links to other materials and other tutorials. You can also take the online courses for free.

Maybe you are looking for