Refresh master block - best way?

hi,
i want to refresh the master block every time a change is saved from the detail one (they have common items/fields).
I want to do it by the fastest possible way cause it is gonna be on the web. Downloading all master rows again would not be an option for my app for example.
I know no other way to do it than execute_query but i dont know if this is efficient enough.. any ideas?
thanks in advance,
teo

francois,
as far as the dml ret val is concerned i found this on help so no need to discuss it:
"Forms uses the DML Returning clause only with an Oracle8 database server. This property is ignored when using a non-Oracle8 server."
about the query all this only ensures that when the query runs all the rows will be fetched in the block at once i cant see how this will ensure optimum performance.
im starting thinking of coding this myself the way i described before..
teo

Similar Messages

  • JPA -- Best way to refresh a List association?

    Hi,
    I need to refresh a OneToMany association.
    For example, I have two entities: Header & Detail.
    @Entity
    @Table(name="HEADERS")
    public class Header implements Serializable {
        @OneToMany(mappedBy="header")
        private List<Detail> details;
    @Entity
    @Table(name="DETAILS")
    public class Detail implements Serializable {
        @ManyToOne(fetch=FetchType.LAZY)
        @JoinColumn(name="HDR_ID", referencedColumnName="HDR_ID")
        private Header header;
    }So, I fetch the Header along with all its Details.
    At a later point of time, I know that some Detail rows in the database have been changed behind my back. I need to re-fetch the list of Details. What should I do?
    1. I could add a cascade parameter to the @OneToMany association. I could specify:
    @OneToMany(mappedBy="header", cascade={CascadeType.REFRESH})Then I could run:
    entityManager.refresh(header);The trouble is that, since all the Details are already in the cache, the cached entities will be returned, not the ones fetched from the database. So, I won't refresh a thing. A query will be sent to the database indeed, but I will get the cached (i.e. stale) entities. I don't know of a way to specify something like
    setHint(TopLinkQueryHints.REFRESH, HintValues.TRUE)dynamically for associations, so that the values in the cache would be replaced with the ones fetched from the database.
    2. I could try to turn off the caching for the while Entity class. The trouble is that for some reason this doesn't work (see my other question here JPA -- How can I turn off the caching for an entity? Besides, even if it worked, I don't want to turn off the caching in general. I simply want to refresh the list sometimes.
    Could anyone tell me what's the best way to refresh the association?
    Best regards,
    Bisser

    Hi Chris,
    First, let me thank you that you take the time to answer my questions. I really appreciate that. I wish to apologize for my late reply but I wasn't around the PC for a while.
    TopLink doesn't refresh an entity based on a view. I will try to explain in more detail. I hope you'll have patience with me because this might be a bit longer even than my previous post. I will oversimplify my actual business case.
    Let's assume we have two tables and a view:
    create table MASTERS
      (id number(18) not null primary key,
       master_name varchar2(50));
    create table DETAILS
      (id number(18) not null primary key,
       master_id number(18) not null,   -- FK to MASTER.ID
       price number(7,2));
    create view DETAILS_VW as
      select id, master_id, price
      from details;Of course, in real life the view is useful and actually peforms complex aggregate calculations on the details. But at the moment I wish to keep things as simple as possible.
    So, I create Entities for the tables and the view. Here are the entities for MASTERS and DETAILS_VW, only the essential stuff (w/o getters, setters, sequence info, etc.):
    @Entity
    @Table(name="MASTERS")
    public class Master {
         @Id
         @Column(name="ID", nullable=false)
         private Long id;
         @Column(name="MASTER_NAME")
         private String masterName;
         @OneToMany(mappedBy="master", fetch=FetchType.LAZY, cascade=CascadeType.REFRESH)
         private List<DetailVw> detailsVw;
    @Entity
    @Table(name="DETAILS_VW")
    public class DetailVw {
         @Id
         @Column(name="ID")
         private Long id;
         @ManyToOne(fetch=FetchType.LAZY)
         @JoinColumn(name="MASTER_ID", referencedColumnName="ID")
         private Master master;
         @Column(name="PRICE")
         private Double price;
    }So, now we have the tables and the entities. Let's assume one master row and two detail rows exist:
    MASTER:  ID=1, MASTER_NAME='Master #1'
    DETAIL:  ID=1, MASTER_ID=1, PRICE=3
    DETAIL:  ID=2, MASTER_ID=1, PRICE=8And now let's run the following code:
    // List the initial state
    Master master = em.find(Master.class, 1L);
    List<DetailVw> detailsVw = master.getDetailsVw();
    for (DetailVw dv : detailsVw) {
         System.out.println(dv);
    // Modify a detail
    EntityTransaction tx = em.getTransaction();
    tx.begin();
    Detail d = em.find(Detail.class, 2L);
    d.setPrice(1);
    tx.commit();
    // Refresh
    System.out.println("----------------------------------------");
    em.refresh(master);
    // List the state AFTER the update
    detailsVw = master.getDetailsVw();
    for (DetailVw dv : detailsVw) {
         System.out.println(dv);
    }And here are some excerpts from the console (only the essentials):
    DetailVw: id=1, price=3
    DetailVw: id=2, price=8
    UPDATE DETAILS SET PRICE = ? WHERE (ID = ?)
         bind => [1, 2]
    SELECT ID, MASTER_NAME FROM MASTERS WHERE (ID = ?)
         bind => [1]
    SELECT ID, PRICE, MASTER_ID FROM DETAILS_VW WHERE (MASTER_ID = ?)
         bind => [1]
    DetailVw: id=1, price=3
    DetailVw: id=2, price=8You see, the UPDATE statement changes the DETAILS row. The price was 8, but was changed to 1. I checked the database. It was indeed changed to 1.
    Furthermore, due to the refresh operation, a query was run on the view. But as you can see from the console output, the results of the query were completely ignored. The price was 8, and continued to be 8 even after the refresh. I assume it was because of the cache. If I run an explicit query on DETAILS_VW with the hint:
    q.setHint(TopLinkQueryHints.REFRESH, HintValues.TRUE);then I see the real updated values. But if I only refresh with em.refresh(master), then the DetailVw entities do not get refreshed, even though a query against the database is run. I have tested this both in JavaSE and in OC4J. The results are the same.
    An explicit refresh on a particular DetailVw entity works, though:
    DetailVw dvw = em.find(DetailVw.class, 2L);
    em.refresh(dvw);
    System.out.println(dvw);Then the console says:
    DetailVw: id=2, price=1So, the price is indeed 1, not 8.
    If you can explain that to me, I will be really thankful!
    Best regards,
    Bisser

  • Best way to refresh page after returning from task flow?

    Hello -
    (Using jdev 11g release 1)
    What is the best way to refresh data in a page after navigating to and returning from a task flow with an isolated data control scope where that data is changed and commited to the database?
    I have 2 bounded task flows: list-records-tf and edit-record-tf
    Both use page fragments
    list-records-tf has a list.jsff fragment and a task flow call to edit-record-tf
    The list.jsff page has a table of records that a user can click on and a button which, when pressed, will pass control to the edit-record-tf call. (There are also set property listeners on the button to set values in the request that are used as parameters to edit-record-tf.)
    The edit-record-tf always begins a new transaction and does not share data controls with the calling task flow. It consists of an application module call to set up the model according to the parameters passed in (edit record X or create new record Y or...etc.), a page fragment with a form to allow users to edit the record, and 2 different task flow returns for saving/cancelling the transaction.
    Back to the question - when I change a record in the edit page, the changes do not show up on the list page until I requery the data set. What is the best way to get the list page to refresh itself automatically upon return from the edit-record-tf?
    (If I ran the edit task flow in a popup dialog I could just use the return listener on the command component that launched the popup. But I don't want to run this in a dialog.)
    Thank you for reading my question.

    What if you have the bean which has refresh method as TF param? Call that method after you save the data. or use contextual event.

  • What is the best way to filter an IP from being blocked?

    What is the best way to filter an IP from being blocked by a false positive? Event Action Filter?

    I'll assume you really mean "blocked" as opposed to "denied". You can either create an event action filter and subtract the blocked action, or you can add the address to the "never block" addresses.

  • Best way to get SharePoint workflow to trigger InDesign XML refresh and PDF export?

    What is the best way to get a SharePoint workflow to trigger the refresh of an XML datasource within an InDesign document, and generate a PDF export? The datasource would be hosted by SharePoint.
    Would InDesign Server be required?

    My understanding of the license is that Adobe requires you to use InDesign Server for this sort of thing.
    But the implementation is probably the same either way. Periodically poll, or find some way to trigger it.

  • Best way to implement a shared Blocking Queue?

    What's the best way to implement a shared Blocking Queue that multiple JVMs can enqueue objects in and multiple JVM's can dequeue from simultaneously?
    Also, I see references on the web to com.tangosol.coherence.component.util.queue.ConcurrentQueue but I don't see it in the current API docs...
    Thanks

    Hi snidely_whiplash,
    snidely_whiplash wrote:
    What's the best way to implement a shared Blocking Queue that multiple JVMs can enqueue objects in and multiple JVM's can dequeue from simultaneously?
    Also, I see references on the web to com.tangosol.coherence.component.util.queue.ConcurrentQueue but I don't see it in the current API docs...
    ThanksThat class is an internal class, AFAIK.
    As for implementing a queue, you might want to look at Ashish Srivastava's ezMQ component for some ideas:
    http://ezsaid.blogspot.com/2009/01/implementing-jms-queue-on-top-of-oracle.html
    Best regards,
    Robert

  • Best way of filtering records in a block

    Hi,
    i have a form with a data block that i want to filter. when i launch the form all records are fetched but then i want to choose the records displayed base on some criteria. Can i apply this criteria to the block so that it is not necessary to requery the database? Which is the best way to achieve this?
    Best regards,
    Bruno Martins

    To save network traffic, you may search from the form memory. Since you first got all deptments and its employees, which stays in form memory. then you should not use set_block_property('..',default_where), which will requery database.
    Then you may add another button inside add ENTER_QUERY;
    then in the when-list-changed trigger,
    GO_ITEM('emp.deptno');
    :emp.deptno := :delptno_list;
    execute_query;
    This way will just search among records in memory. But you may payoff with another ENTER_QUERY button or use default menu bar ENTER QUERY button item.

  • Best way to block multiple logins/same user ?

    What is the best way to block/prevent someone from logging in more than once at the same time with the same userID?
    I was thinking to post to a database whenever a user logs in/out but then every time a user does this there has to be a database call to see if that user is already logged in. This solution doesn't seem to efficient or maybe it is.?? Anyone with a better solution?

    I'm not sure what you mean. A user will log in, the form data will be authenticated against the db data, credentials will be stored in the session if authen was a success and sent back to login page if otherwise. I am imagining that I can put a flag field in the database LOGGED_IN with Y or N. So when user successfully authenticates I can insert a Y in the user's LOGGED_IN field and when the session gets destroyed insert a N. Does this answer your question?

  • WAD - Best way to layout master data fields for a single record

    I am creating an employee profile which will be fed from various InfoProviders in BI. I am going to lay it out so that there is a master data section at the top and then below there will be various histories (salary, job, etc) and everything will be populated by the value of a single variable.
    The question I have is what is the best way to lay out about 20 master data fields in the top section and have it look nice? My guess (and I am not fond of the tedium) is to create a bound text for each of them and bind it to the appropriate characteristic. Then just have the variable setting affect all of them.
    Anyone have any other ideas?

    Hello,
    you can use the interface command:
    storm-control unicast level 10.00
    or
    storm-control unicast bps 10000000
    The first command will limit bandwidth to 10% of what is available, the second will limit bandwidth to 10Mbps, effectively achieving the same thing.
    Check this link to the relevant configuration reference:
    Configuring Storm Control
    http://www.cisco.com/en/US/products/hw/switches/ps5023/products_configuration_guide_chapter09186a00802c10bc.html#wp1063295
    HTH,
    GP

  • Access-SQL Server (Client Server Configuration) Best Way To Refresh SQL Server Records ?

    We are using Access 2013 as the front end and SQL Server 2014 as the back end to a client server configuration.
    Access controls are bound to the SQL fields with the same names. When using Access to create a new record in a Form, the data are not transferred to SQL if the form is exited to display a different Form or Access is closed. If the right or left arrow navigation
    buttons at the bottom of the form are first used to display either the previous or next record, then the data in the new record are correctly transferred to SQL.
    What is the best way to refresh the new SQL record prior to the closing of the new record in the bound Access form ? We have tried Requery of the entire form and with all of the individual controls without success. We are looking for a method of refreshing
    SQL that functions in a manner similar to that of what happens with the navigation buttons.
    Thank you very much for your assistance.
    Robert Robinson
    RERThird

    Hi Stefan,
    I had added the code to set me.dirty = False in response to the On Dirty event and didn't realize that it was working properly. I had tried other several approaches and must have become confused somewhere along the line.
    I retested the program. On Dirty is working and the problem is solved.
    Thank you very much for your assistance.
    Robert Robinson
    RERThird

  • Best way to coordinate two blocks?

    I want to coordinate two blocks. Block A shows info about people who have come in recently. Block B shows if they
    have had some certain paperwork filed.
    So for each record in block A there may or may not be an entry in Block B. I want the data to match up horizontally
    from block A through Block B.
    (and then eventually when the user clicks on button a missing record in block B it will fill in the details from various places in the database and the new entry(ies) in Block B can be saved back to Table B. )
    It escapes me how to do this. Any ideas? If B is a detail table to block A then it does not provide blank records
    where B does not have an entry for A yet.
    example
    block A           Block B
    id  came in        id  paperwork
    22 2/1/2012     22  paperwork done
      3 2/2/2012                                   (paperwork not done yet so B record missing)
    14 2/3/2012     14 paperwork done
    11 2/4/2012                                    (paperwork not done yet so B record missing)Edited by: lake on Feb 16, 2012 4:45 PM

    No it doesn't work to just have two blocks side by side.
    There is no way to coordinate them. In my experience with the master-detail relationship you can define, it does not have multi block to multi
    block capability. it's geared to one master key in the master block, not multiple master keys. But it would be a really great feature if
    there were a multi-master-detail capability! right?
    If you don't do the relationship thing but have the same type of query restrictions for each block, in block B there are no gaps for the cases
    a B record does not exist for an A record, i.e. the primary keys do not line up "horizontally".
    Although I think Andreas is correct that creating a view solves a lot of problems I'd like
    to proceed on emulating the multi-master-detail scenario if I can in the form.

  • Best way to install Master Collection CS5

    Ok, some of you may think this is a dumb question but after the absolute torture I went through with loading up my CS3 MC over the years on previous pcs I'm gonna ask it anyway. I have a Vista 64 workstation / 10K Raptor boot disk with plenty of space and the previously mentioned CS3 MC on it - everything working great. I now have a shiny new full version of CS5 Master Collection I'd like to put on the same machine. What's the best way to go? I can't afford days of downtime because of incompatibilities between the two installs. My intention is to keep only Photoshop CS3 from the older MC (until I get up to speed w/CS5) and at some point uninstall everything else CS3.
    I'm thinking -
    1. Uninstall the CS3 MC, all of it - run some cleanscript like the last time (is this needed? available for this version?), install CS5. Then re-install PS CS3 from the CS3 MC disks (a real PITA).
    2. Forget the CS3 setup and just try installing CS5 MC and see what happens. If it was anything like last time this could take hours, with no assurance of sucess due to some random error popping up while I'm falling asleep. Then do the CS3 uninstall, maybe app by app if it will let me?
    Your thoughts are welcome!

    Hey thanks for the advice. I ended up going 'all in' and uninstalled everything Adobe CS3, Flash, Air and Reader (after saving all my PS settings, actions and the like on a different drive), running the CS5 cleanscripts, copying the CS5 files to a desktop folder and installing from there. Everything installed just fine on the first run (!) and yes, I went to bed while everything updated itself. I haven't gone through everything yet (that might take a year) but all the biggies fire up and that's a good thing. Photoshop, Acrobat and Dreamweaver are my big three for the moment.
    I do have one little problem - the darn pc won't reboot properly (?). This started up right after I uninstalled everything and of course the uninstaller demanded a restart. It will boot through bios, then the little scrolly thing and then when the little animated logo is supposed to go on to the login screen - nothing! It just sits there with a blank screen and the HD light going blip, blip, blip. Now, if I kill it with the power switch and then cold start, select 'last known good configuration' it will boot through just fine; that's how I went ahead with the CS5 install. My big question for today is - how do I save this 'last known good configuration' as THE configuration? Anyone wanna take shot at it?

  • Display property of key field in master block effects detail blk refreshing

    Can anyone throw light on why a screen with the detail block in a straightforward master detail block does not refresh correctly unless one of the two key fields in the master block is displayed? The key field did (of course) exist in the master block - it just was not displaying. As soon as this key field was displayed, then when ever the problem screen was opened or the master block records were paged through, then the detail block refreshes nicely. Disable the display property again and the detail block does not refresh nicely. Found problem in forms 6i. (note, usage of the synchronize function did not change anything)
    Did I see similar problem some six or so years ago in forms 4? Ideas anyone?

    re rebuild from scratch.
    yes, we did rebuild the form from scratch. Original form was generated. Carefully made the same blocks, block relationships etc etc etc and then copied code from old forms triggers and so on carefully over.
    re being reproducable
    yep, tis so. We are both long term experienced Oracle developers - but this is a weirdy. Got any ideas? If we work anything out we shall certainly update this.

  • What's the best way to master an MPEG 2 file for DVD Studio Pro.

    In version 4.5 of FCP I was able to use QuickTime conversion to encode to MPEG2. Now that option is not there. I hate using compressor 2 to create MPEG 2 because when I do the MPEG 2 files always seem to studder and I don't know why. I shot my project in HDV. It is about 64 minutes long. Any suggestions on the BEST way to master an MPEG 2 file for DVD Studio pro? Thanks in advance!
    Peter
    PS - I'm using FCP 5

    Some people have reported a field reversal problem with HDV to SD DVD encodes. There's an Apple technical document on this issue somewhere, but the problem was supposed to be addressed by a Pro Applications update a couple of years ago... This site might help you get to the bottom of the problem.
    http://www3.telus.net/bonsai/Step-by-Step.html

  • Best way to block specific external IP addresses

    I'm using an ASA also and I've been blocking IPs for some time now and it has really tapered off ( now I'm just watching the "hit" counters tick up) - I check the geographic location of the offending IP and if it is from a region of the world that we wouldn't interact with anyway, I block the entire range of IPs... mostly China and Korea and Russia. Fast forward several months and I rarely block an IP any more as most of the offending IPs have already been blocked. Of course this strategy won't work for everyone.
    Any way you accomplish this task is going to require you to add the addresses as they pop up on your radar so I don't see how GPO will make your life easier, you'll want to block at the perimeter anyway.

    Every week we get a list of known  Malware IP addresses. My boss wants me to block these addresses so I was wondering what the best way to do this would be. We have a Cisco ASA and I know I could create a network object for each IP addresses and select block all access. But is that the best way. I think another option might be with a GPO and a hosts file. Any other ideas. There are usually 30-50 IP addresses listed at least every week. Any other ideas or a better way to accomplish this? Thanks.
    This topic first appeared in the Spiceworks Community

Maybe you are looking for