Refresh has effect on clone but not on object itself

Hi,
(Using TopLink 9.0.3 with an Oracle Database)
I see some mystifying behaviour when I insert an object, refresh it because I know the database performs some changes on the data during insert from a database trigger and then inspect the refreshed object.
In short my code is as follows:
UnitOfWork unitOfWork = session.acquireUnitOfWork();
Vak vak = new Vak();
unitOfWork.registerNewObject(vak);
vak.setTitle("New Title");
unitOfWork.commit();
// the database will turn the Title to all UpperCase
session.refreshObject(vak);
// the following call prints out: New Title
// !!! not in uppercase!!
System.out.println(vak.getTitel());
unitOfWork = session.acquireUnitOfWork();
Vak vakClone = (Vak)unitOfWork.registerObject(vak);
// the following call prints out: NEWTITLE
// !!! Now it is in uppercase!!
System.out.println(vakClone.getTitel());
vakClone.setTitel("++"+vakClone.getTitel());
unitOfWork.commit();
Can someone explain this behavior? Why does the refresh have an effect on the clone of vak but not on vak itself? Is it because vak is newly created in this piece of code?
How can I ensure that the vak object itself has the changes made in the database?
thanks for your help,
Lucas Jellema (AMIS)

The problem is that registerNewObject has semantics beyond the obvious use of registering new objects.... Time for me to lobby for a name change :)
Search this forum for "registerNewObject" and I think you'll see some rants from me on this topic. Ultimately, in your first example in your first post, if you had just done "registerObject" instead of registerNewObject, everthing would have behaved as you hoped.
You do NOT have to use registerNewObject for new objects... registerObject is preffered.
Send me an email, donald.smith @ oracle.com and I have a UOW primer I can send (it's being incorporated into the docs for an upcoming release), but it will help clarify this in the meantime.
- Don

Similar Messages

  • If my  ipod nano already has music on it but not my account will all my stuff be lost when i sync it to my account

    if my ipod nano already has music on it but not on my new account will all my stuff be lost when i sync it to my new accont and would i still be able to add stuff from the old account to my ipod

    All your iTunes Store purchases are linked to the account.  I do not think you can use two accounts with an iPod*, so you will have to choose one account or the other, and use only the things purchased under that account.
    *I've never actually tried, but that's my understanding.  You'd get a better answer by posting in the correct forum.  Try the iPod forums rather than the Using Apple Support Communities forum.

  • Constant Error; Adobe Flash Player 11.4 r402 has stopped working. But NOT running Trusteer Rapport.

    I am experiancing this unbelieveably annoying and constant Flash error;  Adobe Flash Player 11.4 r402 has stopped working.
    But NOT running Trusteer Rapport, I never have, and it's not even installed on my computer.  So what's causing this?

    There were a couple AntiVirus/AntiMalware products that keep coming up, but I haven't validated that in the lab and don't want to call anyone out publicly without reporting the issue to them first.

If you could tell me what antivirus/antimalware products and versions you have installed, that would be helpful.
    So, third party stuff aside, I'd like to know more about the crashes your seeing:
    1.) Please provide links to the Firefox crash reports.  If you have multiples, the first few would be great.
         In Firefox, type about:crashes in the address bar
         If the link starts with "bp...", it's already been submitted -- just right-click on it and copy the link, and paste it into the reply here.
         If not, click it to submit it, and copy the subsequent link.
    2.) In firefox, type about:support
         Just copy and paste the output into the reply.
    3.) In Firefox, type about:plugins
         Please copy and paste the output into the reply
    4.) Please provide the output of the DirectX Diagnostic Utility
         Click Start > type "dxdiag" [enter]
         Click Save All Information
         Copy the output of the file into the reply, or use Adobe SendNow/DropBox/PasteBin to share the file.
    5.) If you can provide an exact URL and step-by-step instructions on repeating the crash (if it's consistent), that would be really helpful.  My goal is to build out a configuration that matches yours as closely as possible, reproduce the problem and then debug it.
    If you're not comfortable sharing that diagnostic information publicly, send me a private message.  Just click my name and use the options on the right.
    Thanks!

  • Every photo has a blue sting but not in the level view. What must I do to change this? In other programms the pictures are shown right.

    Every photo has a blue sting but not in the level view. What must I do to change this? In other programms the pictures are shown right.

    Open the PSE Editor, not the Organizer.
    Enhance>Adjust Color>Remove Color Cast
    If that does not fix it, you can post a picture here on the forum so that we may provide additional suggestions. To do that, use the camera icon at the top of the reply box.

  • 2nd week running, I received an e-mail saying a new episode of Breaking Bad is available.  When I go to download its the "Inside Breaking Bad" short (which gives away spoilers - thanks Apple!) but not the episode itself.  What gives?

    2nd week running, I received an e-mail saying a new episode of Breaking Bad is available.  When I go to download its the "Inside Breaking Bad" short (which gives away spoilers - thanks Apple!) but not the episode itself.  What gives?
    I've tried this on multiple products so I believe its specific to iTunes not a particular device.

    Same thing here- Get the email but nothing but the Inside featurette. It's really annoying. In fact I can't even download it normally using the check for available downloads feature! Every time I do that iTunes tries to download doubles of three Walking Dead episodes I've already downloaded. I don't want what I already have, I just want the new episode.

  • ITunes opens but without any text showing.  Drop down menus have text but not the app itself. I have a Mac Powerbook Pro running Windows XP under Boot Camp.

    Running under Windows XP,  a few upgrades ago iTunes started opening without any text showing in the application.  Clicking on PLAY will play music but no text shows to indicate what's playing and no text to show music library. Drop down windows show text but not the app itself.
    Subsequent upgrades and reinstalls have not corrected the problem, When I run under iOS (Snow Leopard), iTunes opens with text and runs correctly.
    Help!

    Because I created FAT32 partition using Boot Camp tool few days ago I installed my custom copy of Windows XP with SP3, IE7 and WMP10 integrated using nLite (for WMP10 integration use RVM Integrator). I did not use Boot Camp tool this time - I just booted CD using Option key. Then I installed Boot Camp 2.0 drivers you can find on Mac Disk 1. After this I installed Boot Camp drivers 2.1 update. In Add or remove Programs I checked drivers - I uninstalled old drivers which call identical, but you can skip this. Everything works fine BTW it is better to format your partition to NTFS - you have much less disk errors, you do not waste time for disk errors scans during Windows startup, your data are much more safe. If you need NTFS write permissions use great tool Paragon NTFS for Mac OSX or open source NTFS driver.
    Message was edited by: limo79

  • Document library: user can see the metadata but not the file itself

    Hello,
    For a specific document library certain users will have the right to see the metadata but not the file itself. The only solution I can  think of is using a http handler. But I don't know if I can get the user that requests the document.
    Are there any other approaches to this requirement?
    Can I get the username of the user that makes that request?
    I guess that http handler is deployed at the Web application level - am I right?
    Thank you
    Christos

    Nicolas, thank you for your answer.
    I think this this is not a strong protection. Everybody can istall sp designer or go through UNC path, like \\myserver\documentlibray or \\myserver\lists\mylist and see the documents- and we use unc paths a lot. I don't want to get into trouble when a (wiki)
    leak is made.
    Christos

  • Show counts where an account has a code(s) but not other code(s) on it

    Hi I'm fairly new to PowerPivot so I'm sure one of the experts has a good answer for this.
    We have customer accounts that have service codes attached to them…i.e customer 123 could have service code 1,2,3,4,5 etc..
    What I want to do is show counts where a customer has service code(s) but doesn't have other code(s).
    For example, maybe I want to show how many active customers have service code 1 but don't have service code 4 and 5.
    Is there a simple way I can do this?
    Also I want to create this to allow for the user to choose which codes to select to compare.
    I tried using slicers but that doesn’t seem like an option.
    This should be easy to figure out I would think but I’m struggling.
    Anyone have a recommendation to point me in the right direction?
    Thanks

    Apologies, I do not have a copy of 2010 on my computer, but here are all of the formulae:
    IncludeCount:=CALCULATE(
        COUNTROWS( VALUES( CustomerCodes[customer] ) )
        , USERELATIONSHIP( CustomerCodes[service code], IncludeCode[Include] )
    ExcludeCount:=CALCULATE( 
        COUNTROWS( VALUES( CustomerCodes[customer] ) )
        , USERELATIONSHIP( CustomerCodes[service code], ExcludeCode[Exclude] )
    Include1:=IF( [IncludeCount] - [ExcludeCount] > 0, 1, 0 )
    CustomerCount:=SUMX(
        VALUES( CustomerCodes[customer] )
        , [Include1]
    And here are the tables I've got:
    CustomerCodes:
    customer
    service code
    1
    1
    1
    2
    1
    3
    1
    4
    2
    1
    2
    3
    3
    4
    3
    5
    3
    6
    4
    6
    IncludeCode
    Include
    1
    2
    3
    4
    5
    6
    ExcludeCode
    Exclude
    1
    2
    3
    4
    5
    6
    Relationships
    Active
    Table
    Related Lookup Table
    No
    CustomerCodes [service code]
    IncludeCode [Include]
    No
    CustomerCodes [service code]
    ExcludeCode [Exclude]
    This should be everything you need to recreate exactly what I've done and then apply it to your model.

  • Rendered clips play in After Effects and Premier, but not in Speedgrade

    Hi,
    I am very new to the world of Speedgrade, and have started running some tests, but hit a brick wall right at the get go. I have an After Effects project, that has a few layers, some are filmed footage, some are photoshop images etc. there are also a few plugins used (Lens Flare, Particulare etc). I render this comp out to two outputs, 1 - Quicktime JPEG2000 Intermediate (Highest quality settings) and 2 - Quicktime DNxHD Proxy (Lowest quality settings). I can import and play bot these exports in After effects and Premier, but when I take them to Speedgrade, I dont get playback.
    Here are screenshots:
    After Effects footage settings:
    Visual of the smoke in After Effects of the imported render:
    The same file imported into sSpeedGrade:
    Is this something that can easily be explained? 
    Any advice would be appreciated.
    Pierre Devereux

    Hi Joost,
    Thjank you for your feedback. I have submitted a bug-report as you suggested. I will find another workaround for now, probably doing most needed colour work in After Effects directly for now.
    Thank you
    PIerre Devereux

  • Aperture has stopped showing some, but not all, keywords on photos

    I imported some new photos today and noticed that Aperture seems to have stopped displaying some, but not all, of my keywords. I'm noticing this on a large number of my existing photos.
    For example, I've selected a photo and the Keywords tab of the Metadata pane lists: Amanda, iPhoto Original, Judy, and Zoo. That appears to be correct. However, the Keywords field in the top of the Metadata pane only shows iPhoto Original, and the only keyword displayed in the grid view is iPhoto Original.
    Switching to a different metadata display does not help, nor does rebuilding the library. Reassigning the keywords seems to help, but that's not really an option for > 7,000 photos.
    Anyone know why this is happening? Can I fix this?
    Dave
    PowerMac Dual G5 2.0   Mac OS X (10.4.7)   Aperture 1.1.2

    After poking around with BBEdit in my Aperture library, I think I see the problem. I chose a photo that Aperture won't display all the keywords and re-added them. I then compared all the files in the library for that photo with the same files in a backup library I had set aside.
    It appears that at some point Aperture got the IPTC keywords out of sync with the actual keywords on the photos. Looking at the Version-1.apversion file (which is actually a .plist file), I can see that both copies have the same keywords on them (called tags in the plist), but the IPTCProperties.keywords summary does not reflect all the tags actually on the photo. Aperture appears to just display the keywords stored in the IPTC keyword summary instead of checking to see what keywords the photo actually has.
    So, the keywords are still there, but the summary that Aperture displays is wrong and a library rebuild doesn't appear to rebuild the keyword summary.
    My options at this point appear to be either re-apply all my keywords or write a tool to fix it for me (I guess being a developer has it's perks). I'll definitely be filing a bug on this...

  • After editing i can hear effects over tracks but not the tracks themselves?

    after editing and saving as a garage band file i can hear the first two tracks in their entirety, but not the other 8 (except for the reverb over them). if i kill the reverb over these tracks then only silence remains. input, output and monitoring options are identical for all ten tracks. all my edits are still there, including automated volume and pan. please help

    Hello, I am having the same problem. With some exceptions (and this is what's throwing me off) I can hear reverb and echo on tracks but not tracks themselves. I have tried adding echo/reverb to some of the muted tracks and I can hear these effects fine. Yet I have 2 tracks without any effects at all and I can hear those ones fine (there are 12 tracks in all). Any help would be greatly appreciated as this is my senior project and I am due to present on Thursday, June 5.

  • Adding pages, lost everything in iweb but not on web itself,

    Okay, so I am new, did the tutorial to set up a web site. Had four pages finished, three already published, did not publish the fourth. I then went to add a photo page and all other pages are gone on the iweb building area. The first three pages are on the web, but not listed in the site organizer. Now what do I do to save the pages on the web when I publish and to return the web pages to my site organizer. yikes!! I spent hours on this project and am worried I will lose it all. thanks

    Go to Varkgirl's site and download her Automator backup application. It creates a copy of the Domain.sites file and puts it where you want. A smart thing to do after any session with iWeb.
    Also if you expect to have multiple sites you might think about using iWebSites. It's to iWeb as iPhoto Library Manager is to iPhoto.
    I use iWebSites to manage multiple sites.. It lets me create multiple sites and multiple domain files.
    If you have multiple sites in one domain file here's the workflow I used to split them into individual site files with iWebSites. Be sure to make a backup copy of your Domain.sites files before starting the splitting process.
    This lets me edit several sites and only republish the one I want.

  • When do we override our own clone method not the Object class clone method

    Hi,
    I have a confusion in overriding clone method.We can create clone object by writing Object.clone() but some times I have seen writing our own clone method ,when do we write this,also clone() is defined protected and when we write our own clone it is said to write it public,why?
    Thanks
    Sumit

    protected methods can only be called in the same class and it subclass. You can make clone protected if this is all you need.
    However if you need to clone() the object from another class, it need to be public.
    This is the same for any method.
    Also as Object.clone() is protected you cannot make it private or package-local (this is true of any protected method)

  • Data refreshed when preview in XLF but not refreshed in exported SWF

    Hi,,
    I have an XML file linked to Exel which is the source of an XLF file. All connections are OK and I am able to see the latest data are being refreshed when I preview the XLF file.But when I exported the XLF file to SWF file, the error 2048 occured and the data is not refreshed at all.
    I have put the SWF file in the Global Security Settings Panel (Always Allow list) and also checked the Every Time I visit the webpage under the Temporary Internet Files and History Settings.
    Anything else I need to do..can someone help?

    Hi
    Error 2048 is usually caused by two main reasons.
    One -  the global security settings are not set to allow files from the desired folder to be accessed.  Check that you have added the source folder(s) for your data to the list "allows trust files in this location" under Adobe's online settings manager.
    Two - you're trying to access a file on a domain that is different from the one you're running the swf file on. For this you need a crossdomain file added to the root folder of the server you're trying to access.
    So your crossdomain.xml should look like this
    <?xml version="1.0"?>
    <!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
    <cross-domain-policy>
    <allow-http-request-headers-from domain="" headers="" secure="false" />
    <allow-access-from domain="*" secure="false" />
    </cross-domain-policy>
    For more information, search other posts on this topic or please check out  the Adobe website.
    Andy
    Xcelsius QA

  • My iTunes has about 3000 tracks but not all of it will sync onto my iPod

    i recently purchased an 80GB iPod shuffle which can also play videos and movies. i bought it recently, but i'm haveing a hard time getting used to iTunes and all this apple, mac business.
    i have windows XP professional, i made sure i put all the music i had on my pc and put it onto my iTunes library, now i have a lot more music to put onto my ipod from cds etc but i can't even get all my music from my itunes to download onto my iPod first!
    they're all in mp3 format, and when i go to "sync music" instead of syncing all of my 3000 tracks its only syncing like 1700 or so!
    also, if i already have music on my ipod, but i just want to add say an extra one or two songs onto my ipod, i tried just adding those tracks, but then all my older songs already on the ipod god deleted!
    does that mean i have to download all my music from the itunes ALL OVER AGAIN?
    if so, i don't think i like this ipod / itunes business, i may even have to return it. this is just ridiculous, i never had this problem with my smaller mp3 players. the whole reason i bought the iPod was because it can store alot of music, 80gb and it only cost me around £140. its new, not second hand or anything.
    help!

    Hello, and Welcome to Apple Discussions,
    first of all, I don't think you have a shuffle, as they come up to 4 GB.
    Syncing is a concept that some users have a hard time adjusting to - it means synchronizing the content of the iPod to your PC.
    When you tell iPod to sync only two songs, it does exactly that; you may want to set up playlists in iTunes that contain what you want on your iPod and sync those automatically.
    Another option would be to Manually Manage your iPod, in which case you can just drag and drop songs on it like you would with any other MP3 Player, however, you lose the convenience of syncing.
    Hope this solves your problem, cheers.

Maybe you are looking for