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.

Similar Messages

  • Need to populate sequence value in a field after insert in oaf page

    Hi All,
    I have a custom OAF insert page in that i need to populate a sequence value to a field once the data inserted successfully to the table.
    so for that i followed the below approach.
    1>Created a sequence in database.
    2>In the EOImpl java file in the setter method for the respective field have written below code.
        public void setContainid(Number value) {
            if (value == null) {
                    OADBTransaction t = getOADBTransaction();
                    value = t.getSequenceValue("XXXXX_CONTAIN_SEQ");
            setAttributeInternal(CONTAINID,value);  
    But still i am not able to populate the sequence value for the field in my oaf page,please help me out on thsi.
    Thanks

    Hi,
    Write this logic in create method of EOImpl:
      public void create(AttributeList attributeList)
        super.create(attributeList);
        OADBTransaction transaction = getOADBTransaction();
        Number contID = transaction.getSequenceValue("XXXXX_CONTAIN_SEQ");
        setContainId(contID);
    --Sushant

  • Re-populating values in data block after commit

    I have a form with 2 tabs. The user can create an event in first tab and then associate/disassociate the event to data_points in the second tab (associate_event data block).
    Say, I create an event, and query the records affected by the event in second tab, 5 records are retrieved. I press the associate_to_event push button and hit Save. All the 5 records get associated to the event, but as the associate_event data block is based off a view with instead-of triggers, I do not get any message saying 'these many rows were affected'.
    I am OK with not getting the message, but atleast I should re-populate the values in that block so that the user can see that the changes were made.
    So I created a key-commit trigger on the associate_event data block. The code in that trigger is as follows:
    do_key(commit_form);
    repopulate_values;
    But my form is just sitting there (taking long to fiinish and hence timing out). Is there any other way of doing this?
    (Also on another note, if I repopulate the associate_event datablock, the status of that block will be changed (as I am proceduraly assigning values to the block ) and then when user wants to exit the form, it will agaiin ask for 'Do you want to save the changed you made?' How do I avoid it?? Do I create a global variable and assign it some value say 1 when called from the key-commit trigger and check somewhere ?? if the value is '1' then dont pop-up that message )
    Thanks in advance.

    Thank you Magoo.
    I am now able to re-populate the values. (The way my form was sitting there, made me that it was going in an infinite loop, but I could not point out what was causing that. Thanks!)
    But my data-block associate_event retreives multiple records, therefore
    "set_record_property ( :system.cursor_record, 'associate_event', status, query_status ); --> no ask for commit after repopulate_values ... "
    does not work. And if I select Yes from the pop-up, I am getting the following error 'ORA-00933: SQL command not properly ended'. I checked the error and some how the update statement is incomplete. (This error does not/did not occur earlier when I just retrieve data. Remember, its coming from a view and the datablock is getting populated proceduraly, therefore everytime I wish to go out of the form, even after a retrieve , I get the message. (Which is fine with the customer.) So I dont get the 'ORA-00933: SQL command not properly ended' , when I press yes !! (But it tries to a insert and not an update at that time and I have a instead of update/insert trigger on the view).)
    How do I get rid of the pop up, after the commit. I could not find any similar set_block_property :(.
    Or should I suppress the pop-up in key_commit, or do another commit-form after repopulating data??

  • Does Update function module gets executed after Commit Work?

    Hi Gurus,
    I have a BAPI with a Commit work. Does update function module V1 , V2 - i need mainly about the sequence of V2, gets executed after Commit work or before Commit work.
    Thanks

    Pl refer to SAP help on the same as follows.
    https://help.sap.com/saphelp_nw04/helpdata/en/e5/de86e135cd11d3acb00000e83539c3/content.htm
    Regards,
    Naveen Vishal

  • Processing JMS messages in sequence one after another

    This is my use case which I wan to implement in OSB.
    1. I have a queue which will receive messages in huge numbers from a single sender.
    2. I have a proxy which will read each message and process the message and send it out.
    In step 1 , I want each message to be read sequentially and when step 2 finishes executing then I want to read the next message from the queue.
    I need to give an acknowledgment to JMS that the message has finished processing and it can make the next message available to the proxy.
    What is the best option to implement this use case ?.
    Regards

    By default Weblogic JMS Queues are FIFO. But that is true only if there is only one consumer of the queue.
    In case of a clustered environment that is not true and in case of OSB even with a single managed server multiple threads are created for a JMS listener Proxy(by default 16). So there will be 16 instances of the Proxy trying to read messages from the Queue and each will be handed out a message and sequential integrity is disturbed.
    There are three ways to overcome this problem:
    1. Unit of Order
    This is suitable only when you want messages of the same group to be processed sequentially while multiple groups can be processed in parallel.
    For e.x. you are getting multiple orders for multiple customers and you want to ensure that the orders of same customer are processed sequentially (in case a customer tries to change the quantity of an order then the latest one should be processed last). In this case you can set UOO as the CustomerID and each customer's order will be processed sequentially but orders of different customers will be still processed in parallel. WLS JMS achieves this by assigning a target queue instance on the cluster for each UOO value. It will assign Q!MS1 to CustID=1, Q!MS2 to CustID=2 and so on. All messages of the same UOO(of the same customer) will go to the same instance on the queue. Furthermore it will ensure that no two messages of the same UOO are released together to the listeners. So if a queue instance has 5 messages each of both Cust=1 and Cust=2, only one message each of Cust1 and Cust2 will be processed by the listeners even if there are 16 listening threads.
    Pros and Cons:
    Overall performance is improved since you can still achieve some parallel processing.
    There will be a slight overhead of processing the UOO headers on the JMS servers.
    Can not ensure sequencing of all the messages. (Although you can achieve that by setting the same UOO on all the messages)
    If the managed server assigned to a UOO is down, if a publisher tried to put the next message for that UOO, it will fail since it will not try to send that message to any other managed server.
    2. Single threaded processing
    If you don't want to process even different groups of messages in parallel and if you want absolute sequencing (i.e. irrespective of the CustomerID you want all the messages to be processed in the sequence they arrive) you will need to process them in a single threaded model. The JMS queue should be deployed on only one managed server of the cluster. The JMS proxy listening to the queue should also be deployed on a single managed server(You will need to change the targeting for the EJB created for this Proxy in the Deployments) and there should be a Work Manager for this Proxy with Maximum Thread Constraint set as 1. In the Connection Factory which the Proxy uses, set the Maximum Messages per session to 1. Another approach for Single threaded could be to set the same value of UOO on all of the messages. This will make all the messages to go to the same Q instance in the cluster and also will make sure that even if Proxy has multiple threads, only one message will be processed at a time.
    Pros and Cons:
    Completely single threaded processing, will take more time since messages will be processed one after the other.
    Load balancing will go awry as all the messages will be processed by only one server.
    3. Using custom implementation
    The most complex way is to create a completely custom implementation. Put all the messages in a DB and then process them one at a time based on timestamp.
    Pros and Cons:
    It will take more effort to implement than the other two approaches.
    It will again need single threaded processing after the messages are put on the DB
    Performance wise there will be more impact because of additional DB calls
    More complex to maintain
    Based on your exact requirements you can choose which approach you want. If you have SOA suite as well them it would be better to move this solution to SOA suite as OESB(Mediator) component of SOA suite has re-sequencing feature.

  • FCP7 - Queue sequences to render one after another

    FCP7
    I'm restoring some old analogue tapes.
    Each SEQUENCE is about 20 to 30 minutes long.
    I preform cropping, colour correction and apply the Neat Video Noise Reduction filter to each sequence.
    Rendering of each clip takes about 2 to 3 hours approx.
    I set up 3 to 4 SEQUENCES which I'd like to render overnight.
    I have been reading the FCP manual and searching the net and the Apple forums.
    As far as I can tell there is no such thing as a "Render Queue" for Sequences in FCP.
    ie; you add several unrendered sequences to a queue and click "render" and each renders in turn.
    Could someone confirm this for me please?
    So;
    - Is there another way in FCP7 to render sequences one after the other?
    I'll try putting 3 sequences together in another sequence and see how that goes.
    Just not sure if I can seperate them afterwards while retaining the render.
    Thank you.
    Robert.

    Ok, let me see if I understand this correctly.
    - I have a number of sequences which are unrendered.
    - I add them all to batch export.
    - As the unrendered files are exported, they are rendered.
    - The rendered sections are not retained in the sequence in FCP.
    - The rendered sections exist only in the exported files.
    Is that right?

  • I want to create stored procedure which will give output rows from "values that are passed as one parameter (comma seperated) to store procedure".

    Hello,
    I want to create stored procedure which will give output rows from "values that are passed as one parameter (comma seperated) to store procedure".
    Suppose , 
    Parameter value : person 1,person2,person3 
    table structure : 
    Project Name | officers 1 | officers 2
    here, officers 1 or officers 2 may contain names of multiple people.
    expected OUTPUT : distinct list(rows) of projects where person 1 or person 2 or person 3 is either officer1 or officer 2. 
    please explain or provide solution in detail 
    - Thanks

    Hi Visakh,
    Thanks for reply.
    But the solution you provided giving me right output only if officer 1 or officer 2 contains single value , not with comma seperated value.
    Your solution is working fine for following scenario : 
    Project 
    Officers 1
    Officers 2
    p1
    of11
    off21
    p2
    of12
    off22
    with parameter : of11,off22 : it will give expected output
    And its not working in case of :
    Project 
    Officers 1
    Officers 2
    p1
    of11,of12
    off21,off23
    p2
    of12,of13
    off22,off24
    with parameter : of11,off22 : it will not give any row in output
    I need patten matching not exact match :) 
    ok
    if thats the case use this modified logic
    CREATE PROC GetProjectDetails
    @PersonList varchar(5000)
    AS
    SELECT p.*
    FROM ProjectTable p
    INNER JOIN dbo.ParseValues(@PersonList,',')f
    ON ',' + p.[officers 1] + ',' LIKE '%,' + f.val + ',%'
    OR ',' + p.[officers 2] + ',' LIKE '%,' + f.val + ',%'
    GO
    Keep in mind that what you've done is a wrong design approach
    You should not be storing multiples values like this as comma separated list in a single column. Learn about normalization . This is in violation of 1st Normal Form
    Please Mark This As Answer if it solved your issue
    Please Mark This As Helpful if it helps to solve your issue
    Visakh
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • JMF Play files in a sequence one after another

    Hi
    i developed a JMF based player for playing more than one files in a sequence one after another.
    problem is that it playes all files at same time.
    it should run 2nd file when one file is completed.

    I think time period or state of media will be helpful

  • How to Glow LEDs in Sequence (One After the Other)

    Hello Labview,
    I am coming back here after a long long time and re-touching the Labview after so long.
    So, have some really basic question.
    I have 15 LEDs, which I want to glow one after the other (First glows and dies, then second glows and dies, then third glows and dies and so on...).
    I should be able to do it with a single button.
    I know this would be a silly question but I am not able to make out since I am returning after a long time.
    Can I please request you to help me creating such a program?
    Looking forward for your positive reply.
    Regards,
    Nishant

    Nishant wrote:
    Hello Labview,
    I am coming back here after a long long time and re-touching the Labview after so long.
    So, have some really basic question.
    I have 15 LEDs, which I want to glow one after the other (First glows and dies, then second glows and dies, then third glows and dies and so on...).
    I should be able to do it with a single button.
    I know this would be a silly question but I am not able to make out since I am returning after a long time.
    Can I please request you to help me creating such a program?
    Looking forward for your positive reply.
    Regards,
    Nishant
    The fundamentals of LabVIEW hasn't changed that much in 5 years.
    It sounds like you need to re-learn what little you knew by taking the online tutorials.

  • Getting error while reset sequence value

    i hve created two table. and a sequence for other table. i want to do that when i insert into a first table, entries of other table should be deleted and sequence value should reset to 1. For that i have executed the following sql code
    but getting the error:
    create or replace Trigger m_sale_ainsert_trig
    after insert on m_sale_bill
    for each row
    begin
    DELETE FROM M_TEMP;
    <<COLUMN_SEQUENCES>>
    BEGIN
    Alter Sequence M_TEMP_SEQ Restart with 1;
    END COLUMN_SEQUENCES;
    end;
    Alter Trigger m_sale_ainsert_trig enable;
    Warning: execution completed with warning
    Trigger m_sale_ainsert_trig Compiled.
    Alter Trigger m_sale_ainsert_trig succeeded.
    5/4 PLS-00103: Encountered the symbol "ALTER" when expecting one of the following:
    ( begin case declare exit for goto if loop mod null pragma
    raise return select update while with <an identifier>
    <a double-quoted delimited-identifier> <a bind variable> <<
    continue close current delete fetch lock insert open rollback
    savepoint set sql execute commit forall merge pipe purge
    pls rectify it!!!!! what are the mistakes in this code?
    Edited by: JKMourya on Mar 21, 2013 10:55 AM

    JKMourya wrote:
    i hve created two table. and a sequence for other table. i want to do that when i insert into a first table, entries of other table should be deleted and sequence value should reset to 1. For that i have executed the following sql code
    but getting the error:
    create or replace Trigger m_sale_ainsert_trig
    after insert on m_sale_bill
    for each row
    begin
    DELETE FROM M_TEMP;
    <<COLUMN_SEQUENCES>>
    BEGIN
    Alter Sequence M_TEMP_SEQ Restart with 1;
    END COLUMN_SEQUENCES;
    end;
    Alter Trigger m_sale_ainsert_trig enable;
    Warning: execution completed with warning
    Trigger m_sale_ainsert_trig Compiled.
    Alter Trigger m_sale_ainsert_trig succeeded.
    5/4 PLS-00103: Encountered the symbol "ALTER" when expecting one of the following:
    ( begin case declare exit for goto if loop mod null pragma
    raise return select update while with <an identifier>
    <a double-quoted delimited-identifier> <a bind variable> <<
    continue close current delete fetch lock insert open rollback
    savepoint set sql execute commit forall merge pipe purge
    pls rectify it!!!!! what are the mistakes in this code?
    Edited by: JKMourya on Mar 21, 2013 10:55 AMDDL inside PL/SQL is NOT allowed
    you must (ab)use EXECUTE IMMEDIATE

  • 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

  • Golden Gate Sequence Value replication?

    Hi all,
    I have searched the web, and read the Golden Gate documentation but I've found mixed answers.
    I'm just trying to ascertain for certain whether it's possible to automatically replicate sequence values in a bi-directional configuration. Both databases will be identical and both will be 11gR2 with the latest version of GG.
    If it is not possible to automatically increment sequences in a bi-directional configuration, what are the best practices for maintaing them?
    One option is the alternate sequences on each database, one with even values (for example) and one with odd values, but this requires deployment of new sequences on both databases, something we were hoping would be taken care of by the replication. (yes the sequence creation can be taken care of but the value is not incremented on the target database).
    another way that we thought of off the top of our heads is to have an on insert trigger (we only use sequences to generate surrogate keys) which will select nextval from the target database via a db link, but this seems somewhat cumbersome.
    What is best practice?

    Use sequence parameter... here is from Golden gate document:
    SEQUENCE
    Valid for Extract
    Use the SEQUENCE parameter to extract sequence values from the transaction log forpropagation to a GoldenGate trail and delivery to another database. Currently, GoldenGate supports sequences for the Oracle database.
    NOTE DDL support for sequences (CREATE, ALTER, DROP, RENAME) is compatible with, but not required for, replicating sequence values. To replicate just sequence values, you do not need to install the GoldenGate DDL support environment. You can just use the SEQUENCE parameter.
    GoldenGate ensures that the values of a target sequence are:
    ● higher than the source values if the increment interval is positive
    ● lower than the source values if the increment interval is negative
    Depending on the increment direction, Replicat applies one of the following formulas as a test when it performs an insert:
    source_highwater_value + (source_cache_size * source_increment_size * source_RAC_nodes) <= target_highwater_value
    Or...
    source_highwater_value + (source_cache_size * source_increment_size * source_RAC_nodes) >= target_highwater_value
    If the formula evaluates to FALSE, the target sequence is updated to be higher than the source value (if sequences are incremented) or lower than the source value (if sequences are decremented). The target must always be ahead of, or equal to, the expression in the parentheses in the formula. For example, if the source highwater value is 40, and CACHE is 20, and the source INCREMENTBY value is 1, and there are two source RAC nodes, the target highwater value should be at least 80:
    40 + (20*1*2) <80
    If the target highwater value is less than 80, GoldenGate updates the sequence to increase the highwater value, so that the target remains ahead of the source. To get the current highwater value, perform this query:
    SELECT last_number FROM all_sequences WHERE sequence_owner=upper('SEQUENCEOWNER') AND sequence_name=upper('SEQUENCENAME');

  • Oracle Sequence not incrementing Properly

    I created a sequence in Oracle with increment by one.
    But after 700 it is jumping to 736,766...................
    I dont know why this is jumping like this.
    plz tell me why it is happening like this.

    Have you ever asked questions on Oracle forums? My
    threads seem to follow a consistent route:
    Well I don't want to question the veracity of your experiences surely there is a better forum for Oracle questions than this one? I mean even the JDBC forum would have been a better fit.
    >
    As to the original post; sounds like an overflow,
    doesn't it? Really going to -1 but interpretted as
    unsigned. How are you using the sequence, and how is
    it defined?That's a strange number to be doing that at 700 if you ask me though I suppose it's possible.
    My wild guess was going to be that the sequences in question were previously used and so were skipped. I don't really feel either way that the OP provided enough information about the problem they are experiencing or even indeed why it is a problem at all.

  • Sequence values

    I have a sequence whose max value with the help of a trigger is inserted in a table column. I've noticed that sometimes the consecutive values of the sequence differ not by one but by variable number.
    I have Increment by 1 and Cache 20 in the sequence.
    It's not making me major problems, but I's wondering whats the deal?
    thanks

    Hello,
    Take a look at the following AskTom thread which explains what you're seeing -
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:530735152441
    In short, nothing to worry about, the way they're working is to maximise scalability.
    BTW, if your application has frequent simultaneous updates to that table, then you will benefit from creating the sequence with a larger cache (rather than just 20).
    Hope this helps,
    John.
    http://jes.blogs.shellprompt.net
    http://apex-evangelists.com

  • Suspicious delay of HDD activity after commit

    I know that after commit Oracle LGWR process writes the data
    changies into the redo-log. And Oracle must return "Commited"
    only after above is done. But when I do Commit, I don't see the
    HDD LED blink. Only after 1-2 sec HDD LED blinks. Is it normal?
    What people have?
    null

    To answer the question of caching and syncing:
    Linux nearly caches all and does it on a high "level", means it
    is one of the reason for the good I/O-performance of linux.
    In order to make sure that data is directly written to the disks
    you can mount your disks with the option sync.
    An example: mount -o sync /dev/sdc1 /data_1
    Note, that the performance will decrease. The other possibility
    is a little tool called syncer, which is a daemon that causes
    linux to clear its cache every xy seconds (any value you like). I
    think (because I never used) it causes some overhead but is a
    good compromise to the sync-option.
    Deactivating caching in the kernel... I think this is not the
    best solution if you are not familiar with kernel programming.
    Also think of swapping and reads on the system-disk and so on.
    Dietmar
    p.s: I can't remember where I've found it, so I send it to your
    personal account, because I can't add any files here
    StE (guest) wrote:
    : Mark Malakanov (guest) wrote:
    : : I know that after commit Oracle LGWR process writes the data
    : : changies into the redo-log. And Oracle must return "Commited"
    : : only after above is done.
    : Not quite true. Information is constantly flushed from the
    : in-memory redo log buffer to disc while changes are taking
    place
    : to the database. When a transaction is committed the
    : current contents of the redo-log buffer are flushed to disc,
    : followed by a marker saying "SCN was committed" is written to
    : disc - the changes themselves have already been written out.
    : : But when I do Commit, I don't see the
    : : HDD LED blink. Only after 1-2 sec HDD LED blinks.
    : : Is it normal? What people have?
    : That's probably normal, but that doesn't make it a good thing.
    : The Linux buffer-cache does write-behind caching, so that dirty
    : buffers arn't written out to disc immediately. If there were a
    : failure the write of the commit or some of the preceeding redo
    : log blocks might not make it to disc.
    : I think you can tune the frequency with which bdflush wakes up
    : and writes to disc. Setting it to a low value if you're worried
    : about consistency over performance would be a good idea.
    : I don't know whether there's an open() flag to perform writes
    on
    : a file synchronously or not under Linux. It's possible to
    sync()
    : an open filehandle, I think, so perhaps Oracle does a sync on
    : the active redo log when it writes out the commit.
    : Anyone know anything less vague and hand-waving?
    : -michael
    null

Maybe you are looking for

  • Counter in priceing procedure

    Hi Guys , How the counter works in priceing procedure and how to to define counters in priceing procedure . RB

  • Save As and document format settings

    Is there a way to tell Pages when I do Save As to automatically choose the folder the current document came from? Is there a way to always default to Word Document layout? Thanks

  • HTTP Channel request-response

    Hi, I have configured HTTP channel for synchronous request response (syncresponse=true in additional headers). I have to send an outbound Invoice to TP via http, get the response back and process it as an email. I have the outbound and inbound agreem

  • Applet: writing to file

    hi there. i need serious help on using an applet and writing the user response into a text file. issit possible in the first place? cos i read at a lot of sources saying applet cant write to file? any help is much appreciated thx!

  • Change time column in iCAL

    Hi: I am a physician, and I organize the schedule for the Docs at my hospital. We have (for example), pediatrician, orthopaedics, internists, etc. For several years, I have used an excel sheet that basically formats as follows: GROUP June 29 June 30