Isolation Levels in ODI procedures

Hi,
I have a package with 1 interfaces and 2 procedures which I want to configure in as one transactional unit
The package executes the following sequence
1. Interface loads data from the source to target table
2. Procedure updates a statuscode on the source table to S
3. Procedure updates target table sequence number, but the procedure contains a where clause which filter records to updates
based on records in the source table with statuscode = S.
Step 3's execution is dependent on update in step 2. These steps behave as expected and all units tests pass when I
leave the transaction porperty of the procedures as AutoCommit.
However I want the interface and packages to be executed as a transcational unit so I configued them as follows.
The 2 procedures are configured to execute in the same Transaction (Transaction 0) with Commit property as "No Commit".
I based this on other forum entries.
With this configuration my unit tests seem to fail, the 3 step does not result in any record being updated.
I think the issue may be related to the isolation levels on the procedures, so I then configured the procedure's "Transaction Isolation" property to be "Read Uncommited".
When I ran the test in ODI I got the following error below.
Can you let me know if what I am trying to do is possible ?. Can you have a number of procedures in a single transactional unit,
where uncommited changes carried out in the first procedure(not committed), can be read in subsequent steps within that same transactional unit.
I am current using ODI Repository: Development_ODI_D8B4A_RC5
Any feedback would be appreciated.
Thanks,
Breda
ODI-1226: Step UPD REVN LSM fails after 1 attempt(s).
ODI-1232: Procedure UPD REVN LSM execution fails.
ODI-1228: Task UPD REVN LSM (Procedure) fails on the target ORACLE connection SALES_IMP_DATA_SERVER.
Caused By: java.sql.SQLException: ODI-10068: SnpsConnection: Isolation level not supported
     at com.sunopsis.sql.SnpsConnection.setTransactionIsolation(SnpsConnection.java:905)
     at com.sunopsis.sql.SnpsConnection.changeIsolationLevel(SnpsConnection.java:329)
     at com.sunopsis.dwg.dbobj.SnpSession.changeIsolationLevel(SnpSession.java:3519)
     at com.sunopsis.dwg.dbobj.SnpSessTask.getDefaultDwgConnectConnection(SnpSessTask.java:518)
     at com.sunopsis.dwg.dbobj.SnpSessTaskSql.getExecutor(SnpSessTaskSql.java:2936)
     at com.sunopsis.dwg.dbobj.SnpSessTaskSql.processTask(SnpSessTaskSql.java:2878)
     at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java:2602)
     at com.sunopsis.dwg.dbobj.SnpSessStep.treatAttachedTasks(SnpSessStep.java:546)
     at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java:461)
     at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java:1736)
     at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java:1591)
     at oracle.odi.runtime.agent.processor.impl.StartScenRequestProcessor$2.doAction(StartScenRequestProcessor.java:568)
     at oracle.odi.core.persistence.dwgobject.DwgObjectTemplate.execute(DwgObjectTemplate.java:224)
     at oracle.odi.runtime.agent.processor.impl.StartScenRequestProcessor.doProcessStartScenTask(StartScenRequestProcessor.java:489)
     at oracle.odi.runtime.agent.processor.impl.StartScenRequestProcessor$StartScenTask.doExecute(StartScenRequestProcessor.java:1062)
     at oracle.odi.runtime.agent.processor.task.AgentTask.execute(AgentTask.java:118)
     at oracle.odi.runtime.agent.support.DefaultAgentTaskExecutor$1.run(DefaultAgentTaskExecutor.java:49)
     at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49)
     at oracle.odi.runtime.agent.support.DefaultAgentTaskExecutor.executeAgentTask(DefaultAgentTaskExecutor.java:41)
     at oracle.odi.runtime.agent.processor.TaskExecutorAgentRequestProcessor.doExecuteAgentTask(TaskExecutorAgentRequestProcessor.java:94)
     at oracle.odi.runtime.agent.processor.TaskExecutorAgentRequestProcessor.process(TaskExecutorAgentRequestProcessor.java:85)
     at oracle.odi.runtime.agent.RuntimeAgent.startScenario(RuntimeAgent.java:700)
     at oracle.odi.runtime.agent.InternalRuntimeAgent.startScenario(InternalRuntimeAgent.java:52)
     at com.sunopsis.dwg.tools.StartScen.startScenOnLocalAgent(StartScen.java:983)
     at com.sunopsis.dwg.tools.StartScen.actionExecute(StartScen.java:245)
     at com.sunopsis.dwg.function.SnpsFunctionBaseRepositoryConnected.execute(SnpsFunctionBaseRepos
Edited by: user807308 on 14-Jan-2011 01:04
Edited by: user807308 on 14-Jan-2011 01:04

Similar issue has been discussed here:
Re: Transaction rollback...
Check that out

Similar Messages

  • Setting transaction isolation level on a replicated server stored procedure

    I have a SQL server that has replication turned onto to another server which is our reporting server. Replication is real-time (or close to it). On the report server I have a stored procedure that runs from a SRS report. My question is it possible or advisable
    or does it even make sense to set the "SET TRANSACTION ISOLATION LEVEL READ COMMITTED" on at the beginning of the stored procedure which selects data from the reporting server database? Is it possible for uncommitted data on the OLTP side of the
    house to be replicated before it is committed? We are having data issues with a report and have exhausted all options and was wondering if dirty data maybe the issue since the same parameters work for a report 1 sec and then next it doesnt.

    Only committed transactions are replicated to the subscriber.  But it is possible for the report to see dirty data if running in READ UNCOMMITTED or NOLOCK.  You should run your reports in READ COMMITTED or SNAPSHOT isolation , and your replication
    subscriber should be configured with READ COMMITTED SNAPSHOT ISLOATION eg
    alter database MySubscriber set allow_snapshot_isolation on;
    alter database MySubscriber set read_committed_snapshot on;
    as recommended here
    Enhance General Replication Performance.
    David
    David http://blogs.msdn.com/b/dbrowne/

  • Bug in Oracle's handling of transaction isolation levels?

    Hello,
    I think there is a bug in Oracle 9i database related to serializable transaction isolation level.
    Here is the information about the server:
    Operating System:     Microsoft Windows 2000 Server Version 5.0.2195 Service Pack 2 Build 2195
    System type:          Single CPU x86 Family 6 Model 8 Stepping 10 GenuineIntel ~866 MHz
    BIOS-Version:          Award Medallion BIOS v6.0
    Locale:               German
    Here is my information about the client computer:
    Operaing system:     Microsoft Windows XP
    System type:          IBM ThinkPad
    Language for DB access: Java
    Database information:
    Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.1.0 - Production
    The database has been set up using the default settings and nothing has been changed.
    To reproduce the bug, follow these steps:
    1. Create a user in 9i database called 'kaon' with password 'kaon'
    2. Using SQL Worksheet create the following table:
    CREATE TABLE OIModel (
    modelID int NOT NULL,
    logicalURI varchar (255) NOT NULL,
    CONSTRAINT pk_OIModel PRIMARY KEY (modelID),
    CONSTRAINT logicalURI_OIModel UNIQUE (logicalURI)
    3. Run the following program:
    package test;
    import java.sql.*;
    public class Test {
    public static void main(String[] args) throws Exception {
    java.util.Locale.setDefault(java.util.Locale.US);
    Class.forName("oracle.jdbc.OracleDriver");
    Connection connection=DriverManager.getConnection("jdbc:oracle:thin:@schlange:1521:ORCL","kaon","kaon");
    DatabaseMetaData dmd=connection.getMetaData();
    System.out.println("Product version:");
    System.out.println(dmd.getDatabaseProductVersion());
    System.out.println();
    connection.setAutoCommit(false);
    connection.setTransactionIsolation(Connection.TRANSACTION_SERIALIZABLE);
    int batches=0;
    int counter=2000;
    for (int outer=0;outer<50;outer++) {
    for (int i=0;i<200;i++) {
    executeUpdate(connection,"INSERT INTO OIModel (modelID,logicalURI) VALUES ("+counter+",'start"+counter+"')");
    executeUpdate(connection,"UPDATE OIModel SET logicalURI='next"+counter+"' WHERE modelID="+counter);
    counter++;
    connection.commit();
    System.out.println("Batch "+batches+" done");
    batches++;
    protected static void executeUpdate(Connection conn,String sql) throws Exception {
    Statement s=conn.createStatement();
    try {
    int result=s.executeUpdate(sql);
    if (result!=1)
    throw new Exception("Should update one row, but updated "+result+" rows, query is "+sql);
    finally {
    s.close();
    The program prints the following output:
    Product version:
    Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.1.0 - Production
    Batch 0 done
    Batch 1 done
    java.lang.Exception: Should update one row, but updated 0 rows, query is UPDATE OIModel SET logicalURI='next2571' WHERE modelID=2571
         at test.Test.executeUpdate(Test.java:35)
         at test.Test.main(Test.java:22)
    That is, after several iterations, the executeUpdate() method returns 0, rather than 1. This is clearly an error.
    4. Leave the database as is. Replace the line
    int counter=2000;
    with line
    int counter=4000;
    and restart the program. The following output is generated:
    Product version:
    Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.1.0 - Production
    Batch 0 done
    Batch 1 done
    java.sql.SQLException: ORA-08177: can't serialize access for this transaction
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
         at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
         at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:573)
         at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1891)
         at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1093)
         at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2047)
         at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1940)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2709)
         at oracle.jdbc.driver.OracleStatement.executeUpdate(OracleStatement.java:796)
         at test.Test.executeUpdate(Test.java:33)
         at test.Test.main(Test.java:22)
    This is clearly an error - only one transaction is being active at the time, so there is no need for serialization of transactions.
    5. You can restart the program as many times you wish (by chaging the initial counter value first). The same error (can't serialize access for this transaction) will be generated.
    6. The error doesn't occur if the transaction isolation level isn't changed.
    7. The error doesn't occur if the UPDATE statement is commented out.
    Sincerely yours
         Boris Motik

    I have a similar problem
    I'm using Oracle and serializable isolation level.
    Transaction inserts 4000 objects and then updates about 1000 of these objects.
    Transactions sees inserted objects but cant update them (row not found or can't serialize access for this transaction are thrown).
    On 3 tries for this transaction 1 succeds and 2 fails with one of above errors.
    No other transactions run concurently.
    In read commited isolation error doesn't arise.
    I'm using plain JDBC.
    Similar or even much bigger serializable transaction works perfectly on the same database as plsql procedure.
    I've tried oci and thin (Oracle) drivers and oranxo demo (i-net) driver.
    And this problems arises on all of this drivers.
    This problem confused me so much :(.
    Maby one of Oracle users, developers nows cause of this strange behaviour.
    Thanx for all answers.

  • Setting the Isolation Level to Read Uncommitted

    Hello All,
    We are using BO XI r3 and SQL Server 2008. I would like to change the isolation level of the connection to read uncommitted. There are 2 options that i could by Googling..
    1. Making changes in the SBO file... this didnt work
    2. Making changes in the connectinit... even this didnt work
    i am not sure if there is anything else to done...  but i tried quering a table with a lock, the report got stuck so i am guessing that the settings didnt work

    Hi
    this is the only method for changing the transaction isolation level.
    Locate the path to your odbc.sbo file
    Click the connection in UDT and when server responds Click the Details button
    scroll down to the sbo line
    That is the file location of your sbo file (this will be the same on client and server)
    This change needs to be done, for client and servers both
    The isolation can only be set for the global connection.  Not per universe.
    Locate the file and make a backup before making any changes
    Find the Tag
    <DataBase Active="Yes" Name="MS SQL Server 2008">
    Below that tag should be a "Force SQLExecute" Parameter
    Like This
    <Parameter Name="Force SQLExecute">Procedures</Parameter>
    ADD this line
    <Parameter Name="Transaction Isolation Level">READ_UNCOMMITTED</Parameter>
    Save the odbc.sbo
    After client and server are changed
    Restart SIA
    Run the webi document again.
    Locations of the sbo file:
    R2: <Installation Directory>:\Program Files\Business Objects\BusinessObjects Enterprise 11.5\win32_x86\dataAccess\connectionServer\rdbms
    R3: <Installation Directory>:\Program Files\Business Objects\BusinessObjects Enterprise 12.0\win32_x86\dataAccess\connectionServer\rdbms
    BI4: <Installation Directory>:\Program Files (x86)\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\dataAccess\connectionServer\rdbms
    To make these changes effect, you have to restart ‘CMS server’, ‘the Connection Servers’, ‘Webi Report Server’ from ‘Central Configuration Manager’ (CCM).
    Information is available in the Data Access guide
    Jacqueline

  • Isolation level setting

    An autonomous transaction has dml(s) and commit.when this is called inside a normal procedure, it will see the changes made in the Autonomous tx.
    Is there any ISOLATION LEVEL value we can set to make it invisible for the procedure to see these changes made by the Autonomous tx?

    No. Oracle only has two transaction isolation levels-- read committed and serializable, along with a read-only transaction option. In all three, the calling procedure will see the changes made by the autonomous transaction (test case below)
    Architecturally, though, I would question the wisdom of hiding the results of an autonomous transaction from the caller. If that is goal, I would tend to suspect that you want to call an asynchronous process (i.e. submitting a job that will run in a separate session) rather than doing the work in an asynchronous transaction.
    Test case
    Create the table, the calling procedure, and the autonomous transaction...
    SCOTT @ jcave102 Local> create table a ( col1 number );
    Table created.
    Elapsed: 00:00:00.28
      1  create or replace procedure insert_a( p_col1 number )
      2  as
      3    pragma autonomous_transaction;
      4  begin
      5    insert into a values( p_col1 );
      6    commit;
      7* end;
    SCOTT @ jcave102 Local> /
    Procedure created.
    Elapsed: 00:00:00.32
      1  create or replace procedure check_visible
      2  as
      3    l_num number;
      4  begin
      5    execute immediate 'TRUNCATE TABLE a';
      6    insert_a(1);
      7    select count(*)
      8      into l_num
      9      from a;
    10    if( l_num = 0 )
    11    then
    12      dbms_output.put_line( 'Invisible' );
    13    else
    14      dbms_output.put_line( 'Visible' );
    15    end if;
    16* end;
    SCOTT @ jcave102 Local> /
    Procedure created.
    Elapsed: 00:00:00.14In the default mode (read committed)
    SCOTT @ jcave102 Local> exec check_visible;
    Visible
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.15In the SERIALIZABLE mode
    SCOTT @ jcave102 Local> alter session set isolation_level=SERIALIZABLE;
    Session altered.
    Elapsed: 00:00:00.01
    SCOTT @ jcave102 Local> exec check_visible;
    Visible
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.03And with READ ONLY
    SCOTT @ jcave102 Local> set transaction read only;
    Transaction set.
    Elapsed: 00:00:00.01
    SCOTT @ jcave102 Local> exec check_visible;
    Visible
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.04Justin

  • Isolation level SERIALIZABLE problem

    Hi there,
    I have a problem with my stored procedures when the isolation level of the connection is serializable. I need to set this isolation level because of data consistency reasons.
    When in this isolation level and a transaction tries to update or delete data modified by a transaction that commits after the serializable transaction began, I get this error:
    ORA-08177: Cannot serialize access for this transaction
    This is normal. The thing to do in this case is catch the error in the exception handler, rollback to a certain savepoint and try to do the update again.
    The stored procedure that I use to test this is:
    CREATE OR REPLACE PROCEDURE nm_test IS
    tmpVar NUMBER;
    err_num NUMBER;
    err_msg VARCHAR2(200);
    teller number;
    BEGIN
    teller := 0;
    savepoint sp1;
    <<try_every_thing_again>>
    begin
    tmpVar := 0;
    update stock_prices set price = price + 1
    where ric = 1;
    DBMS_OUTPUT.Put_Line('teller = ' || teller);
    EXCEPTION
    WHEN others THEN
    err_num := SQLCODE;
    --err_msg := SUBSTR(SQLERRM, 1, 200);
         if (err_num = -8177) then
              rollback to savepoint sp1;
              --DBMS_LOCK.SLEEP(1);
              teller := teller + 1;
              if (teller < 10) then
                   goto try_every_thing_again;
              end if;
              DBMS_OUTPUT.Put_Line('exception: teller = ' || teller);
         end if;
    end;
    END nm_test;
    I test this using 2 connections to the database. In the first connection I run the stored proc (without committing). Then I run the same stored proc in the second connection. This will block on the update (the is an implicit lock), which is ok. Then I commit the first connection. The second catches the error, rolls back and tries the update again....but then it catches the exception again, and again???
    When I replace the "rollback to savepoint" by just "rollback", everything works fine (the exception is then caught only once) and the update succeeds on the second try.
    But I can not work with just a "rollback" because my stored procedures might be called by others for which I don't want to undo all the work.
    Do any of you know why I keep getting this error (the program ends up in an infinite loop if I didn't keep a counter and exit after 10 times)?
    Marcel van Vuure

    Marcel,
    First of all, I'd be interested in hearing why you think you need serializable transactions (why 'read committed' doesn't work for your application). In the 8 years I've been building Oracle apps, I've never deemed it necessary to use serializable transactions. Maybe an optimistic locking strategy will solve your problem.
    Secondly, if I were designing the interface, I wouldn't have a procedure in charge of both executing business logic AND retrying the logic in case of failure. I'd build a helper procedure that calls the procedure that does the work, looks for certain exceptions, and retries the procedure when necessary.
    Lastly, if your interface doesn't have transactional control (the caller is in charge of commits and rollbacks), maybe you should simply attempt the update statement and throw an exception to the caller and let them handle it.
    I'm sorry if I haven't directly solved your problem, but sometimes the best way to solve a problem is to question the decisions that got you there in the first place.
    Hi there,
    I have a problem with my stored procedures when the isolation level of the connection is serializable. I need to set this isolation level because of data consistency reasons.
    When in this isolation level and a transaction tries to update or delete data modified by a transaction that commits after the serializable transaction began, I get this error:
    ORA-08177: Cannot serialize access for this transaction
    This is normal. The thing to do in this case is catch the error in the exception handler, rollback to a certain savepoint and try to do the update again.
    The stored procedure that I use to test this is:
    CREATE OR REPLACE PROCEDURE nm_test IS
    tmpVar NUMBER;
    err_num NUMBER;
    err_msg VARCHAR2(200);
    teller number;
    BEGIN
    teller := 0;
    savepoint sp1;
    <<try_every_thing_again>>
    begin
    tmpVar := 0;
    update stock_prices set price = price + 1
    where ric = 1;
    DBMS_OUTPUT.Put_Line('teller = ' || teller);
    EXCEPTION
    WHEN others THEN
    err_num := SQLCODE;
    --err_msg := SUBSTR(SQLERRM, 1, 200);
         if (err_num = -8177) then
              rollback to savepoint sp1;
              --DBMS_LOCK.SLEEP(1);
              teller := teller + 1;
              if (teller < 10) then
                   goto try_every_thing_again;
              end if;
              DBMS_OUTPUT.Put_Line('exception: teller = ' || teller);
         end if;
    end;
    END nm_test;
    I test this using 2 connections to the database. In the first connection I run the stored proc (without committing). Then I run the same stored proc in the second connection. This will block on the update (the is an implicit lock), which is ok. Then I commit the first connection. The second catches the error, rolls back and tries the update again....but then it catches the exception again, and again???
    When I replace the "rollback to savepoint" by just "rollback", everything works fine (the exception is then caught only once) and the update succeeds on the second try.
    But I can not work with just a "rollback" because my stored procedures might be called by others for which I don't want to undo all the work.
    Do any of you know why I keep getting this error (the program ends up in an infinite loop if I didn't keep a counter and exit after 10 times)?
    Marcel van Vuure

  • SQLServer Isolation Level Problem?

    Since the MSSQLServer driver has trouble when returning explicit cursors, and since the complexitites of one of our procedures requires the use of cursors we have been forced to split a DBMS procedure into two. Ie. we have one method that updates the database and one that retrieves the "return value", ie. a setXXX and then a getXXX method.
    The problem is that we sometimes get an empty resultset from the getXXX method. Note that this behaviour is not due to the server code as this error is not present if run directly on the SQLServer (ie, not through the JDBC driver). Now testing to and fro suggests that the error is caused by some sort of parallell behaviour or isolation level trouble in the driver, but what exactly? The thing is, if I insert a pause of a few milliseconds between the two calls it works correctly (of course I cannot place a "random" pause there in production code since the pause will probably vary depending on the underlying hardware). I have tried setting to different TransactionIsolation levels, but get the same result all the time. There is only one linear execution of the code as shown below (no multithreading in the java application).
    What I'm wondering is: are there any "switches" to turn in relation to waiting for a a stored procedure to finish execution before the next is called? I would expect this to be implicit, but perhaps the SQLServer runs them in parallell and therefore the second method is called before the first is finished, but then, shouldn't the TransactionIsolationLevel of Serializable hinder this? I would appreciate any help on this one, sample code below, the problem being that wereas the while loop should always print the line it sometimes doesn't since the result is empty (not null, empty). It isn't the parameter to the execute_task either, we get the "missing result" problem with different paramaters that all always work when run directly on the SQLServer (via SQL Query Analyzer).
    //Execute the update to the server
    CallableStatement execute_task = connection.prepareCall("{call setXXX(?)}");
    execute_task.setInt(1, 1);
    execute_task.execute();
    //Retrieve the task execution results:
    CallableStatement show_execute_task = connection.prepareCall("{call getXXX}");
    show_execute_task.execute();
    ResultSet show_execute_resultset = show_execute_task.getResultSet();
    while(show_execute_resultset.next()){
    System.out.println("Result received");
    }

    Since the MSSQLServer driver has trouble when
    returning explicit cursors, and since the
    complexitites of one of our procedures requires the
    use of cursors we have been forced to split a DBMS
    procedure into two. Ie. we have one method that
    updates the database and one that retrieves the
    "return value", ie. a setXXX and then a getXXX method.
    The problem is that we sometimes get an empty
    resultset from the getXXX method. Note that this
    behaviour is not due to the server code as this error
    is not present if run directly on the SQLServer (ie,
    not through the JDBC driver). Now testing to and fro
    suggests that the error is caused by some sort of
    parallell behaviour or isolation level trouble in the
    driver, but what exactly? The thing is, if I insert a
    pause of a few milliseconds between the two calls it
    works correctly (of course I cannot place a "random"
    pause there in production code since the pause will
    probably vary depending on the underlying hardware).
    I have tried setting to different
    TransactionIsolation levels, but get the same result
    all the time. There is only one linear execution of
    the code as shown below (no multithreading in the
    java application).
    What I'm wondering is: are there any "switches" to
    turn in relation to waiting for a a stored procedure
    to finish execution before the next is called? I would
    expect this to be implicit, but perhaps the SQLServer
    runs them in parallell and therefore the second methodthis is what i would expect. parallel execution i mean... othewise you might as well use Access...
    is called before the first is finished, but then,
    shouldn't the TransactionIsolationLevel of
    Serializable hinder this? I would appreciate any helpi'm not sure...
    t be perfectly honest while i understand the different transaction levels on their face level as described in java.sql.Connection I am not entirely sure WHAT the expected behaviour actually is for each level.
    not to get too OT here but for example TRANSACTION_REPEATABLE_READ
    if the first transaction reads row 1 from tableA
    then a second transaction changes row 1 in table A and commits the changes
    the first transaction reads row 1 from table A again... what the heck is supposed to happen. i think it is supposed to read the same values as the first pass even though commited changes have been made but i'm not entirely sure.
    on this one, sample code below, the problem being that
    wereas the while loop should always print the line it
    sometimes doesn't since the result is empty (not null,
    empty). It isn't the parameter to the execute_task
    either, we get the "missing result" problem with
    different paramaters that all always work when run
    directly on the SQLServer (via SQL Query Analyzer).
    //Execute the update to the server
    CallableStatement execute_task =
    connection.prepareCall("{call setXXX(?)}");
    execute_task.setInt(1, 1);
    execute_task.execute();
    //Retrieve the task execution results:
    CallableStatement show_execute_task =
    connection.prepareCall("{call getXXX}");
    show_execute_task.execute();
    ResultSet show_execute_resultset =
    show_execute_task.getResultSet();
    while(show_execute_resultset.next()){
    System.out.println("Result received");
    }i don't really follow your code too well here but here is what i would suggest...
    fetch whatever the first procedure returns FIRST.
    this should force your app to wait on this before you execute the second one.
    does that make sense? it seems simple to me but maybe i'm missing something.

  • Transaction tab in ODI Procedure

    Hi Experts,
    Can anyone help me on what and how exactly the Transaction tab in the ODI Procedure step works? Thanks!
    Warm Regards,
    VBV

    Hi,
    I take you mean the Transaction drop box on a procedure step?
    This you can use to isolate transactions within the session, and commit at the end. For an example, if you want to load data from various sources into a table, you can set the Transaction for each procedure step to the same transaction isolation value, with the 'Commit' as 'No commit' and when all data is loaded into the table, have a commit step in your procedure to commit that specific transaction. If for some reason a step fails, then no data within that transaction will be committed to the database.
    Its the same as using SQL Developer and having auto commit turned off. You have to manually commit to the database if you want to see the data changes in another session, or you can Role Back your changes within the session if you do not want to commit them.
    Have a look at the IKM 'IKM Oracle Incremental Update' - this uses Transaction 1 on the following steps, both have a specified 'No Commit':
    'update existing rows'
    'Insert new rows',
    then has a specific commit step afterwards.
    Hope this helps.
    Cheers
    Bos

  • 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

  • Error Isolation Level not supported

    Hi,
    During a launch of a package, I have this error
    0 : null : java.sql.SQLException: SnpsConnection: isolation level not supported
    During the execution of a pl/sql procedure.
    When I run this one, I have no problem, but It doesn't work inside the packege.
    This is the configuration:
    Tecnology: Oracle
    Isolation level: not specified
    Contest: Global
    Transaction: Autocommit
    Schema: DB_Target
    Commit: not specified
    I have already tried other Isolation Level settings as: None,Default .... but no one works.
    Thanks for all and best regards.

    I guess you are taking Isolation level: None
    If it is, make it Undefined and run your package.
    Bhabani
    http://dwteam.in

  • How to run dynamic SQL from an ODI procedure step

    I am on ODI 11.1.1.6.4. From within an ODI IKM step I have no problem running a procedure step like the following which calls a pl/sql procedure to get SQL text then later runs that code. Is there anyway to do the same from within an ODI procedure? I've tried a couple of variations and can not seem to get the parsing levels to resolve within a procedure like they resolve from within a KM step.
    <@
    /* Setup Java variables */
    String out_SQL = "";
    try
    java.sql.Connection sourceConnection = odiRef.getJDBCConnection("SRC");
    String sqltxt = "{call set_sql(?)}";
    java.sql.CallableStatement pstmt = sourceConnection.prepareCall(sqltxt);
         try
         pstmt.registerOutParameter( 1, java.sql.Types.VARCHAR);
         pstmt.execute();
    out_SQL = pstmt.getString(1);
         catch(java.sql.SQLException ex)
              errMessage = ex.getMessage();
              errMessage = errMessage.replace("'","");
         finally
              pstmt.close();
    catch(java.lang.Exception e)
         errMessage = e.getMessage();
         errMessage = errMessage.replace("'","");
    @>
    BEGIN
    -- The SQL that I want to run
    <@
    out.println(out_SQL);
    @>
    -- Error handling
    <@ if ( out_SQL.length() ==0 ) { @>
         raise_application_error(-20101, '<@=errMessage@>');
    <@ } else { @>
         dbms_output.put_line('Successful.');
    <@ } @>     
    END;
    ------

    Please understand that I know that I can do this all within PL/SQL -- I am explicitly doing it the way I have outlined because I want to better understand the parsing levels/behavior within ODI procedures and I want to understand why KMs steps behave differently.
    Another observation -- putting this all within a pl/sql block prevents ODI from properly capturing insert/update/delete row counts like it would if it were running a SQL statement.
    So the question remains -- is there a way to run a dynamic SQL statement in an ODI procedure where the SQL statement is generated from within an Oracle procedure call and then run as SQL within an ODI procedure step? Best would be if there is an example of how this can be done.

  • 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]

  • Locks and Isolation Levels

    Hello,
    I'm new to the Oracle environment and have just started using PL/SQL on Oracle 8i. Where can I find info on how Oracle locks data and how transaction isolation levels are used? We've still not recvd our manuals so please any replies referring to manuals are not welcome!

    You could move forward balance into its own table. That was, the SELECT will not lock on the original table. Most of the running balance schemes that I have seen take a snapshot as of a given date (say, statement printing date) and record both the timestamp and the amount. Next month, you simply get last month's vaule and timestamp and query on transactions after that timestamp.
    - Saish

  • Can you set isolation levels of message-driven bean transactions?

    The problem: I have 3 different message-driven beans which each get a different type of message, except for a field that is common to all. That field is used as the primary key of an entity object. The message-driven beans configured to use a container managed transaction. Each message-driven bean, in processing the message, first does a lookup by primary key to see if the object associated with the key exists, and if it does not, it requests the entity's home object to create it. After that, they do further processing. The problem is that sometimes all the beans simultaneously get a message, resulting in each bean checking for the entity object at about the same time, and if they fail to find it (because none of them has created it yet), each creates an object, all with the same primary key. This is not caught until the beans start to complete their onMessage method, which I believe results in the container committing the transaction. One of the transactions will be committed successfully, while the other two will fail, get rolled back, and then be retried with the same message. The second time through, the other beans will find the entity object (since it has been created and committed) and they will complete correctly. In the end, they right thing occurs, except that there is a troubling exception or 2 in the log telling about the constraint violation (with the primary key) and the rollback. If it was just me, that would be fine, but our customer does not like to see exceptions in the log; that indicates to him that something is wrong.
    So, I am looking for someway to make sure that the actions of the message-driven beans are serialized. One suggestion from a colleague was to set the isolation level of the transactions being used by the container in processing the message-driven beans' onMessage method. However, the documentation does not mention any way to do this for a message-driven bean. Suggestions?
    Is the use of a UserTransaction a better way to do this? If I acquire a UserTransaction within the onMessage method of a message-driven bean, can I set its isolation level? How would this work? When I get a UserTransaction, does each client get a different transaction, or do they all get the same one?

    (1) The WebLogic JMS "unit-of-order" feature is a heavily adopted feature that was specifically designed to handle similar use cases - see the JMS developer guide for extensive documentation. In your use case, if "key" is used to define UOO, then there's no limit on the number of keys that can be processed concurrently, but messages for any particular key will be processed single-threaded in the order in which they were first submitted.
    Note that if you're using distributed destinations, the UOO feature is still fully supported - but the developer and/or administrator needs to decide whether to configure the destination to use "hash" or "path service" based routing (the JMS UOO edoc outlines the trade-offs).
    (2) Another alternative is to use a single MDB with max-beans-free-pool that processes all three types (as the other poster suggested). I think this assumes all MDBs run on the same JVM.
    (3) Another alternative is to use multiple queues, with a single MDB on each Q. Where some sort of hash algorithm is used to determine which Q is for the key. This approach is a "hand-coded" variant of the approach in (1) with "hash" based routing enabled...
    (4) If all MDBs actually do run in the same JVM, a third alternative is to use code the application to use a common lock to protect each key, eg, something like:
    // assume MyLock is simply a class with a "reference counter"
    // assume some global "staticHM" hash map that is all MDBs can access
    onMessage() {
    MyLock lock = null;
    key= msg.getKey();
    synchronized(staticHM) {
    lock = staticHM.get();
    if (lock = null) {
    lock = new lock();
    staticHM.put(key, new lock());
    lock.incRefCount();
    try {
    synchronized(lock) {
    // only one onMessage will be able to lock a particular key at a time
    do your work;
    } finally {
    synchronized(staticHT) {
    if (lock.defRefCount() == 0) staticHM.remove(lock);
    if (lock = null) staticHM.put(key);
    If multiple threads get a message with the same key, then only one thread at a time will work on the key.
    Hope this helps,
    Tom

  • Error in ODI procedure

    Hi Experts,
    I have created following procedure and triyng to get column value by using rownum. When I run the scenario, I am getting following exception at ODI Procedure step. Can any one please help me on it
    I have created loop package to fetch column value until loop end.
    Please let me know if you are not clear my query
    ODI Procedure:
    begin
    select a.eno into '#EMPNO' from (select rownum r,e.* from trg_emp_01 e) a where a.r=#Counter;
    end;
    #EMPNO variable created as alphanumeric datatype and
    #Counter variable created as alphanumic datatype and it is assign with '1' value
    Exception:
    6550 : 65000 : java.sql.SQLException: ORA-06550: line 1, column 25:
    PLS-00220: simple name required in this context
    ORA-06550: line 1, column 28:
    PL/SQL: ORA-00904: : invalid identifier
    ORA-06550: line 1, column 7:
    PL/SQL: SQL Statement ignored
    java.sql.SQLException: ORA-06550: line 1, column 25:
    PLS-00220: simple name required in this context
    ORA-06550: line 1, column 28:
    PL/SQL: ORA-00904: : invalid identifier
    ORA-06550: line 1, column 7:
    PL/SQL: SQL Statement ignored
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:316)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:282)
         at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:639)
         at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:185)
         at oracle.jdbc.driver.T4CPreparedStatement.execute_for_rows(T4CPreparedStatement.java:633)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1086)
         at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:2984)
         at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3057)
         at com.sunopsis.sql.SnpsQuery.executeUpdate(SnpsQuery.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execSrcOrders(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSqlS.treatTaskTrt(SnpSessTaskSqlS.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java)
         at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandScenario.treatCommand(DwgCommandScenario.java)
         at com.sunopsis.dwg.cmd.DwgCommandBase.execute(DwgCommandBase.java)
         at com.sunopsis.dwg.cmd.e.i(e.java)
         at com.sunopsis.dwg.cmd.g.y(g.java)
         at com.sunopsis.dwg.cmd.e.run(e.java)
         at java.lang.Thread.run(Thread.java:595)
    ODI Procedure:
    begin
    select a.eno into #EMPNO from (select rownum r,e.* from trg_emp_01 e) a where a.r=#Counter;
    end;
    Exception:
    6550 : 65000 : java.sql.SQLException: ORA-06550: line 1, column 26:
    PL/SQL: ORA-00936: missing expression
    ORA-06550: line 1, column 7:
    PL/SQL: SQL Statement ignored
    java.sql.SQLException: ORA-06550: line 1, column 26:
    PL/SQL: ORA-00936: missing expression
    ORA-06550: line 1, column 7:
    PL/SQL: SQL Statement ignored
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:316)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:282)
         at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:639)
         at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:185)
         at oracle.jdbc.driver.T4CPreparedStatement.execute_for_rows(T4CPreparedStatement.java:633)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1086)
         at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:2984)
         at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3057)
         at com.sunopsis.sql.SnpsQuery.executeUpdate(SnpsQuery.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execSrcOrders(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSqlS.treatTaskTrt(SnpSessTaskSqlS.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java)
         at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandScenario.treatCommand(DwgCommandScenario.java)
         at com.sunopsis.dwg.cmd.DwgCommandBase.execute(DwgCommandBase.java)
         at com.sunopsis.dwg.cmd.e.i(e.java)
         at com.sunopsis.dwg.cmd.g.y(g.java)
         at com.sunopsis.dwg.cmd.e.run(e.java)
         at java.lang.Thread.run(Thread.java:595)
    Thanks
    Phani
    Edited by: Phanikanth on Jul 9, 2010 1:25 AM
    Edited by: Phanikanth on Jul 9, 2010 2:08 AM

    Good point - In my case, these are single executable statements. These have been saved in ODI and executed successfully. Just no using my machine.
    EXAMPLE 1------------
    DECLARE
    RetVal ;
    I_STRING VARCHAR2(200);
    BEGIN
    I_STRING := '';
    RetVal := XXX.PKG_XXX.SF_COMMA_TO_TABLE ( I_STRING );
    COMMIT;
    END;
    EXAMPLE 2------------
    SELECT C.COL1, B.COL2, B.COL3,TO_CHAR(B.EFFDT,'YYYY-MM-DD') COL4,B.COL5,B.COL6
    FROM TABLE1 A, TABLE2 B, TABLE3 C
    WHERE
    and A.ID = 'XXX'
    and a.setcntrlvalue = ' '
    AND A.NAME = 'XXX'
    AND A.EFFDT =
    (SELECT MAX(A_ED.EFFDT) FROM TABLE1 A_ED
    WHERE A.SETID = A_ED.SETID
    AND A_ED.EFFDT <= SYSDATE)
    AND B.EFFDT =
    (SELECT MAX(B_ED.EFFDT) FROM TABLE2 B_ED
    WHERE B.SETID = B_ED.SETID
    AND B.ACCOUNT = B_ED.ACCOUNT
    AND B_ED.EFFDT <= SYSDATE)
    AND A.SETID = B.SETID
    AND A.RANGE_FROM = A.RANGE_TO
    AND B.ACCOUNT = A.RANGE_FROM
    AND A.SETID = C.SETID
    AND A.TREE_NAME = C.TREE_NAME
    AND A.TREE_NODE_NUM = C.TREE_NODE_NUM
    AND C.EFFDT =
    (SELECT MAX(C_ED.EFFDT) FROM TABLE3 C_ED
    WHERE C.SETID = C_ED.SETID
    AND C_ED.EFFDT <= A.EFFDT)
    ------------------

Maybe you are looking for