Smart update for bidirectional 1:n mapping?

Hi,
when I add a new object to an 1:n mapping, it usually goes something like this
[Employee 1:n Phone]
// Phone Class
protected void setOwner(Employee emp) {
this.owner = emp;
// Employee Class
private List phones ;
public void addPhone(Phone phone) {
//important for db update
phone.setOwner(this);
//maintains correct object model
phones.add(phone);
If "phones" is an IndirectList and it hasn't yet been instantiated, then calling phones.add() will result in an SQL statement (select * from phones where ..) just to instantiate the list.
This can be performance problem for large n's so I sometimes use this trick:
public void addPhoneIfInstantiated(Phone phone) {
phone.setOwner(this);
if (phones instanceof IndirectContainer)
IndirectContainer indirectContainer = (IndirectContainer) phones;
if (indirectContainer.isInstantiated())
phones.add(phone);
It has however one major drawback: if "phones" is not instantiated when add is called and the application accesses it later, it will get instantiated without the new object as long as the unit of work remains uncommitted.
This problem would disappear if I were able flush the SQL to the database right after adding the new Phone object (start the transaction right away).
Is it posssible to do that in toplink 9.0.4? Will it be possible in the next release? I think ejb 3.0 requires something like this.
Or is there something else I can do to achieve the same result?
Ana

Hi,
The problem would not go away if you flushed the SQL, the hole would just be smaller.How would the hole be smaller?
What I meant is this:
If I send "insert .. into Phone" on a jdbc connection and then do a "select * from phone where employee_id=.." on the same connection, the result will include my uncommitted changes, won't it? The other connections won't see it but the current uow would be "conform" without the extra effort of in-memory querying.
I think however that the unit of work defers all reads to the client session, which in turn uses a different jdbc connection from a read-only pool. In that case flush won't help me at all.
>> There is nothing in 9.0.4, (or EJB3) that would handle this. I will log an enhancement request for this functionality.
That would be great!
If this is a major issue, they best solution is to not map the 1-m, then there is no issue. Instead the collection can be queried when required.The developers like their 1:m mapping and don't want to give it up :-).
The thing is, the same code is used both in an interactive application and in some batch jobs. In dialog mode it's OK to execute an sql query for the mapping, in batch mode not.
By the way, I tried the addToDescriptor approach but the valueholder doesn't contain the new object :-(.
Maybe I could write a Valueholder that works exactly like the IndirectList but doesn't trigger indirection on add. Instead it holds the added objects in an separate list and really adds them when/if the list is instantiated.
OK, it seems too much ado about nothing and I probably won't do it but do you think that it would work? Theoretically?
Ana

Similar Messages

  • Problem with Smart Update in WLS 9.2

    Hi
    I have installed AquaLogic Service Bus with Weblogic Server 9.2 and when I try to run Smart Update it tells me there is a patch that I need to download. I click ok and then when smart update tries to restart I get an error:
    "Could not find the main class. Program will exit".
    I don't seem to be able to get passed this. Any suggestions?
    Best regards

    Petra Sandberg <> wrote:
    Hi!
    I'm trying to install patches via Smart Update for WLS 9.1 on a Solaris ,
    when I run bsu.sh the GUI starts and then presents an error: "Unable to
    locate any supported product installations. The tool will now exit". Does
    anyone have any suggestions to correct this?Check if the home directory of the user also contains the bea directory.
    So ensure that the same user is used for the bsu as you installed the
    product.
    B
    Schelstraete Bart
    [email protected]
    http://www.schelstraete.org
    http://www.linkedin.com/in/bschelst

  • Problem with Smart Update in WLS 9.1

    Hi!
    I'm trying to install patches via Smart Update for WLS 9.1 on a Solaris , when I run bsu.sh the GUI starts and then presents an error: "Unable to locate any supported product installations. The tool will now exit". Does anyone have any suggestions to correct this?

    Petra Sandberg <> wrote:
    Hi!
    I'm trying to install patches via Smart Update for WLS 9.1 on a Solaris ,
    when I run bsu.sh the GUI starts and then presents an error: "Unable to
    locate any supported product installations. The tool will now exit". Does
    anyone have any suggestions to correct this?Check if the home directory of the user also contains the bea directory.
    So ensure that the same user is used for the bsu as you installed the
    product.
    B
    Schelstraete Bart
    [email protected]
    http://www.schelstraete.org
    http://www.linkedin.com/in/bschelst

  • How to turn on / off live updating for all smart playlists at once?

    Hello.  Is there a way to turn live updating on or off for all my smart playlists at once?  That would be a fantastic feature since too many smart playlists with live updating turned on brings iTunes to a crawl. 
    Currently, I run iTunes on Windows 7.  I have over 40,000 songs, and I have hundreds of smart playlists to help organize all my songs and what's on my various iPods at any time.  The problem with having so many smart playlists is that iTunes runs very slow.  One thing that I do to make iTunes run slightly faster is to turn off live updating for as many smart playlists as I can stand (by going into each one and editing), but then it's hard to tell which have live updating turned on and which don't.  As a result, many of my smart playlists don't get updated when I would like them to because I have to go in and manually edit each one again to turn it back on.  Maybe showing which have live updating turned on or off would be useful, too? 
    On a related note, my iPod Classic will actually not work when I sync too many smart playlists.  This has been a long-standing problem with iPods, and I'm surprised that it hasn't been fixed yet.  I have not experimented to see if it makes any difference if the smart playlists have live updating turned on or off. 
    Thanks.

    this is exactly what i was hoping to see -- but i can't get it to run right on iTunes 12, yosemite
    it also doesn't seem to recognize "Home Videos" or "Audiobooks" as special and tries to turn them off -- i modified the earlier script to add those two to the lists of exclusions, but still get the same error message on the first "unspecial/real" smart playlist -- hasn't somethign changed in the object model perhaps?
    thank you muchly!
    =mjb
    tell application "iTunes"
    activate
      set allPlaylists to (get every user playlist)
      repeat with thisPlaylist in allPlaylists
      if (thisPlaylist is smart) and name of thisPlaylist is not in {"Music", "Movies", "Podcasts", "Books", "TV Shows", "iTunes U", "Apps", "Ping", "iTunes DJ", "Genius", "Home Videos", "Audiobooks"} then
      set view of browser window 1 to thisPlaylist
      tell application "System Events"
      tell process "iTunes"
      tell menu bar 1
      tell menu bar item "File"
      tell menu "File"
      click menu item "Edit Smart Playlist"
      end tell
      end tell
      end tell
      set theCheckbox to checkbox "Live updating" of window 1
      tell theCheckbox
      if (its value as boolean) then click theCheckbox
      end tell
      click button "OK" of window 1
      end tell
      end tell
      end if
      end repeat
    end tell

  • C2-03 software/maps update for Pakistan

    Dear Nokia Team
    We are anixiously waiting for new software update for c2-03 as number of complain suggest that device has most buggy software, as I noticed software update is available for some countries but for Pakistani variant we are still waiting, Kindly make new update available to Pakistani customers as well. Secondy nokia advertise a lot about maps but I notices device which is sold in Pakistan has gulf countries maps and not of Pakistan even if we try to update it from ovi it does not show Pakistani maps. Please do the need ful and let me know when these updates will be available to us.
    Regards
    Irfan

    you will need to keep checking yourself for this info or subscribe to the software update thread
    If  i have helped at all a click on the white star below would be nice thanks.
    Now using the Lumia 1520

  • I have a samsung smart tv i want to play my pogo but will not update for me

    i have a samsung smart tv and want to play my pogo but it will not updat for me what do i do

    Your Smart TV uses Google Chrome as its browser, yes?

  • Where can I get map updates for my NV-u44?

    My friend gave me a NV-U44 gps. Where can I get map updates for it?

    Hello Hawkhero,
    Welcome to the Sony Community.
    Currently there is no map update available for NV-U44. However, there is a firmware update available for your nav-u unit. Although the firmware update does not provide additional map data, it may improve the route quality of your map in certain situations. The firmware update is available from the Sony® Support Web Site.
    Regards,
    Charlie

  • Where is updates for Map 3.01? or has discontinued...

    I have Nokia N82 which is uses Nokia Maps 3.01, its maps is very useful for me but  seems maps updates has discontinued for this version, because after several updates for 3.06/3.07/3.08/3.09 still nothing for 3.01! 
    What is going on? No service for old phones? is this nokia's strategy to force people buying windows phone? 
    Solved!
    Go to Solution.

    Whilst this remains the last version of Ovi Maps v3.01 for use with your N82, N95 the last set of map data for 00.01.29.100 for use with it was released in December 2012.
    For S60 5th Ed. devices the cut off was Nokia Maps v3.06 and latest being v3.09 in Nokia Maps Suite 2.0 for Symbian S^3 devices.
    It is only the maps application which hasn't advanced as S60 3rd Ed. FP1 devices do not have available resources to use the extra transportation layer in 00.02.50.103 map data.
    Happy to have helped forum in a small way with a Support Ratio = 37.0

  • HT5429 When would an update for the "apple"'s version of maps come out? This is ridiculous.

    When would an update for the "apple"'s version of maps come out? This is ridiculous.

    Nobody knows until apple announces it.

  • Map updates for Symbian version of Nokia Maps/Driv...

    The last map update I had for my Nokia 808 is from back in April of this year.
    Is Nokia no longer providing map updates for the Symbian version of Nokia Maps/Drive software?
    This would be VERY disappointing if so.
    Please respond, and not ignore this question.
    thank you

    thanks!
    But sadly Nokia didn't even have the manners to respond in that thread either.. so there is still no answer.
    I just dropped $550 on a Nokia 808 Pureview, with the assumption that I will have good GPS software...
    Now Nokia is abandoning map updates for symbian?
    I will be outraged if this is the case..
    NOKIA please respond!!

  • Update for BlackBerry Maps

    Please is there an update for BB Maps. I am asking this question because the map installed on my BB Torch 9800 does not even show our International Airport in Livingstone. Zambia. Any update please???

    Turns out I don't see anything in Zambia except a few city names. No roads, nothing. Same for many other countries in Africa. I see roads and landmarks for South Africa, Nigeria, and some others, but that's it. If you see roads in Zambia then you are seeing more than me. I'm surprised at that.
    - Ira

  • Map Update for Symbian Devices?

    Hey Guys,
    so I am wondering when the next map update for Symbain devices will roll out. the current maps are over a year old now and missing tons of roads (at least in germany).
    Any info on that?
    thanks & cheers
    -dr
    Solved!
    Go to Solution.

    There you go …

  • Smart file examiner wont install updates for office on my macbook air. i click step two for show info then nothing happens

    I just got my my macbook air and I am still learning how to use it. I just put Office 2011 on it and there was an update for it after i installed it. I did the update and it downloaded it but then instead of installing Smart File Examiner opens and step 1 sleect file and this is were is went /Users/user/Library/Caches/TemporaryItems/3114AutoUpdate Installer.mpkg. Then it says information gathered successfully. step 2 click show information button. so I do and and the info on it opens in a new page, but it does not do anything else. So how do i finsh installing the update?

    Downloading as we speak, and the first explanation that comes to mind is that both files have a .rar extension, and that since OS X doesn't support this archive format, you need to install a third-party utility to open them.
    One files tool to open .rar files is The Unarchiver (here), and another is Stuffit Expander (there). 7zip also proposes a Mac version (here). All three will decompress a .rar file, and let you access the .dmg file(s) inside.
    Also, depending on the browser you're using, and provided you might be inclined to open trusted files directly (I use Opera, and seldom save safe download; I click on "Open" in the download dialogue), your files could very well open... in the browser cache folder, out of sight. But if you use Safari, Chrome or Firefox, and you don't have any utility installed to handle .rar files, that's doubtful. I'm going to open your files now, and check if I can install them.
    Stay tuned!
    Edit: decompressing the first file using The Unarchiver shows that the archive is "incomplete". Which leads me to think that you might have to concatenate the two files to make one "complete" .dmg file.
    If so, once they are decompressed, open a Terminal (in Applications/Utility), then type "cat", and drag both files in the window, one after the other (preferably in the right order...), type a space, then give the final file any name you want, followed by the .dmg file extension:
    (e.g.:) "cat /Users/Your_Name/Desktop/File1.dmg /Users/Your_Name/File2.dmg /Users/Your_Name/Desktop/FinalFile.dmg"

  • HT5429 when will a major update for maps be released? i'm sick of not being able to navigate at all

    when will a major update for maps be released? i'm sick of not being able to navigate at all

    This is a user forum. No one here would have an answer for that.

  • Just downloaded Yosemite on my Mac and the Yosemite update for Garage Band.  Now when I open an existing Garage Band project and click on a vocal track, a message window says, "Could not find General Audio 10" and have no smart controls.  Help?

    Just downloaded Yosemite on my Mac and the Yosemite update for Garage Band.  Now when I open an existing Garage Band project and click on a vocal track, a message window says, "Could not find General Audio 10" and have no smart controls for that track (reverb, etc.)  Help?

    Try this fix posted by Robinson Collins:
    Re: I downloaded Garage Band 2x and the same note appears: there is no General Audio 10. Please advise. Thank you.
    Try this: Go to your menu bar, select "Garageband" and then "Restore Sound Library..."
    It can take awhile to download as it's a pretty big library. You might need to also select "Update Sound Library..." after the restore is done.

Maybe you are looking for