(Automatic) Refresh of Cached object after insert/update

Hi,
(I am using Toplink 9.0.3 against an Oracle Database)
I am inserting and updating records in the database through objects registered in a TopLink UnitOfWork. I happen to know that certain database columns will get a (changed) values because of Database triggers.
Is it true that the only way to get these changed values reflected back to the TopLink cache is by explicitly executing a
session.refreshObject();
call for every object changed in the UnitOfWork?
Is there no way to inform TopLink (for example through the descriptors for the relevant classes) that for certain classes after the insert/update an automatic synchronization with the database must be performed?
I have not been able to find such a setting, but I may have overlooked it - I hope I did.
Thanks for your help,
Lucas Jellema (AMIS)

In this case use a postMerge event -- it will get called after the merge of the cache and then you could update the object explicitly.
Ultimately, the way to achieve the behavior you're looking for is events or refreshing.
- Don

Similar Messages

  • Refreshing the RowSetBrowser webbean after insert/update(?)

    How do I refresh the RowSetBrowser web bean after inserting or updating and committing a record thru the EditCurrentRecord web bean?
    I am unable to see the new record added in the RowSetBrowser unless I close the browser and re-enter.
    Any advice would be appreciated!
    null

    after you call to iniatialize() in the DWB, you can refresh the cache by calling
    <%
    dbw.getRowset().executeQuery();
    %>

  • After REFRESH the cached object is not consistent with the database table

    After REFRESH, the cached object is not consistent with the database table. Why?
    I created a JDBC connection with the Oracle database (HR schema) using JDeveloper(10.1.3) and then I created an offline database (HR schema)
    in JDeveloper from the existing database tables (HR schema). Then I made some updates to the JOBS database table using SQL*Plus.
    Then I returned to the JDeveloper tool and refreshed the HR connection. But I found no any changes made to the offline database table JOBS in
    JDeveloper.
    How to make the JDeveloper's offline tables to be synchronized with the underling database tables?

    qkc,
    Once you create an offline table, it's just a copy of a table definition as of the point in time you brought it in from the database. Refreshing the connection, as you describe it, just refreshes the database browser, and not any offline objects. If you want to syncrhnonize the offline table, right-click the offline table and choose "Generate or Reconcile Objects" to reconcile the object to the database. I just tried this in 10.1.3.3 (not the latest 10.1.3, I know), and it works properly.
    John

  • Bc4j bug at refresh after insert / update

    having a table and a trigger on it that fills an attribute
    in a 9i db. one can take the scott/tiger emp table and use the
    following trigger:
    create or replace trigger t_bri_emp
    before insert on emp
    for each row
    declare
    v_no number(7,2);
    begin
    select user_SEQ.nextval*100
    into v_no
         from dual;
    :new.sal := v_no;
    end;
    then creating a bc4j project with an entity object based on this table (emp)
    and a view object based on the created entity object.
    !!!! when you create the bc4j project you must set the SQL Flavor to SQL92 or OLite
    when you set the attribute settings, for the attribute the trigger is on (sal),
    to refresh after insert / update or both in the entity object you get a
    null pointer when you try to insert a new row and commit.
    java.lang.NullPointerException
         oracle.jdbc.ttc7.TTIoac oracle.jdbc.ttc7.TTCAdapter.newTTCType(oracle.jdbc.dbaccess.DBType)
         oracle.jdbc.ttc7.NonPlsqlTTCColumn[] oracle ....................
    all can be reproduced just useing the wizard and start the bc4j project with the tester
    any workaround ??

    Sven:
    I looked into your issue. It turns out your problem is caused by a bug in the system (bug #2409955).
    The bug is that for non-Oracle SQLBuilder, we are not processing refresh-on-insert and refresh-on-update attributes correctly. We end up forming an invalid SQL statement and the JDBC driver gives the obscure NullPointerException.
    Thus, until 9.0.3, you should not use refresh-on-insert/update attributes on a non-Oracle SQLBuilder.
    If you need the refresh-on-insert/update attribute, here is a possible workaround:
    1. Whenever you invoke the tester, on the first panel, click on the 'Properities' tab. In the list of properties, you should find one for 'jbo.SQLBuilder'. It will say 'SQL92'. Remove it, so that it is empty. Run test tester. Then, the tester will use Oracle SQLBuilder which will handle refresh-on-insert/update attributes correctly for you.
    2. For switching between Oracle SQLBuilder and SQL92 SQLBuilder, you can try the following:
    2a) Locate bc4j.xcfg and your Project??.jpx under your 'src' directory.
    2b) Make copies of these files.
    2c) Edit them so that you have one set for Oracle SQLBuilder and one set for SQL92 SQLBuilder. For Oracle SQLBuilder, make sure these files do NOT have entries like:
    <jbo.SQLBuilder>..</jbo.SQLBuilder> in bc4j.xcfg and
    <Attr Name="_jbo.SQLBuilder" Value="..." /> in Project??.jpx
    When there is no jbo.SQLBuilder entry, BC4J will default to Oracle.
    For SQL92, make sure you have
    <jbo.SQLBuilder>SQL92</jbo.SQLBuilder> in bc4j.xcfg and
    <Attr Name="_jbo.SQLBuilder" Value="SQL92" /> in Project??.jpx.
    Before you run, decide which SQLBuilder to use (for 9.0.2, with retrieve-on-insert/update attrs, you have no choice but to use Oracle SQLBuilder) and copy these files into your class path, e.g.,
    <jdev-install-dir>\jdev\mywork\Workspace1\Project1\classes
    When you get 9.0.3, then you should be able to switch between Oracle and SQL92 SQLBuilders freely.
    Thanks.
    Sung

  • Response.write after insert/update

    Hi
    Could anyone please show me how to do a response.write message on the page after insert/update?
    Wondering especially about the placement and the syntax of the response.
    DWCS5, Access, Asp
    Christian

    I'm sorry to say I don't know how to test values in ASP, have just started to use it.
    I didn't get it to work so I threw away the code and went for an ordinary text response on a second page.
    Might as well get a book and read up on it

  • Create trigger for after insert update

    i have table tt (id number (10), name varchar2(20), status varchar2(1) , stage varchar2(1))
    when i insert data in table tt
    id name status stage
    1 anil a
    then trigger fire and update same value of satge to status
    like
    1 anil a a
    pls give example

    Hi,
    please try this code:
    CREATE OR REPLACE TRIGGER <tiggername>
    AFTER INSERT OR UPDATE
    ON TT
    FOR EACH ROW
    DECLARE
    v_Status varchar2(10);
    BEGIN
    -- Insert record into audit table
    INSERT INTO orders_audit
    ( id,
    name,
    stage)
    VALUES
    ( :new.id,
    :new.name,
    :new.stage);
    select stage into v_status
    from tt where stage = new.stage
    update tt set status = v_status where id = new.id
    END;

  • ORA-29532 exception from after insert update trigger

    Trigger code:
    CREATE OR REPLACE TRIGGER SAMS.PERS_ALG_AIU_TRG
         AFTER INSERT OR UPDATE
              ON PERS_ALG
              FOR EACH ROW
    DECLARE
         trans_type          VARCHAR2(1);
         event_id          CONSTANT VARCHAR2(7) := 'A31_ZA1';
         data_src          CONSTANT VARCHAR2(15) := 'SI_A31_ZA1_VW';
         p_row_id          ROWID;
         select_stmt          VARCHAR2(5000);
         XMLString          CLOB;
    BEGIN
         IF INSERTING THEN
              trans_type := 'I';
         ELSE
              trans_type := 'U';
         END IF;
    SELECT ROWID
    INTO p_row_id
    FROM personnel
    WHERE pers_seq = :new.pers_seq;
    select_stmt := 'SELECT * FROM si_a31_ZA1_vw WHERE start_date = MAX(start_date) AND ROW_ID =chartorowid('''||p_row_id||''')';
         -- Produce the XML
    XMLString := si_lib.get_XML(select_stmt);
         -- Insert the transaction
         INSERT INTO si_transaction (transaction_type, event_id, status_id, timestamp, transaction_xml)
              VALUES ( trans_type, event_id, 'CR', SYSDATE, XMLString);
              EXCEPTION
                   WHEN OTHERS THEN
                   RAISE_APPLICATION_ERROR (-20040, sqlerrm);
    END;
    ... is causing ORA-29532 JAVA call terminated by uncaught java exception: java.lang.nullPointerException
    any ideas --- get_XML actually calls dbms_xmlquery.getXML

    When in doubt, break it into pieces and test the pieces. The following is not valid:
    SELECT * FROM si_a31_ZA1_vw WHERE start_date = MAX(start_date)
    Try replacing the above with:
    SELECT * FROM si_a31_ZA1_vw WHERE start_date = (SELECT MAX(start_date) FROM si_a31_ZA1_vw)

  • Automatically refresh the report tabs after selecting the parameters in bip

    Hello Everything!!
    Is there a way to automatically refresh all the report tabs once we select the parameters? The report are not refreshed automatically in each tab and users have to either hit apply button or refresh button for each report tab . Is this a lacking feature in BI publisher. I am using 11.1.1.6.6.
    Thanks,
    Uday

    Hello Everything!!
    Is there a way to automatically refresh all the report tabs once we select the parameters? The report are not refreshed automatically in each tab and users have to either hit apply button or refresh button for each report tab . Is this a lacking feature in BI publisher. I am using 11.1.1.6.6.
    Thanks,
    Uday

  • Automatic recompiling of kernel module after kernel update.

    Hello everyone,
    i tried to search for it but without success...
    my question is - is it possible to set it up somehow that aur package would recompile after kernel update?
    The package I would like to rebuild is rt3090 which is module for my wifi card. It is very annoying to rebuild it manually. I know that my fglrx module does it automaticaly but how to set it?
    Thank all of you for any advise.

    Thank you :-) It looks ok, I will try DKMS as soon as I get some free time. If there was any problem, I would tell you.
    BTW: I use catalyst mainly because of saving energy management, which is of course better for my netbook. My card is too new to be fully supported by the opensource driver.
    EDIT:
    I solved the situation by upgrading my system, I tried in-kernel module rt2800pci. In the previous kernels it didn't work well with my crappy ralink rt3090 wifi card, but that's been improved :-) so I do not need rebuild the package anymore even because this module isn't compatible with newest kernel.
    I also learnt how to write my own hook from archwiki (https://wiki.archlinux.org/index.php/Mkinitcpio) so if the new module didn't work I would try it.
    The final solution = replace module rt3090sta by rt2800pci.
    Thanks! Arch has very powerful community :-)
    Last edited by h@lf@rk (2012-06-02 18:34:17)

  • How to ensure that refreshed page is displayed after an update?

    I have a page with “Form” region. I’ve used “Table” for “Create a data entry form based on”. The form works as it should, but I have set the same page to go to after “Save” or “Apply Changes” button is pressed. Now whenever I change any field at the page via my form I get back to the same page, but the changes are NOT visible. I need to go to a different page and then back to my page with table form to see new/updated data.
    Is there a way of enforcing the refresh/re-query of the data after I click on Apply Changes/Save button?
    jarola has suggested the following topic: Branch to URL identify session and record ID
    However, when I follow the suggestion and add "Optional URL Redirect" to the same page (76) for "Apply Changes" button, and configure "Set These Items" with "With These Values" then the values entered via the form are NOT saved at all. If I remove "Optional URL Redirect" (I set "Target is a" to "- No Target -") then the data is at least saved when I click on "Apply Changes".
    Thank you for your time.
    Daniel

    I am gathering that what you want is for the user to make some changes, save the data, and be left with a refreshed page showing the new values, right?
    I order to save the data, the form usually has to perform some kind of submit action. Therefore, do not use a URL redirect. The only time you can use that is if your URL redirect calls javascript which in turn does a submit. But if you just redirect, no submit is done.
    Make sure whatever the user does to initiate processing is doing a submit. This usually is by clicking a button whose action is "no target" (this equates to some sort of submit action).
    Then, make sure this submit action invokes whatever process it is that does the save to the database. Check the row processng that was created during the wizard creation of the form and make sure that any conditions on it are such that it fires based on your request value or the button in question being pressed.
    (Actually this brings up a question...if after the save action, can you see updated data in the database via SQL*Plus or SQL*Developer (or whatever database query tool) but just not in Apex? This will at least tell you if the data is being saved and it's just an application presentation issue or not.)
    Then, make sure any proper page branches are firing. Again, look at the conditions and/or button-pressed settings. I think for this sort of thing I would clear the cache for your page via the page branch settings, and then do a "set these items..." and "with these values..." such that you are setting the PK values of the record with the existing PK values of the record you are dealing with. (I guess this assumes this form does the usual automated row fetch during loading if the PK values are not null. Is this the case?)

  • Refreshing a view object after data external change

    Hi
    I'm trying to refresh a viewobject based on a read-only query, the table data used on the query are updated by an other application
    the problem that the view don't refresh its data from the database, it return always the same value
    (but after leaving the page to another then getting back to my page the data is refreshed)
    my code (periodically called by a poll):
    vo.reset();
    vo.setQueryMode(ViewObject.QUERY_MODE_SCAN_DATABASE_TABLES);
    vo.setpIdUser(1);
    vo.executeQuery();
    if(vo.getRowCount()>0) {
    r = (PosInstantaneRowImpl)vo.getCurrentRow(); //always just 1 row is returned
    if(r.getIdtracking()!=null) {
    val = r.getIdtracking();
    System.out.println("Idtracking1: "+val); //print always the first value retrived when the page is loaded
    i'm using JDev 11.1.1.2.0
    database: mysql 5.2.11
    ms windows 7
    thanks for help.

    the vo is generated via the an existing iterator on my page:
    PosInstantaneImpl vo = (PosInstantaneImpl)iter.getViewObject();
    i tried getting a new viewobject instance:
    PosInstantaneImpl obj = (PosInstantaneImpl)app.findViewObject("PosInstantane1");
    and executed the same code:
    obj.setQueryMode(ViewObject.QUERY_MODE_SCAN_DATABASE_TABLES);
    obj.setpIdUser(1);
    obj.executeQuery();
    if (obj.getRowCount() > 0) {
    PosInstantaneRowImpl vr = (PosInstantaneRowImpl) obj.first();
    System.out.println("Idtracking_ext: "+vr.getIdtracking());
    the last code worked and gived the right data values, but the data of the vo from iterator still wrong!
    Idtracking1: 590 //wrong value
    Idtracking_ext: 591 //right value
    Idtracking1: 590 //wrong value
    Idtracking_ext: 592 //right value
    any one have idea why this ? how can I refresh the vo generated from the iterator ? I need at the end to refresh a ritch table using the iterator.

  • Lost refresh icon on toolbar after recent update. How do I get it back?

    I have always had a refresh page icon on the toolbar of every Mac I've owned. Several updates ago it disappeared after update & I can't figure out where it went or how to reinstate it. Was it an original addon? I've looked in apple menu but don't find it anywhere. Can you help?

    Firefox 4 and later use a combined Stop/Reload/Go button that is positioned at the right end of the location bar.<br />
    During the page load process it shows as a Stop button and after the loading has finished the button is changed to a Reload button.<br />
    If you type in the location bar then that button becomes a Go button.<br />
    Middle-click the Reload button to duplicate the current tab to a new tab.
    To move the Stop and Reload buttons to their position to the left of the location bar you can use these steps:
    * Open the Customize window via "View > Toolbars > Customize"
    * If the menu bar is hidden on Windows or Linux use "Firefox > Options > Toolbar Layout"
    * Drag the Reload and Stop buttons to their previous position to the left of the location bar.
    * Set the order to "Reload - Stop" to get a combined "Reload/Stop" button.
    * Set the order to "Stop - Reload" or separate them otherwise (Space or Separator) to get two distinct buttons.
    *http://kb.mozillazine.org/Toolbar_customization
    *https://support.mozilla.com/kb/Back+and+forward+or+other+toolbar+items+are+missing

  • Automatic refresh of Planning form after HBR calculation is finished?

    Let's say that there is a Planning web form in which the user should run a business rule manually.
    The business rule contains a runtime prompt where the user selects the member he wants to calculate.
    After running the rule, the result of the calculation is not visible until the user clicks the "Refresh" button thereafter.
    Is it possible to automate such a refresh in any way, so that it happenes automatically after the calculation is finished?
    Planning version 11.1.2.1.

    I agree, it would work and the user is then guided through the process. :-)
    However ... I am looking for an even "smoother" solution.
    We are handling some 20+ applications with several forms containing manual HBRs in each, so I would definitely avoid creating that many task lists or other extra stuff to maintain.
    My hope was that there is a way to activate either a "save" or a "refresh" automatically after trigging the business rule. What about java code?

  • Computer on constant Automatic Repair and Diagnosing loop after Bios Update

    I have an HP AiO 23 G010 computer that has decided to stop working after a Bios Update yesterday. It goes on a constant "Preparing Automatic Repair" and "Diagnosing Problem" loop followed by a blue screen that says "Your PC has run into a problem and we are gathering information..." with a face. 
    I have hit the esc button, f2, and everyother key that I can hit. It only allows me to go to the system screen where I am able to do tests, and checkout firmware management, etc. I tried to roll back the bios update but it would not allow me. 
    What can I do to fix this?
    Thank you

    Restore BIOS defaults and if you get into Windows, select a Restore Point prior to when you have problems.
    If no go, you may have to perform a factory restore.
    Please mark my post as SOLVED if it has resolved your problem. It helps others with similar situations.

  • My iPhone automatically recovers some deleted images after iOS update

    Some months back I deleted few images off my iPhone. I understand that photo stream was 'On'. I noticed that my iPhone was recovering the images now and then. I put 'Off' all the sharing services, photo streams etc etc still my iPhone recovers these images after an iOS update. These are some sensitive photos and I would be in big trouble if this continues.

    What exactly have you tried?
    What happens when you try those things?
    What is the exact wording of any error messages received?

Maybe you are looking for

  • Display image in flex from database

    I am using flex and java and mysql, I upload image file into database from flex application.Now i want to display image in my flex RIA application from database. How can i do that?? Thanks in advance!!!

  • Setting Up the File Server Dynamically

    I have a scenario wherin i have to set up the FTP server name  and directory where i have to put the final file dymically. I was able to set the directory path dynamically using Adapter Specific Message properties. Can somebody suggest me if i can se

  • How to connect to AP with WPA2, EAP-PEAP, MSCHAPv2...

    I am trying to connect to the company network, but it always shows "PEAP authentication failed". There are only instructions for iPhone and PC. security : WPA2-Enterprise authority certificate : None Security Type : PEAP Inner Link Security : EAP-MSC

  • Why does SHIFT+CLICK to select/append selection in STP work *so badly*?

    This drives me absolutely crazy. It's the one thing one needs to do in this application and it works appallingly. I have an area selected of my waveform. I want to add a little more from along the timeline, or trim the selection a bit. I hit SHIFT+CL

  • Order Settlement concept

    Please see below situation and reply me on what logic system calculated MAP. Price control indicator is V for FERT Order Created and Confirm and GR n GI done. before that FG MAP WAS 8,121.91 Stock -115 MT after making GRN OF 100 MT new stock is 215 M