Commit sequence

Hi all,
I'd like to know a little more on a DB commit process. In my database,
Table A is parent of Table B. And Table B is parent of Table C. The following code will attempt to fill each of these table with respect to their relationship:
class Update {
  DAOFactory mySQL = null;
  ServiceTable_A serviceA = null;
  ServiceTable_B serviceB= null
  ServiceTable_C serviceC =null;
  public Update(){
      mySQL = DAOFactory.getDAOFactory(DAOFactory.MYSQL);
     serviceA = mySQL.getServiceA();
     serviceB = mySQL.getServiceB();
     serviceC = mySQL.getServiceC();
  public void addToA(Person A){
       int status = serviceA.insert(A);
  public void addToB(Relative B){
       int status = serviceB.insert(B);
  public void addToC(Address C){
       int status = serviceC.insert(C);
  public boolean success(){
       if(status > -1){
           mySQL.commit();  //see snapshot of commit method below
      else
           mySQL.rollback();
class PerformUpdate(){
    Update update = null;
    Person A = null;
    Relative B = null;
    Address C = null;
    public PerformUpdate(Update d){
         update= d;
    public void performNewPerson(Person A, Relative B, Address C){
          update.addToA(A);
         update.addToB(B);
         update.addToC(C);
class View{
    private boolean UPDATE = true;
    private PerformUpdate perf = null;
   public void constructObjsFromInput(){
         // I construct Person A, Relative B, Address C objs here
   public void executeAction(){
        constructObjsFromInput();
        if(UPDATE){
            perf = new PerformUpdate(new Update());
            perf.performNewPerson(A, B, C);
  //HERE IS A SNAPSHOT OF THE COMMIT METHOD IN MYSQL FACTORY
  public void commit(){
     if( ! connection.isAutoCommit()){
            connection.commit();
            connection.setAutoCommit(true);
                  dbUtils.close(connection);  //dbUtils will close connections in
                                                                   //finally block
  }serviceA, serviceB, and serviceC have their own preparedStatements that
executes insert commands.
Assume that none of them fail, it's still important that serviceA commits first, followed by serviceB, then serviceC based on their relationship.
Is there anyway that the sequence of execution triggered by the commit gets jacked up on the way to the DB ? I tested this situation several times.
Two situations occur wih the same set of data:
1. Table B, child of Table A, cannot be updated because of foreign key constraints. It is as if, serviceB attempted to be updated before Table A did !
2. Table C, child of Table B, cannot be updated because of foreign key constraints. It is as if, Table A update occured first, then Table C's followed by table B.
Are we guaranteed that preparedStmts will be committed with respect to the time they were called ?
or does it depend the weight of their query ?
or it's just up to the JVM to give resources to whichever one? If so, do we have a way to force the sequence to happen in one way ?
Thanks

also check for any key assumptions that may not be
valid. What is the foriegn key constraint? Is it an
autonumber that you are making an assumption about
that when it turns out to be not what you think blows
it all up?That's exactly right. The DB keys are auto-generated, auto-incremented.
With this in mind, if i want to add a new field to a Table , I compute the next number sequence of the key. In that manner:
class ServiceToTable_A implements ServiceA_DAO{
    private Connection con = null;
    public ServiceToTable_A(Connection con){
          this.con = con
    // The body structure of this method is the same for all other daos
   // except that I query the appropriate table for a given service
    public int nextSeq(int increment){
         int key = 0;
         Statement stat = null;
         ResultSet keySet = null;
          try{
                  String query= "Select * from table A";
                  stat = con.createStatement();
                  keySet = stat.executeQuery(query);
                  keySet.last();   //move cursor to last row
                  key = keySet.getInt("person_id");
          }catch(Exception n){
               //log error             
           finally{
              stat.close();
              keySet.close();
          return key + inc;
   class Loading {
      DAOFactory mySQL = null;
     ServiceTable_A serviceA = null;
     ServiceTable_B serviceB= null
     ServiceTable_C serviceC =null;
     public Loading(){
           mySQL = DAOFactory.getDAOFactory(DAOFactory.MYSQL);
          serviceA = mySQL.getServiceA();
          serviceB = mySQL.getServiceB();
          serviceC = mySQL.getServiceC();
      public int getNextPersonId(int inc){
              return serviceA.nextSeq(inc);
      public int getNextRelativeId(int inc){
              return serviceB.nextSeq(inc);
   class View{
        Person A;
        Relative B;
        Loading load = new Loading();
        public void constructObjects(){
                  A = new Person();
                  //Construct A from input fields
                  B.setParentKey(load.getNextPersonId(1));
                  //construct B from input fields              
                  C.setParentKey(load.getNextRelativeId(1);
            //construct C from input fields              
}As you said, i'll do some more testing to isolate what's going on. It seems very odd that the two outcomes alternate like that. Or I may just have the coolest DB on earth

Similar Messages

  • Commit sequence in forms

    I have one block with single record
    and 3 others blocks with multiple records.
    block1
    b2
    b3
    b4
    On SAVE button when_button_pressed trigger
    Code is
    declare
    v_commit number:=0;
    begin
    p_insert_test(
    :block1.p_emp_id
    ,v_commit
    --Note : No commit inside procedure p_insert_test
    if v_commit = 0 then
    go_block('b1');
    commit_form;
    go_block('b2');
    commit_form;
    go_block('b2');
    commit_form;
    end if;
    end;
    problem
    1.After execution of procedure p_insert_test if some error occurs in block b1,b2
    or b3 then record is showing as inserted through above procedure for same session when I am doing query in same block.
    Please tell me the best way of commit sequence in above scenario to maintain
    the consistency.

    I agree with you that there is no need to commit_form after each block
    but how to revert insert through procedure p_insert if any error
    occurred in multiple blocks.
    Because I record inserted are visible in particular session.

  • On commit - sequence increases

    Hello.
    I would like to know, if there is a way to stop form on error (before commit)?
    My form returns sometimes for some users errors(privileges error or policy check error) on commit (KEY-COMMIT). Nothing inserts into database BUT sequence increments.
    Is there a way to stop the sequence to increase?
    Thanks.

    ...and put a trigger on the audit table, etc.
    If there were a good reason NOT TO use a gapless sequence then suggesting alternative solutions would be helpful. In this case there may be no good reason TO use a gapless sequence but that doesn't mean he should try something else. It's possible and he needs to do it.
    Advance queueing is more efficient but I can't remember how to do it right now. It may be on the web somewhere. Using dbms_lock, in pseudocode:
    o create a table to store the sequences.
    o when a sequence is needed then loop through the table and use the sequence to create a lockhandle.
    o if you can't lock the record then move to the next one.
    o if there are no records available then generate more records into the table (autonomos commit) and loop again.
    o if you manage to lock a record then delete it (no commit).
    o return the sequence to the calling process.
    o when the record which uses the sequence is committed then that sequence will be removed from the sequence table.
    o if the record is rolled back then the sequence will remain in the sequence table.
    not suitable for intense usage and there can be problems if there's a chance of a commit between the call to the sequence routine and the insert of the record. you can get round this by using an 'unused sequences' table but that makes it less efficient - try advanced queueing.

  • Controlling Commit Sequence In Forms.

    My Environment is Oracle Forms10g R2.
    Is it Possible to Control the commiting of blocks?
    e.g.
    I have three blocks A,B and C. I want to Commit B then C and then A. Can I do that?
    Regards,
    Eric.

    What do you really mean when you say "commit"?
    If you want your form to post the deletes/updates/inserts from block B first, then those in C, then those in A, place the blocks in that order in your Forms Builder Object Navigator.
    Then when you commit, block B changes will be applied first, then C, then A. The final database commit will then lock in those changes.

  • Zooming in TextEdit - Where's the % display?

    I can't remember exactly when this feature went missing, but TextEdit no longer has the little window zoom percentage feature in the lower corner of any window.  It used to drop down to offer 100, 125, 150, 175, 200% and so on.  It's gone!  I used it all the time.  Now there is a counter intuitive shift-command-period/comma sequence that only zooms in way too much with one attempt to be of any use.  Why do longtime useful functions just keep disappearing for no apparent reason?  What are the programmers thinking?

    Pierre L. wrote:
    The article HT2317, entitled "[Viewing album artwork on iPod|http://support.apple.com/kb/HT2317?viewlocale=en_US]", has been last modified on October 11, 2009. Why would it mention that option if it had been removed from iTunes 9.
    Since when has the left hand known what the right hand is doing in any organiszation.
    Can you give a reference supporting your statement ?
    From Apple? No. Plenty of threads in here though, both builds of iTunes 9 released for Mac & PC have been missing this feature and people have given feedback. This is either a policy change and it will remain that way or it was accidentally omitted during the redesign in which case it may reappear in a future build. Either way the control isn't magically missing from just your copy, it's the same for all of us.
    tt2

  • Pre-insert block level, Seq.Nextval leaving gaps problem

    Hi...form friends,
    I used DB sequence in pre-insert block level trigger.
    SELECT seq1.nextval INTO :abc.log_id FROM dual;
    Everything works fine,except leaving gaps randomly .
    It leaves around 10 no.s gaps in-between. And that happens randomly...
    lets say I insert 5 records..then it will be 1,2,3,4,5.
    Then it may jumps to 15,16,25 like...that....
    I searched for this problem...but some say when form failure occurs, it leaves gap of CACHE no. specified....and some say its not possible to use DB seq. with forms perfectly ..!!!!
    Anybody have any idea about this issue ???
    Thanks....

    Putting that functionality in a row level trigger will cause a mutating data exception.
    Locking the table for update is not sufficient, you need to prevent other users inserting as well.
    I've posted a method a few times before which uses dbms_lock and a table of serial numbers which is used in place of the oracle sequence. This provides maximum concurrency and allows for data to be rolled back, but there is obviously a payoff in terms of performance so it should only be used when absolutely necessary. There is a similar example in the link I posted above (which is a far more considered explanation than I've posted elsewhere!), along with some caveats about using gapless sequences and whether there is truly a need.
    One of mine:
    Re: On commit - sequence increases

  • Upgrade on CRS Multichassis

    Hi ,
    I have a question regarding CRS multichassis upgrades that when we upgarde the multichassis do we need to have  code and all the SMU's and PIE in all the RP's or just in DSC RP's ( i.e ) Once DSC boots with the right code will it sync the new code and pacakges with other RP's as well ?
    Thanks
    Vishal

    Hi Vishal,
    An upgrade on a MC system is essentially the same. You need to use the 'install add', 'install activate', and 'install commit' sequence.
    During the add phase the packages are added to the disk of all RPs and SCs (shelf-controllers), during activation the code is changed on all RPs and SCs and other appropriate actions are taken for other nodes such as CPU0 and SP complexes.. Then of course we have the commit phase to ensure that the code is persistent.
    When a RP, for instance, boots up if it is not dSC it will contact the dSC and sync over package information. The same, kind of, goes for LCs. LCs will contact the dSC and get the information they need when they go to boot.
    If you meant a turboboot of a MC then this is also similar to a SC (single-chassis) turboboot with 2 RPs. Only 1 RP in any system can be turbobooted as it needs to be dSC.
    HTH,
    Sam

  • A different question for "Old Comm Guy" about that quote for G4 PCI "YIKES" machines, mine has only 5 led's, but do fit the lighting sequence listed.

    My G4 400 Mhz PCI "YIKES" machine has only 5 led's, none in DS4 or DS5, nothing there but the un-molested sodlier bumps (never has anything been there), and my lighting sequences are 7 & 8 are on together, the others are dependant upon keystrokes or other demands (mouse, etc.).
    There are seven diagnostic LEDs on the Power Mac G4 (PCI Graphics) logic board.
    DS1 = ATA drive activity
    DS4 and DS5 = USB power for downstream devices  (There is no DS2 or DS3 on the board.)
    DS6 = Ultra ATA bus activity
    DS7 & DS8 = Power Indication
    In a working unit, these LEDs should be in sync with each other: both on or both off. If one LED is on and the other is off, there is a problem.
    DS9 = CPU Bus
    Now I have a problem that started when I opened the side to check the led's in operation, side was open for 6 or 7 minutes and I got the screen of death, darkened, need restart, multi languages. ....  I had just cured the start-up problems I was having for a month, 10 days ago. It was the powered USB hub plugged into the machines back panel, instead of the K/B port, I did have the mouse to the K/B and hub to back of machine, swapped locations and it was fixed, even the dead printer came to life and began printing (hadn't worked for 10 months !!)
    What cuased the "screen of death" was traced to a memory dimm / ram stick that died, a PC133, 256MB made by 16X8 (or XB), I swear I wasn't dragging chains over the M/B, or anything really stupid, (I ain't the sharpest knife in the drawer, but not dumb either).
    The "death screen" has caued a big headache, very hard to get to Applejack, open firmware, ect., I have, but not with any consistancy, did them, did DU test & verify, all passed "GOOD" or "no problems", all this was done in "safe boot mode", but I can't get to "regular mode" after restart !! ...  it just sits on the gray apple screen w/o the spinning gear / wheel for hours !!!
    Any ideas would be nice to hear, I plan on doing a re-install or repair / restore from / with the install DVD tomorrow.
    And a link to info. of which ram / dimm memory sticks I might use from the other machines I have here, a G3 B&W, G4 QS 800 DP, etc. what will interchange ?, if any ?  ...........  Thanks for any input you may have, ..... wayne146 .....
    I need some sleep, this has given me a massive headache, all because I read that quote and knew my lights didn't quite match it. ..... If only I had not cared, I migth not have gotten in such a bind / blunder, stupid me, I could resist it, I had to look for a compairison.
    signing off for a few hours ....... wayne146 ..........

    Good Morning, old comm guy,
    Well I tried following your instructions to the letter, as best my limited knowledge would take me.
    I opened the "terminal window", then "terminal preferences", the proper radio button was already checked for the phrase you indicated, and the insert line / window had "/bin/bash/", grayed out in it, below that is the "declare  terminal type"  that was set to "xterm color", so I couldn't change the grayed out window, but I could make selections for "declare. term. type"  ... I left that as it was at "xterm color".
    In the bottom of the Term. Pref. window is a "Open a saved term. file ...." and a window to enter a selection, when I clicked on "select", it open a "finder window" ,<applications> with almost everything grayed out, not knowing what to do, I backed out of the finder window, and also I can't just type a command into the "open a saved term. file" window, it must be done with the select button. 
    So basically I'm saying this Unix stuff is all Greek to me, I would need more detailed instructions to follow to the letter, for me to get through this with any success.
    And this is weird, while I was working in Yahoo mail and here in discussions I was in "Safe Boot" for several hours, with several restarts in "Safe" (the only way I could do anything) I was swapping and checking a few different RAM sticks with the diagnostics in "about this mac" (one had died when watching the led's). the one that died, return to the living & working world, ??????? .....  and this G4 400mhz "YIKES" machine, STARTED FUNCTIONING PROPERLY AGAIN (?????????????) SHUTDOWN W/ K/B BUTTON, RESTART W/ K/B BUTTON, So weird !!!
    And anther bit of weirdness is that while the Apple Tech. info says this uses PC 100 sdram, every stick of memory in this machine has stickers on them from different makers saying that they are PC 133 sdram of 256 mb. ??? ..... Can this be true ?, has this thing altered itself or altered the RAM, to work with each other ???
    After it started working "properly" (?), both Firefox and Safari crashed many times and often, so I dumped Firefox (3.6.19) and reloaded a fresh FF 3.6.19, as I may have done something to them by accident in my panicing and buggering around, even had a Screen of Death 1 or 2 times, and it restarted with only a push of the front reset button, restarted as if it was just turned on with no problems lurking in it's past. .... Also weird !!! ????? 
    The New FireFox (3.6.19) hasn't crashed since the new install, that maybe OK now, time will tell,  ........ wonder if the wrong ram was causing browsers to crash ???? ... or is the ram wrong ??... why is it working ???
    All the Ram stick were bought from "Chris", the Apple Expert @ RE - PC, here in Seattle, he also sold me this YIKES machine, so there was no mistake as to what I wanted the RAM for.
    I have a spare G3 B/W 450Mhz machine that also has pc 133 sdram in it as well, same thing with it, bought from "Chris", and the Ram in it too. It only has OS 9.2.2 on it, I need to do the work around to put Tiger 10.4.11 on it. Later .......
    Well what do you think ??? ..... It's alot to process, take your time,
    Please review this babbling I have put forth, it could be written a little clearer, but I have read it over twice and it makes sense as I read it (of course, I know what I meant when I typed it)......
    .........Thanks for your time and help. ........wayne146 ....... (all nighter again, going for a nap, back in 4 - 5 hrs.) ...............wayne146 ........

  • Handling DB sequences for create and commit actions on ADF tables

    Hello,
    Most of the tables will have sequences used for primary keys and there will be columns like created_On and created_By columns. But my table does not require user inputs for these columns. So when commit button is clicked on the table how to handle these columns. The commit action should refer the sequence and enter SYSDATE and username for created_on and created_by columns.
    what is the workaround for this ?
    Thanks.

    Use groovy expressions as default values for the EO fields - adf.currentDate and adf.context.securityContext.getUserName()
    For the sequence see the ADF documentation:
    http://docs.oracle.com/cd/E16162_01/web.1112/e16182/bcentities.htm#sm0147

  • Sequence value incrementing by one after commit

    I am using the following code to insert a sequence number into a form field in a data block pre-insert trigger. When I commit the record the trigger fires again and increments the sequence again. So the record I get in the database has a primary key value of 1 more than what was on the form. Any help would be appreciated.
    Joe Merkel
    BEGIN
         SELECT DAD_ID_SEQUENCE.NEXTVAL INTO :DAD_ROSCO_INFO.DAD_ID
         FROM SYS.DUAL;
         EXCEPTION
         WHEN OTHERS THEN
         MESSAGE('Unable to assign DAD ID');
         RAISE FORM_TRIGGER_FAILURE;
         :DAD_RO_NOTES.DAD_ID := :DAD_ROSCO_INFO.DAD_ID;
         :DAD_FR_NOTES.DAD_ID := :DAD_ROSCO_INFO.DAD_ID;
         END;

    I was just talking to a colleague that suggested that. Thanks for your response. I will look into it.

  • Unable to save Sequence value to Database

    Hi,
    I am trying to pupulate a sequence value so that I can use it as primary key along with the combination of other columns later. My problem is that the sequence value is getting populated on the page with the right value, But is not getting saved to the database. The Column is there in the VO. The column is blank on the table. When I print it(System.out.println("Seq=" + xSeq.getText(pageContext));), the value is null. Can anyone please advice what I am doing wrong OR if I am missing anything here.
    Thanks
    Ali
    My CO file:
    ============
    package lac.oracle.apps.lac.jobperf.server.webui;
    import oracle.apps.fnd.common.VersionInfo;
    import oracle.apps.fnd.framework.webui.OAControllerImpl;
    import oracle.apps.fnd.framework.webui.OAPageContext;
    import oracle.apps.fnd.framework.webui.beans.OAWebBean;
    import oracle.apps.fnd.framework.OAApplicationModule;
    import oracle.apps.fnd.framework.webui.OADialogPage;
    import oracle.apps.fnd.framework.webui.TransactionUnitHelper;
    import oracle.jbo.domain.Number;
    import oracle.apps.fnd.common.MessageToken;
    import oracle.apps.fnd.framework.OAApplicationModule;
    import oracle.apps.fnd.framework.OAException;
    import oracle.apps.fnd.framework.OAViewObject;
    import oracle.apps.fnd.framework.webui.OAWebBeanConstants;
    import oracle.apps.fnd.framework.webui.beans.layout.OAMessageComponentLayoutBean;
    import oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean;
    import oracle.apps.fnd.framework.webui.beans.message.OAMessageStyledTextBean;
    import com.sun.java.util.collections.HashMap;
    import oracle.bali.share.util.IntegerUtils;
    import oracle.apps.fnd.framework.server.OADBTransaction;
    * Controller for ...
    public class ReviewCreateCO extends OAControllerImpl
    public static final String RCS_ID="$Header$";
    public static final boolean RCS_ID_RECORDED =
    VersionInfo.recordClassVersion(RCS_ID, "%packagename%");
    * Layout and page setup logic for a region.
    * @param pageContext the current OA page context
    * @param webBean the web bean corresponding to the region
    OAApplicationModule am; // dave
    OADBTransaction oadbxn; // dave
    oracle.jbo.domain.Number Seq;
    public void processRequest(OAPageContext pageContext, OAWebBean webBean)
    // Always call this first
    super.processRequest(pageContext, webBean);
    am = pageContext.getApplicationModule(webBean); // dave
    oadbxn = am.getOADBTransaction(); // dave
    OAPageLayoutBean pageLayout = pageContext.getPageLayoutBean();
    OAMessageComponentLayoutBean mainRn = (OAMessageComponentLayoutBean)pageLayout.findIndexedChildRecursive("MainRN");
    // If isBackNavigationFired = false, we are here after a valid navigation
    // (the user selected the Create Review button) and we should proceed
    // normally and initialize a new Review.
    if (!pageContext.isBackNavigationFired(false))
    // We indicate that we are starting the create transaction(this
    // is used to ensure correct Back button behavior).
    TransactionUnitHelper.startTransactionUnit(pageContext,"jobperfCreateTxn");
    // This test ensures that we don't try to create a new review if we
    // had a JVM failover, or if a recycled application module is activated
    // after passivation. If this things happen, BC4J will be able to find
    // the row you created so the user can resume work.
    if (!pageContext.isFormSubmission())
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    // String Seq = (String)oadbxn.getValue("Seq");
    oracle.jbo.domain.Number Seq = oadbxn.getSequenceValue("lac.LAC_CM_PERF_REVIEW_SEQ");
    OAMessageStyledTextBean xSeq = (OAMessageStyledTextBean)mainRn.findIndexedChildRecursive("Seq");
    xSeq.setText(Seq.toString());
    am.invokeMethod("createReview",null);
    // Initialize the ApplicationpropertiesVO for PPR.
    // am.invokeMethod("init");
    else
    if (!TransactionUnitHelper.isTransactionUnitInProgress(pageContext,"jobperfCreateTxn", true))
    // We got here through some use of the browser "Back" button, so we
    // want to display a stale data error and disallow access to the page.
    // if this were a real application, we would propably display a more
    // context-specific message telling the user she can't use the browser
    //"Back" button and the "Create" page. Instead, we wanted to illustrate
    // how to display the Applications standard NAVIGATION ERROR message.
    OADialogPage dialogPage = new OADialogPage(NAVIGATION_ERROR);
    pageContext.redirectToDialogPage(dialogPage);
    } // end processRequest()
    * Procedure to handle form submissions for form elements in
    * a region.
    * @param pageContext the current OA page context
    * @param webBean the web bean corresponding to the region
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
    {    //super.processFormRequest(pageContext, webBean);
    // Always call this first.
    super.processFormRequest(pageContext, webBean);
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    OAPageLayoutBean pageLayout = pageContext.getPageLayoutBean();
    OAMessageComponentLayoutBean mainRn = (OAMessageComponentLayoutBean)pageLayout.findIndexedChildRecursive("MainRN");
    // Pressing the "Apply" button means the transaction should be validated
    // and committed.
    // OAPageLayoutBean pageLayout = pageContext.getPageLayoutBean();
    // String Seq = SeqText.getText(pageContext);
    oadbxn.putValue("Seq", Seq);
    am = pageContext.getApplicationModule(webBean);
    oadbxn = am.getOADBTransaction();
    if (pageContext.getParameter("Apply") != null)
    // Generally in the tutorial application and the labs, we've illustrated
    // all BC4J interaction on the server (except for the AMs, of course). Here,
    // we're dealing with the VO directly so the comments about the reasons
    // why we're obtaining values from the VO and not the request make sense
    // in context.
    OAViewObject vo = (OAViewObject)am.findViewObject("jobperfVO1");
    // Note that we have to get this value from the VO because the EO will
    // assemble it during its validation cycle.
    // For performance reasons, we should generally be calling getEmployeeName()
    // on the EmployeeFullVORowImpl object, but we don't want to do this
    // on the client so we're illustrating the interface-appropriate call. If
    // we implemented this code in the AM where it belongs, we would use the
    // other approach.
    String employeeName = (String)vo.getCurrentRow().getAttribute("FullName");
    // We need to get a String so we can pass it to the MessageToken array below. Note
    // that we are getting this value from the VO (we could also get it from.
    // the Bean as shown in the Drilldwon to Details lab) because the item style is messageStyledText,
    // so the value isn't put on the request like a messaqeTextInput value is.
    String employeeNumber = (String)vo.getCurrentRow().getAttribute("EmployeeNumber");
    //ma String employeeNum = String.valueOf(employeeNumber.intValue());
    //ma Number employeeNumber = (Number)vo.getCurrentRow().getAttribute("EmployeeNumber");
    //ma String employeeNum = String.valueOf(employeeNumber.intValue());
    // Simply telling the transaction to commit will cause all the Entity Object validation
    // to fire.
    // Note: there's no reason for a developer to perform a rollback. This is handled by
    // the framework if errors are encountered.
    OAMessageStyledTextBean xSeq = (OAMessageStyledTextBean)mainRn.findIndexedChildRecursive("Seq");
    System.out.println("Seq=" + xSeq.getText(pageContext));
    am.invokeMethod("apply");
    // Indicate that the Create transaction is complete.
    TransactionUnitHelper.endTransactionUnit(pageContext, "jobperfCreateTxn");
    // Assuming the "commit" succeeds, navigate back to the "Search" page with
    // the user's search criteria intact and display a "Confirmation" message
    // at the top of the page.
    MessageToken[] tokens = { new MessageToken("EMP_NAME", employeeName),
    new MessageToken("EMP_NUMBER", employeeNumber) };
    OAException confirmMessage = new OAException("PER", "LAC_FWK_TBX_T_EMP_CREATE_CONF", tokens,
    OAException.CONFIRMATION, null);
    // Per the UI guidelines, we want to add the confirmation message at the
    // top of the search/results page and we want the old search criteria and
    // results to display.
    pageContext.putDialogMessage(confirmMessage);
    HashMap params = new HashMap(1);
    // Replace the current employeeNumber request parameter value with "X"
    params.put("employeeNumber", "employeeNumber");
    // IntegerUtils is a handy utility
    params.put("employeeNumber",IntegerUtils.getInteger(5));
    pageContext.forwardImmediately(
    "OA.jsp?page=/lac/oracle/apps/lac/jobperf/webui/jobperfPG",
    null,
    OAWebBeanConstants.KEEP_MENU_CONTEXT,
    null,
    params, //null,
    false, // retain AM
    OAWebBeanConstants.ADD_BREAD_CRUMB_YES);
    else if (pageContext.getParameter("Cancel") != null)
    am.invokeMethod("rollbackReview");
    // Indicate that the Create transaction is complete.
    TransactionUnitHelper.endTransactionUnit(pageContext, "jobperfCreateTxn");
    pageContext.forwardImmediately("OA.jsp?page=/lac/oracle/apps/lac/jobperf/webui/jobperfPG",
    null,
    OAWebBeanConstants.KEEP_MENU_CONTEXT,
    null,
    null,
    false, // retain AM
    OAWebBeanConstants.ADD_BREAD_CRUMB_NO);
    } // end processFormRequest()
    }

    Hi Tapash,
    Thanks for all of you guys(Tapash/Sumit/user550094) help. The sequence is working and also populating the values in the table when I do not have any validation checks imposed on it.
    If I add any validations as mentioned in the exercise for create page where it checks if the sequence can be updated while null and so on... and throws appropriate exception. I get error. That is the code that I mentioned above.
    Here is the validation code for EOImpl:
    As mentioned below in order for the code to compile and work I had to comment the "throw new OAAttrvalException". If I uncomment the
    "throw new OAAttrvalException" part, it gives me the following error while compiling:
    "Error(796,13): method getPrimarykey not found in class lac.oracle.apps.lac.jobperf.schema.server.jobperfEOImpl"
    public void setSeq(Number value)
    // Because of the declaritive validation that you specified for this attribute,
    // BC4J validates that this can be updated only on a new line, and that this,
    // mandatory attribute cannot be null. This code adds the additional check
    // of only allowing an update if the value is null to prevent changes while
    // the object is in memory.
    if (getSeq() != null)
    /* throw new OAAttrValException(OAException.TYP_ENTITY_OBJECT,
    getEntityDef().getFullName(), //getSeq(), // EO name
    getPrimarykey(), // EO PK
    "Seq", // Attribute Name
    value, // Attribute value
    "AK", // Message product short name
    "FWK_TBX_T_EMP_ID_NO_UPDATE"); // Message name */
    if (value != null)
    // Seq ID must be unique. To verify this, check both the
    // entity cache and the database. In this case, it's appropriate
    // to use findByPrimaryKey() because you're unlikely to get a match, and
    // and are therefore unlikely to pull a bunch of large objects into memory.
    // Note that findByPrimaryKey() is guaranteed to check all employees.
    // First it checks the entity cache, then it checks the database.
    OADBTransaction transaction = getOADBTransaction();
    Object[] employeeKey = {value};
    EntityDefImpl empDefinition = jobperfEOImpl.getDefinitionObject();
    jobperfEOImpl Seq =
    (jobperfEOImpl) empDefinition.findByPrimaryKey(transaction, new Key(employeeKey));
    if (Seq != null)
    /* throw new OAAttrValException(OAException.TYP_ENTITY_OBJECT,
    getEntityDef().getFullName(), // .getSeq(), // EO name
    getPrimaryKey(), // EO PK
    "Seq", // Attribute Name
    value, // Attribute value
    "AK", // Message product short name
    "FWK_TBX_T_EMP_ID_UNIQUE"); // Message name */
    // Note that this is the point at which the value is actually set on the EO cache
    // (during the scope of setAttributeInternal processing). If you don't make this
    // call after you perform your validation, your value will not be set correctly.
    // Also, any declarative validation that you define for this attribute is executed
    // within this method.
    setAttributeInternal(SEQ, value);
    } // end SetSeq
    I am sorry if I have confused you. I really did not mean to do it.
    Thanks,
    Ali

  • Follow up on copying unested sequences

    I've been coping sequences as some of you described by using "Select All" and copying and pasting them into new timelines to keep from getting nested sequences, but it seems when I Command-drag marked sections of these copied sequences into a new sequence I'm lossing my linking from video to audio as well a losing my stereo pairings. Is there a way to make these edits and still maintain linking and pairing?
    I have also found that if I want to use the "replace edit" or the "overwrite edit" in the same manner (cutting a portion of an unested copy of a sequence into a new sequence) the Command combination does not work with these edits and I get a nested clip when it is edited into the new sequence. Is my FCP malfunctioning, or does the Command combination only work with a drag or the "Insert Edit" button?
    Thanks again for the help!!!!!

    Shane,
    Thanks for your reply. It seems I may have misundertood some of your original instructions. I have been copying ("select all"; copying and pasting into a new timeline) my sequences as you suggested to prevent the unexpected nesting I was getting.
    I have been also utilizing the Command-drag method, but apparently I've been doing it incorrectly. I have been Comm.-draging marked sections of my copied sequence directly into the timeline. I gather by your reply I should be Comm.-dragging into the canvas (which I have done from time to time) My question is that I have found that I can successfully Comm.-drag into the insert window of the canvas and get the expected clip in the timeline, but when I use the overwrite window in the canvas in the same manner I get a clip of a slightly different color in my timeline. I also find that I'm losing my audio to video linking and my stereo pair linking when I Comm.-drag. Can you explain where I'm going wrong? Why do I lose the linking, and why does it appear that a different version of the same clip comes into the timeline if I Comm.-drag into the insert window in the canvas as opposed to Comm. draging into the overwrite window of the canvas? Also, I do quite a bit of Replace editing and it does not seem to me that Comm.-drag Replace works either. Can you halp me with that too?
    Thanks again for your patience. I really appreciate it!

  • BAPI_PROJETC_MAINTAIN - External Commit

    Hi All,
      I have created a custom function module using the SAP Standard Function module BAPI_PROJECT_MAINTAIN. This Custom Function module will be called from VB Interface. The while creating the Custom FM, I have commented the COMMIT WORK Statement which was the part of BAPI_PROJECT_MAINTAIN. I have done this because of the requirement of Commit to be called from the VB Interface.
      I am calling the BAPI_TRANSACTION_COMMIT from my VB Code after I made a Call to my Custom FM and the Return Code of this Custom FM is a success.
      The Return Code of this BAPI_TRANSACTION_COMMIT is also success, but the commit is not happenning, because when I go and check the PROJ Table, it has not created the Project.
      Can soneone tell me why an external commit from another application  is not working for this custom FM(Which is based on BAPI_PROJECT_MAINTAIN).
      Thanks in Advance.

    Hi Sunil,
    The first thing to do would be to create a test sequence in SE37, of first your custom function and then the BAPI_TRANSACTION_COMMIT.  This executes the two functions one after the other in a single sequence. If this works, then you have a problem with your VB application. 
    In the VB application you should be calling your function and the commit within the one thread.  So you should open a connection, call the function, and then call the commit bapi, before closing your connection.  If you close the connection first, or call the commit in another thread, then the update wont occur.
    You may find the following thread useful: Sales Order Create BAPI
    Cheers,
    Brad

  • Commit not allowed in Trigger  then how to store the values in table

    Hi,
    Database trigger not allowed to COMMIT in it (directly) or in procedure which is calling from the Trigger. it gives error.
    so my question is:-
    1)How Database internally store the INSERT AND UPDATE value in table which is written in procedure without COMMIT?
    2) Is it necessary to write COMMIT in procedure using PRAGAMA AUTONOMOUS TRANSACTION to store inserted or updated value in table?
    Thanks in advance.

    Hi,
    A trigger is designed to be a part of a transaction, not it's end.
    It is like following these steps (not really accurate, but should give an idea):
    1. programA issues INSERT statement on tableA
    2. 'control' goes over to the database
    3. constraint checks happen
    4. the associated triggers on tableA do their work (e.g. fetching a sequence value for a primary key)
    5. 'control' goes back to programA
    6. programA decides if a commit (no error occurred) or a rollback (error case) has to be issued.
    Did this help? Probably not, I'm not happy with what I wrote, but anyway... :)

  • How to find which sequence name is used in a table - Redux

    (The other thread was locked before I could respond, so I'm posting this here as a non-question.)
    Beginning with 12c, there is now a way to associate a sequence with a table.  It's a new feature called an Identity column.
    create table t
    (some_id number generated as identity --< creates a system generated sequence
    ,name varchar2(30)
    insert into t (name) values ('Smith');
    insert into t (name) values ('Jones');
    insert into t (name) values ('Anderson');
    commit;
    select * from t;
            SOME_ID NAME
                  1 Smith
                  2 Jones
                  3 Anderson
    select table_name, column_name, data_default from user_tab_columns where table_name = 'T' and column_name = 'SOME_ID';
    TABLE_NAME COLUMN_NAME DATA_DEFAULT
    T          SOME_ID     "C##SELSE"."ISEQ$$_91955".nextval
    select * from user_sequences;
    SEQUENCE_NAME
    ISEQ$$_91955

    There's nothing stopping you from using the generated sequence for something else, however you can NOT override it when doing an insert (as long as you've specified ALWAYS which is the default).
    SQL> create table t
      2  (some_id number generated as identity
      3  ,name varchar2(30)
      4  );
    Table created.
    SQL> select * from user_sequences;
    SEQUENCE_NAME
    ISEQ$$_91970
    SQL> select ISEQ$$_91970.nextval from dual;
                 NEXTVAL
                       1
    SQL> select ISEQ$$_91970.nextval from dual;
                 NEXTVAL
                       2
    SQL> insert into t values (99,'smith');
    insert into t values (99,'smith')
    ERROR at line 1:
    ORA-32795: cannot insert into a generated always identity column

Maybe you are looking for

  • Lenovo W530 no longer boots since updating past 3.7.1

    Hi, I've been suffering from this for a while and I finally thought I should get around to asking the collective wisdom of the forums.  I use rEFInd to boot my laptop and everything has been working well until I updated to 3.7.3.  The next time I reb

  • Whithholding tax and installments

    Hi, I need to create an export foll all the due amount of the vendor. I have a problem with supplier invoice with withholding tax (set at the payment) and the installments. I need to export the amout without witholding tax amount (amount that I will

  • DESADV IDoc using EAN's

    Hi all, A bit of guidance if you could. I am trying to simulate an inbound delivery creation process using DELVRY06/DESADV for a PO. The issue I have is that the EDI provider will not be sending the material number in either the E1EDL24 (delivery lin

  • Smallest File Size not so small

    Hi in CS2 here.. Exporting a .pdf. The InDesign file has 3 colored rectangles, some text, a few lines at 1pt. & two copied vector logos from Illustrator (no images or tiffs). In Pagemaker the smallest file size was always like 30K or something.... In

  • How to insert data using xsql

    I want to insert a XML Document using xsql? tell me anyone step step procedure using xsql;this is very urgent