BC4J Issuing Rollback to Savepoint

Hi we are having a serious issue with BC4J in our production environment. It issues a Rollback to Savepoint command. The database session that performs the command still has a locks in the database, specifically on the rollback segment.
When other users then insert/update they must wait for the other session to release it's locks.
Has anyone else encoutered a similar problem? Workarounds?
Thanks

Hi we are having a serious issue with BC4J in our production environment. It issues a Rollback to Savepoint command. The database session that performs the command still has a locks in the database, specifically on the rollback segment.
When other users then insert/update they must wait for the other session to release it's locks.
Has anyone else encoutered a similar problem? Workarounds?
Thanks

Similar Messages

  • Rollback to savepoint does not work in 2.1.1.64 version?

    I did an insert, created a savepoint called first_update and received the savepoint created successfully message. I then did an update and then typed in: rollback to first_update. I received the message: rolledback and it rolled back all the way. It ignored the savepoint. Previous versions would rollback to the marker(savepoint) and I would receive the message: rollback to succeeded. I am running against an 11gR1 database on Windows.
    Is this a bug? or is there a setting somewhere that needs to be changed?
    It works in sqlplus still.
    Sep 23, 2010 - I went back to test this in versions 1.2.1 and 1.5 and it works there. It does not work in 2.1.0.63 either.
    Thanks.
    DS
    Edited by: user2552416 on Sep 17, 2010 6:07 AM
    Edited by: user2552416 on 23-Sep-2010 7:22 AM

    The ROLLBACK TO SAVEPOINT command does not seem to be recognised by SQL Developer, but it does in SQL*Plus!
    When you issue a "ROLLBACK TO SAVEPOINT" in SQL Developer or in SQL*Plus, they both give a "Rollback complete." message, however SQL Developer has done a "ROLLBACK;" and SQL*Plus has correctly done a "ROLLBACK TO SAVEPOINT".
    (FYI: The documentation suggests that "ROLLBACK TO SAVEPOINT" should give a 3-word message: "Rollback to complete" whereas "ROLLBACK" should give a 2-word "Rollback complete", but it does not.)
    See Savepoint in a transaction.

  • Popup content not displaying after doing a rollback using savepoint feature

    Hello everyone,
    I have a pop up window which has a taskflow embedded as a region. This taskflow has an activity which does the rolling back of changes done in the task flow using the restore save point feature.
    I have a cancel button on the pop up and it is bound to the cancel activity so that when the user clicks on the cancel button, the changes are discarded and the popup is closed(using a managed bean).
    I am able to discard the changes using this feature.
    My problem is when I try to invoke the same popup in the same session, only a very small panel window appears and nothing else.
    This happens only if I do the rollback feature. Just closing the pop up without any changes and reopening works.
    I tried several ways and can't find a solution to this problem. Can any one help ?
    thanks
    AC
    Edited by: user723140 on Nov 25, 2008 1:27 PM

    Hi,
    restore to savepoints happens when you exit the bounded taskflow with a return. So in your case you are actually closing the taskflow, which is not what you should do in a region. This is why it comes up empty. What you can try is to
    - set the popup loading to lazyUncached
    - set the refresh on the region container to ifNeeded
    - set the refresh condition to some value reference that changes with each call to region (e.g. a managed bean that returns the time in ms)
    Not sure if this will re-create the taskflow, but chances are that it does
    Frank

  • BC4J commit/rollback transaction

    I'm using the following code (copied from the complete UIX BC4J application) to delete a row:
    <event name="removeCaractGrupo">
    <bc4j:findRootAppModule name="GruposMineriosAppModule">
    <bc4j:findViewObject name="ClasseAtualCaractGrupoMinerioView">
    <bc4j:findRowByKey>
    <bc4j:keyBinding>
    <bc4j:selectionKey name="caractGruposData" key="keyCaractGrupo" />
    </bc4j:keyBinding>
    <bc4j:handlers>
    <bc4j:removeRow />
    <bc4j:executeQuery/>
    </bc4j:handlers>
    </bc4j:findRowByKey>
    </bc4j:findViewObject>
    <bc4j:commit/>
    </bc4j:findRootAppModule>
    </event>
    It works fine but if the row cannot be removed because of a constraint violation the row is still removed from the viewObjectScope and appears again only if I send a <bc4j:rollback/> command.
    The question is: is there any approach like a try/catch within the uiXML event handler??
    <ui:try>
    <contents>
    <bc4j:commit/>
    </contents>
    <ui:catch>
    <bc4j:rollback/>
    </ui:catch>
    </ui:try>
    Or do I have to call a Java class method to do this??

    There's nothing like <try>/<catch> in the event handler section. It looks like you'd need to replace the commit handler here with handcoded Java that will rollback in case the commit fails.

  • EPMA Deployment Issues (Rollback Database)

    I have seen some posts where users were able to rollback their EPMA databases. This could be helpful when running into deployment issues. Can anyone outline the steps that are needed to rollback an EPMA database?
    Thank you

    spring_patel wrote:
    i really appreciate you trying to solve my problem..
    but i think...my estion is fairly simple and straight forward...and i've provided every detail of my problem(if uv'e read my opening post of this thread)....
    and as far as that link goes...i've already checked it b4 u guys mentioned it... as it is provided right there in the tutorial i've provided link of...
    and i've tried my options b4 making use of this forum...and i didnt find a solution that's why i'm taking ur help..
    nevertheless...i repeat my question...
    there's a tutorial at this link...[http://www.netbeans.org/kb/docs/java/gui-db.html]...in it is described how to create a java desktop database applicaiton...
    at the end of the tuorial there is a section called: "Building and Deploying the Application"
    in that section they have instructed to exit netbeans IDE and try and run the application outside it...which is not happening
    the reason they say is that i've to start Java DB from outside of the IDE...that is wat my problem is ..
    i dont know how to start Java DB from outside the Netbeans ide...You are not telling us anything.
    If I tell you "my automobile doesn't work" how do you know what is wrong. Instead I need to tell you one of the following.
    1. The engine didn't start.
    2. The wheel fell off.
    3. The engine caught fire.
    4. When I went to the driveway the car wasn't even there.
    When you "run" something then something happens. When I run notepad from a console window if notepad is not in the path then I will get an error about command not found. if it is in the path then the command executes and notepad pops up. Even if I don't see notepad pop up I know that the command seemed to execute from the command window.
    The above are examples of describing what you did and what did happen. In detail.
    "It doesn't work" provides neither detail about how you ran it nor what did happen when you did attempt to run it.

  • Aaargh!  BC4J issue: caches not clearing properly?

    Okay, I've spent a day on this already - perhaps someone can help?
    In a nutshell:
    I've designed myself a View Object and put it in an application module.
    I programmatically execute the VO and loop through it deleting each row with remove();
    I re-executeQuery on the View Object, and when I loop through it using while next() not null I get one row returned, even though I'd just deleted them all?!
    But the real cruncher is, when I step through the code in debug mode my results are different: then (seemingly as long as I've given the IDE a rest between the getTransaction().commit() and the re-execution of the view), I get the correct 0 rows returned. (If instead I keep hitting f8 sufficiently quickly that the IDE can't keep up, I get 1 row returned.)
    My hunch is that garbage collection is doing something in the gap, but I can't think what would that would be....
    HELP!!!!! (Please.)
    More info:
    Imagine a Role table and an Operation table and the Role_Operation table effecting a many-to-many join between them. The view is drawn with the Role_Operation table as its "primary" entity, then it read-only-reference links to the Role and Operation entities to get the relevant descriptions. It's not an expert view. (Some of mine are because I'm using MySQL. What can I say? It was forced upon me!)
    Things are a little less straightforward than the above (because I'm still using my real-world code) - between the delete and the re-query I use another simple view based on the role entity to update its description... I guess my next step will be to try it with this out.
    When the problem originally surfaced after the commit I was checking the appmodule back into the pool (stateless) and checking it (the pool was giving me the same one) out again before requerying, so the problem seemed to survive that. I also tried setting the transaction's clearCacheOnCommit(true) and that didn't help.
    I'm using JDeveloper 9.0.3 production release. I tried BC4J diagnostics and can't see any difference there. I've got MySQL logging queries and they seem to be the same (and give the correct results) in both cases (as you'd expect). I've run the code under Tomcat on both Oracle and Sun JVMs and get the erroneous row in both cases.
    Any ideas????
    Thanks, Mike.

    Steve,
    I've read your whitepaper several times. Each time a little more sinks in...
    Passivation is unfortunately one for the future - I've been told to use MySQL and I'm doing everything statelessly...
    IIRC, the whitepaper is in favour of passing the view objects directly to the JSP(view) layer, rather than (deep breath) using the view objects to access data to populate into collections of JavaBeans to pass to the view.
    Based on the keep-it-simple principle I agree with you: it's a lot more straightforward to use a view object and as long as my application has a decent <i>logical</i> separation between the MVC layers I'm reasonably happy to forget a <i>physical</i> one. (It makes it a lot easier to explain to people coming from a non-J2EE direction; also, I think it'd be quite difficult to respond to an "Okay, so for every view-row we have you want me to define a Bean and before we forward to the JSP we pack everything into Beans and then in the JSP we unpack everything out of the Beans, and I'm doing this because it makes things easier?")
    [Note that I don't consider that the ViewObject provides a hard physical separation because in the general case a JSP (view)layer could still add/update/delete rows and therefore affect the database/model.]
    Beans seem to provide one real advantage above the fact that they provide type-safety at compile time (which BC4J does if you java-generate the row-class - which I have): once I've defined a bean I can populate it from anywhere I want.
    I was trying to extend this "populate from anywhere" to ViewObjects. After all, once I've decided to use ViewObjects why do I want to use JavaBeans <i>at all</i> to pass anything to the JSP?
    The particular scenario I was thinking of was where I've written a JSP to produce an HTML form containing all the current data about an entity, where the information is supplied to it in a view-row. The user then changes some of the values and asks to save..... but wait, there's an error in one of the fields! So what my application should do is redisplay the form (on which there's a message detailing the problem) along with all the "new" data that the user submitted. To have it do that, the simplest way is if I pass it the data in exactly the same way as I did to start - in a ViewObject. It seems to me that'll have to be the same ViewObject or I lose my type-safety, so I can't downgrade to AttributeList, and even if I could that'd mean almost identically duplicating many of the Views in my application.
    And dammit... I've just seen that BC4J already allows this when you have statefulness. You can part populate the "database-linked" view-row and pass it back to the JSP. Dammit. But it doesn't help poor old stateless me: if I want that functionality I'll have to have the JSP expect either a VO <b>or</b> a bean-collection, or I'll have to extract everything into beans.
    Two other things, not related to the above.
    The first is that, despite having tried to take in as much documentation as I could, I didn't initially understand that when you use application modules to findViewObject you always get back the same VO and that if you change the Where clause then it affects all rowsets based on that VO. (In fact I'm not even exactly certain that what I just said is true - I just know I have to be careful!) This actually seems like slightly strange behaviour to me (and should be made clearer)! The reason being, in the same way as you said (elsewhere) that you'd taken to defining a method on the specific-view's Impl class to encapsulate the setting of the where-clause-parameters, I thought it made sense to have a number of methods encapsulating the setting of the parameters AND the where-clause itself. (And the order-by too!) In that way I have one view object, in general designed without a where clause, that allows me to execute it as VO.executeQuery() or VO.executeQueryForID(...) or VO.executeQueryOrderByDeptDesc().
    Having read something that led me to the understanding above, I've taken to using findViewObject (or the container's getter when inside the AppModuleImpl, since this gives type-safety), getting its DefFullName via it's ViewDef object, and then using createViewObject to get my own copy (giving it a name that includes the name of the method that instantiated it, so I don't have to look for clashes beyond that method). I trust you approve?
    Oh, and the second one is that I still don't exactly understand what the parameter means in SessionCookie's useApplicationModule(true/false), despite having read the javadoc. My best guess is that whichever I use the application module instance is dedicated for the use of only that session-cookie instance (until it's checked back in), but that if I use "true" to obtain a lock then the pool is going to block the same session-cookie from checking out that same(?) application module (probably from a different thread) until it's been checked back in?
    Does that sound correct? (In my web-app I'm currently checking out my appmodules (in servlets) with a "true" argument.)
    Phew! Sorry about all that feedback. I'm feeling bad that I'm slowing the book up...
    Regards,
    Mike.

  • 3.2; BC4J; GridControl; Rollback

    Hi,
    I attached a ComboBox and CheckBox on the grid and they works fine. but if for any reason i got JBO/ORA exception and then clicked on Rollback icon on NavigationBar,
    will lost the attached Combo/Check box.
    and the custome cell will back to the regular textField.
    Note that, i instantiated the attached Combo/Check box after publishing session.
    I beleive probebly this couse the problem.
    Any idea? please advice.
    Thanks
    null

    This was registered as a bug. The rollback screws up all grid control modifications back to the default.
    I get around this by my ol' rowChangeListener... the NEXT time it fires, I check to see if a "title" is correct, and if it isn't, I ReApply my grid control changes.
    This doesn't fix the problem immediately, but it's better than nothing, until a patch/rev comes out from Oracle.
    null

  • Savepoint issue

    create table test (num NUMBER);
    insert into test values(1);
    insert into test values(9);
    savepoint a;
    insert into test values(7);
    update test set num=100 where num=9;
    savepoint b;
    delete from test where num=1;
    commit;
    delete from test where num=1;I am getting an error when i issue
    rollback to savepoint a;
    error
    SQL Error: ORA-01086: savepoint 'A' never established
    01086. 00000 -  "savepoint '%s' never established"
    CORRECTED THE ERROR CODE
    Edited by: Rahul India on Feb 19, 2013 2:39 PM

    Hi,
    See below which I executed in my database (11.2)
    You are getting the error because you are using ROLLBACK TO <Savepoint_Name> after executing the COMMIT. After commiting savepoints which were created previously will not exist.
    SQL> create table test (num NUMBER);
    Table created
    SQL> insert into test values(1);
    1 row inserted
    SQL> insert into test values(9);
    1 row inserted
    SQL>  savepoint a;
    Savepoint created
    SQL> insert into test values(7);
    1 row inserted
    SQL>  update test set num=100 where num=9;
    1 row updated
    SQL>  savepoint b;
    Savepoint created
    SQL> delete from test where num=1;
    1 row deleted
    SQL> commit;
    Commit complete
    SQL> delete from test where num=1;
    0 rows deleted
    SQL> rollback to savepoint a;
    rollback to savepoint a
    ORA-01086: savepoint 'A' never established in this session or is invalid
    SQL> If I remove COMMIT then SAVEPOINT will exist
    SQL>  insert into test values(1);
    1 row inserted
    SQL>  insert into test values(9);
    1 row inserted
    SQL>   savepoint a;
    Savepoint created
    SQL>  insert into test values(7);
    1 row inserted
    SQL>   update test set num=100 where num=9;
    1 row updated
    SQL>   savepoint b;
    Savepoint created
    SQL>  delete from test where num=1;
    1 row deleted
    SQL>  delete from test where num=1;
    0 rows deleted
    SQL>  rollback to savepoint a;
    Rollback complete
    SQL> Edited by: Suri on Feb 19, 2013 2:40 PM

  • Rollback / savepoint Issue

    Hi,
    I'm a little confused on how the rollback to savepoint works in the database.
    A transaction statement such as Rollback fires an internal commit. Does the command :
    Rollback to savepoint <savepoint name> also issues an implicit commit?
    I did the following which caused all the confusion:
    SQL>commit;
    SQL> insert into table_name values ('sdf',23,...);
    SQL> 1 Row isnerted
    SQL> insert into table_name values ('sdf',23,...);
    SQL> 1 Row isnerted
    SQL> insert into table_name values ('sdf',23,...);
    SQL> 1 Row inserted
    SQL> Savepoint A;
    SQL> Savepoint created
    SQL> insert into table_name values ('sdf',23,...);
    SQL> 1 Row inserted
    SQL> insert into table_name values ('sdf',23,...);
    SQL> 1 Row inserted
    SQL> insert into table_name values ('sdf',23,...);
    SQL> 1 Row inserted
    SQL> Savepoint B;
    SQL> Savepoint created
    SQL> insert into table_name values ('sdf',23,...);
    SQL> 1 Row inserted
    SQL> insert into table_name values ('sdf',23,...);
    SQL> 1 Row inserted
    SQL> insert into table_name values ('sdf',23,...);
    SQL> 1 Row inserted
    SQL> Savepoint C;
    SQL> Savepoint created
    Now if we do a :
    SQL> Rollback to Savepoint B;
    SQL> Rollback completed
    Would an implicit commit be fired after this statement which would erase all marked savepoints ?
    Because it was possible to do a :
    SQL> Rollback to Savepoint A
    SQL> Rollback Completed

    hi,
    Rollback doesn't implicitly commit anything.
    commit means sth different than rollback.
    When commit,
    All transactions get saved in the database,
    Log maintained
    All locks released
    etc...In Rollback to savepoint,
    Related transaction rollbacked but previous one are still in pending not commited
    related locked released , not all locks which is occured due to previous one.
    etc...hv a nice day,
    Rup

  • Use of savepoint and rollback in trigger of forms

    I have a button in forms with next code
    --savepoint   
    SAVEPOINT SAVEP1;
    --Call procedure of BBDD: Changed data of tables
    Packet.procedureexample(..., bResult);
    --If not correct the execution -> rollback to savepoint and exit form
    IF NOT bResult THEN
      ROLLBACK TO SAVEPOINT SAVEP1;
      Exit_Form(NO_VALIDATE);
    END IF;
    -- Othe savepoint
    SAVEPOINT SAVEP2;
    --Call other procedure of BBDD: Changed data of tables
    Packet.procedureexample2(..., bResult);
    --If not correct the execution -> rollback to savepoint and exit form
    IF NOT bResult THEN
      ROLLBACK TO SAVEPOINT SAVEP2;
      Exit_Form(NO_VALIDATE);
    END IF;
    --All correct -> COMMIT
    COMMIT;This question is: if execution of "Packet.procedureexample" is correct, but the execution of "Packet.procedureexample2" isn't correct, what happend with data changed for first procedure (Packet.procedureexample).
    Thnks.

    Hi Jortri,
    If execution of "Packet.procedureexample" is correct, but the execution of "Packet.procedureexample2" isn't correct,
    Nothing will happen to data changed for Packet.procedureexample because it has not yet been committed.
    It's because when you are giving rollback to save point, you've also done Exit_Form(NO_VALIDATE); COMMIT is only at the last.
    Hence, if Packet.procedureexample2" is not correct, it'll roll back to save point 2(SAVEP2) and exit the form without validating.
    Since, commit is not issued till now, whatever data modification were done using Packet.procedureexample, are lost.
    If both of the packages data are independent of each other and you don't want to lose the change then issue a commit before creating second savepoint.
    Hope it helps.
    +Please mark answer as helpful / correct, if it helps you+
    Navnit
    Edited by: Navnit Punj on 17-Jun-2009 02:10

  • JDev 9.0.3, BC4J, char column, db 9.2.0.1 issue

    I have a query that I run to list points of contact and addresses. I use the BC4J jbo tag to create a view object on the fly. I don't know if this is a JDev issue or the RDBMS issue...the column in question is defined as char(2).
    The problem is that I get different results, depending upon whether I'm connected to an 8.1.7.4 db or 9.2.0.1. Both are on Windows platforms. 9.2 is "personal" (i.e. loaded on my laptop), 8.1.7.4 is EE. The test piece of code which reproduces is:
    <%
    //Build the main query and join the region table
    String newquery = "SELECT POC_ID, POC_REGION_ID, POC_LAST_NAME, POC_FIRST_NAME, POC_MID_NAME, " +
    "POC_ADDR_LN1, POC_ADDR_LN2, POC_ADDR_LN3, POC_CITY, POC_STATE_CD, POC_ZIP_CD, REGION_ID, REGION_NAME " +
    "FROM CS_POINT_OF_CONTACT, REF_FISTS_REGION " +
    "WHERE POC_REGION_ID = REGION_ID AND POC_ID is not null AND POC_ACTIVE = 'Y' " +
    "ORDER BY POC_LAST_NAME, POC_FIRST_NAME, POC_MID_NAME";
    %>
    <jbo:CreateViewObject appid="Mypackage1Module" name="SelectionView">
    <%= newquery %>
    </jbo:CreateViewObject>
    <jbo:DataSource id="ds" appid="Mypackage1Module" viewobject="SelectionView" />
    <jbo:RowsetIterate datasource="ds" changecurrentrow="false" userange="false" >
    <jbo:Row id="aRow" datasource="ds" action="Active"/>
    <%
    //Check for State
    String AddrState = "";
    if(aRow.getAttribute("POC_STATE_CD") == null) {
    AddrState = "";
    } else {
    AddrState = "|" + (String) aRow.getAttribute("POC_STATE_CD").toString() + "|";
    System.out.println(AddrState);
    out.println(AddrState);
    out.println("<BR>");
    %>
    </jbo:RowsetIterate>
    When using 8.1.7.4, I get:
    |NY|
    |OH|
    |MA|
    When using 9.2.0.1, I get (note extra spaces):
    |NY |
    |OH |
    |MA |
    I know the tables are defined the same way, I exported from 8.1.7.4 and imported to 9.2.0.1 and checked the column definitions.
    This is causing an issue with my application as the extra spaces do not match up with the data queried elsewhere.
    Is this a BC4J issue, DB issue, driver issue?
    Regards,
    Jeff

    OK -- JDev: 9.0.3.1035
    I'm not sure how to tell which JDBC driver(s) I'm using, but in Jdev\jdbc\lib
    Directory of C:\jdev903\jdbc\lib\*
    11/27/2002 4:37 <DIR> .
    11/27/2002 4:37 <DIR> ..
    10/08/2002 3:40 1,154,398 classes12.jar
    10/08/2002 3:40 1,159,789 classes12dms.jar
    10/08/2002 3:40 1,000,798 classes111.jar
    10/08/2002 3:40 1,394,295 nls_charset11.jar
    10/08/2002 3:40 1,394,764 nls_charset12.jar
    and in Jdev\jdbc\lib817:
    Directory of C:\jdev903\jdbc\lib817\*
    11/27/2002 4:36 <DIR> .
    11/27/2002 4:36 <DIR> ..
    10/08/2002 3:40 1,932,480 classes12.zip
    Jeff

  • How to make savepoint in CO then rollback to that savepoint.

    Can make savepoint in CO then rollback to savepoint.
    How to create savepoint.
    How to rollback to savepoint.
    Thank you very much.

    I'm working with VO.
    Example : Application master-detail in screen show many master when click button to created new master still keyin in same page.
    After click created master
    keyin Master current record without keyin detail then goto another master (in same page) click add button detail for this record then click cancel in cancel button coding is rollback then I would like to rollbak only detail I don''t want to rollback current master current record but when rollback it rollback all record that not yet to commit.
    Thank you very much.

  • BC4J FOR UPDATE problem

    I created bc4j entity and view based on DB View with INSTEAD OF trigger. When I try to delete some rows from bc4j view I gut a mssg:
    (java.sql.SQLException) ORA-02014: cannot select FOR UPDATE from view with DISTINCT, GROUP BY, etc.
    How to make bc4j to do nothing and to pass control to view's INSTEAD OF trigger?
    Thanks

    I had the same problem using INSTEAD OF in combination with VPD. When i remember correctly, for views without VPD, the FOR UPDATE NOWAIT works.
    You can overwrite the lock() method in your EntityImpl and lock the tables manually like this:try {
      getDBTransaction(  ).executeCommand( "declare v_my_table_id integer; begin "
                             + "SELECT my_table_id INTO v_my_table_id FROM mytable "
                             + "WHERE my_table_id = "
                             + getMyTableId(  )
                             + " FOR UPDATE NOWAIT; END;" );
      setLocked( true );
    } catch( RuntimeException exception ) {
        throw exception;
    }Sadly there is no SAVEPOINT support in BC4J, so if you have more than one table, better create a DB Package function that issues a savepoint, try to lock each of the tables and do a ROLLBACK TO savepoint if one of the SELECT FOR UPDATE fails.
    hth, Markus

  • SAVEPOINT BO_SP

    Hi
    I have built an application with jheadstart, and it have been working very well, but some time when I save a row, the application return the message "SAVEPOINT BO_SP" instead of "Satisfactory transaction". If I push the botton "save" again then I obtain the message "Satisfactory transaction".
    What is happend?
    Thanks in advance
    Liceth

    Liceth,
    This is not a very typical error to get. Usually it means that there is custom code in the ApplicationModule that interferes with the normal transaction mechanism of ADF BC. For instance if you have custom code that performs rollbacks when ADF BC doesn't expect it.
    When BC4J starts posting data to the database, it starts by setting a savepoint with the name BO_SP on the database. Then, when an error occurs during processing (typically, invoking doDML() methods on EntityImpl objects), it will execute a 'rollback to savepoint' on the database. The error you are getting means that ADF BC executes this 'rollback to savepoint' while this savepoint is (no longer) present. I have experienced two ways in which this mightoccur. One is if a doDML() method issues a rollback on the database. Another is that a JboException occurs in very specific locations AFTER the rollback to savepoint has already been performed.
    I have never seen a Jhs application run into this problem without any custom transactional logic in the Business Components. The only thing that could indicate a problem in our code is if you are using CDM Ruleframe on the database (and use the RuleFrameApplicationModuleImpl as superclass of your appmodule). Could you indicate if either might be the case?
    Kind regards,
    Peter Ebell
    JHeadstart Team

  • ORA-01002 fetch out of sequence issue

    Hi,
    I am facing a weird ORA-01002 issue where I am passing the payload by opening a cursor to a separate package which has the merge statement. This fails with ORA-01002 error when there are multiple updates for a single record on target. I read through the Oracle documentation which states "MERGE is a deterministic statement. That is, you cannot update the same row of the target table multiple times in the same MERGE statement."
    My use case is such that there can be multiple updates in a day for an account and I have to maintain history for this on the target and I have a merge to do this. I am implementing SCD using triggers. What do you guys suggest to implement this solution? I need to update the same target table record multiple times in the same MERGE statement.
    Calling procedure:
    declare
    acct load_<package>.account_list;
    begin
    OPEN acct FOR
            SELECT DISTINCT<cols>
          FROM <table> where action_type='UPDATE' order by account_updatedate;
            load_<package>.<proc>(acct);
        CLOSE acct;
    end;
    Merge package/procedure:
    PROCEDURE merge_<proc(acct IN account_list)
      AS
      BEGIN
        MERGE INTO <target_table> d USING (
          SELECT DISTINCT *
          FROM TABLE(<pipelined_proc>(acct))
        ) s
        ON (<condition>   
        WHEN NOT MATCHED THEN INSERT (
          <cols>
          ) VALUES (
    <cols>      );
        COMMIT;
      END;
    Thanks,
    Vikram

    The thread title's ORA-01002: fetch out of sequence error is potentially from the merge statement restarting to get a consistent view of the data.
    It looks like "acct" is a REF CURSOR. If the merge decides to restart, the cursor cannot be restarted, so you will get a ORA-01002: fetch out of sequence error. That's a problem with using a ref cursor inside a SQL statement that modifies data - the statement can restart.
    E.g. see AskTom: Ask Tom &amp;quot;BEFORE Triggers Fired Multiple Times &amp;quot;
    The current URL for the statement
    If the triggering statement of a BEFORE statement trigger is an UPDATE or DELETE statement that conflicts with an UPDATE statement that is running, then the database does a transparent ROLLBACK to SAVEPOINT and restarts the triggering statement. The database can do this many times before the triggering statement completes successfully. Each time the database restarts the triggering statement, the trigger fires. The ROLLBACK to SAVEPOINTdoes not undo changes to package variables that the trigger references. To detect this situation, include a counter variable in the package.
    is PL/SQL Triggers

Maybe you are looking for