ReadObjectQuery acts like a gambling machine

Hi there,
I figured out that a ReadObjectQuery acts like a gambling machine, when the underlying TopLink expression and SQL statement respectively, selects more than one row. In this case the ReadObjectQuery does not throw an exception and returns some object of the result set.
How can I force the ReadObjectQuery throwing an exception, if the result set has more than one object?
Thanks,
Leif Jakobsmeier

Leif,
There is an event on SessionEventListener that will notify you when a ReadObjectQuery returns more then one row.
http://download-west.oracle.com/docs/cd/B10464_01/web.904/b10491/oracle/toplink/sessions/SessionEventListener.html#moreRowsDetected(oracle.toplink.sessions.SessionEvent)
You can have your own exception thrown my simply implementing and registering an event listener to handle this.
Example:
session.getEventManager().addListener(new SessionEventAdapter() {
     public void moreRowsDetected(SessionEvent event) {
throw new RuntimeException("More then one row returned from ReadObjectQuery");
Doug

Similar Messages

  • Does "changing of fonts" act like a state-machine?

    hi all,
    in the past...i changed the font of a JComponent one at a time...i'm just wondering if changing fonts in Swing would be something like changing colours in OpenGL...
    for example:
    setColor(0, 0, 1);
    drawRectangle();
    drawCircle();
    setColor(0, 1, 0);
    drawTriangle();
    in the above...the rectangle and circle would be drawn with colour(0, 0, 1) but the triangle would be in colour(0, 1, 0)...
    how about in Swing GUI...can i specify the font just a line above each time i want the JComponent be in a different font?
    and is there a way to specify a font for the entire JPanel and all the JComponents it is containing?
    thank you very much!

    Well, the setFont() call should probably act in the way you describe, but I find it doesn't always.
    Particularly when you're using JMenuBars or applets, I find it important to set the font on each
    component individually.
    Also, it's pretty easy to set the font on a panel and everything underneath it...
    public void setFontRecursive(Container c, Font f) {
        c.setFont(f);
        Component[] children = c.getComponents();
        if (children != null) {
            for (int i=0; i < children.length; i++) {
                if (children[i] instanceof Container) {
                    setFontRecursive(children, f);
    } else {
    children[i].setFont(f);
    Bear in mind that this method will work for anything that extends Container (including Panel).
    Hope that helps!
    Martin Hughes

  • Help! iTunes is making my iMac act like a Windows machine!

    Here is the basic problem:
    Some songs will not play properly in iTunes, pausing often and causing the spinning beach ball of death to freeze my iMac for 5 to 10 minutes at a time, sometimes longer. I am also having problems ripping those songs to a CD.
    I am trying to decide if I should uninstall iTunes or simply back everything up and do a clean install of Snow Leopard and iTunes.
    I’m also wondering if simply getting more RAM would solve my woes. I have 2GB, which worked well for years. I have 4GB coming in the mail.
    I have a 2008 iMac. It has about 175GB of free space on its hard drive, about 144 GB in use. With iTunes playing a file and nothing of particular note open, it has just under 1GB of free system memory, or RAM. I have both the latest version of Snow Leopard and iTunes installed. All software is up to date. Except, of course, that I'm not running Lion.
    I have a 45GB in music and 54GB in podcasts in my iTunes library.
    I have corrected my hard drive’s permissions repeatedly but am unaware of any other maintenance I should be doing on my hard drive.
    Here are some observations that may or may not be helpful:
    Songs in the same folder are behaving differently, some consistently playing without a problem, others consistently spinning the beach ball.  For example, five songs off an album will freeze up my iMac but the album’s other songs do not.
    I can, however, duplicate the symptoms with otherwise dependable songs by having more applications open. Nothing major, say Safari, Finder and iTunes. What I don’t get is why some songs would play well and others not when only iTunes is open.
    Having a handful of applications open now sometimes prompts the spinning beach ball of death. This never used to happen, hence the RAM coming in the mail.
    When I check information on the malfunctioning music files, it shows they contain data, but I start getting the beach ball checking  the file’s “sharing & permissions” status in "Get Info."
    Interestingly, I recently had to stop backing up my podcasts in Time Machine because some of them were crashing it. My music files, however, have been backing up fine in Time Machine, so far.
    Also, when I try to copy my music files onto an external drive or my desk top – in anticipation of reinstalling iTunes -- my iMac cites error 36 and stops the process.
    My iMac’s performace problems started to occur before I finally updated to Snow Leopard a few months ago. Indeed, I thought updating would solve them.
    I had been regularly updating iTunes, however, I recall reading somewhere that upgrading to Snow Leopard while having an up-to-date iTunes installed might cause problems.
    There you have it. Any advice or insights would he most welcome.

    Well, I seem to have solved my own problem. Do I get 10 points, I wonder? It appears that my poor iMac was in desperate need of a masssive cleaning. Thanks to other posts here and elsewhere, I found out about Cocktail, a free download -- unless you chip in for the more advanced version. This is a powerful and easy to understand tool. I used it to perk my iMac up to a level I have not seen in a LONG time. The spinning beach ball of death must go play elsewhere.  Among other things, I cleared out all my caches, eliminated a ton of foreign languages and did several repairs, including tracking down and killing a corrupted permission. It also taught me how to tap into my computer's activity logs and gave me other useful insights. GOOD stuff. I did other things not related to Cocktail to free up processing power -- such as turning off file- size view option in Finder -- but Cocktail is what solved this problem. As I type this, I am happily listening to songs that earlier would not play. What a relief. I am now especially looking forward to that new RAM. We'll be blazing fast then, by gum.

  • Computer Acts Like I Let the Battery Run Down

    When I put my MacBook Pro to sleep OR leave it to go to sleep on its own, often (but not always) it acts like I ran the battery down - in other words, I get the start-up sound (not the music but the little electronic movement sound) and the greyed screen with the line of white ovals at the center bottom which count up as the computer wakes itself up.
    This problem began soon after I got my MacBook (almost 2 years) and has gotten worse. It used to be only occassional and was, of course, hard to replicate on demand. Now it's very often. (Every other day?) I took it into the MacStore before the year support was up and the girl looked at all sorts of stuff but couldn't find the problem. She made a few setting adjustments or whatever and said to see if it got better and, if not, to spend some time taking notes to see if I could better localize when it happens and if I still found nothing than to reinstall the OS X.
    It was a little better for a bit it seemed, but built up to being more common again. It defintely happens when I use the computer on battery if I let it run down to anywhere about 23% or lower. But it also happens (often) when it's plugged in at my desk and I put it on sleep for the night, so at full battery.
    Eventually I rebuilt without erasing, then - when still no improvement - I did a full erase and reinstall from Time Machine back-up (in case there's an answer there). I also upgraded to Mavericks. The problem was totally unaffected by the rebuilds or the upgrade. I have looked again at energy saving and see nothing unusual in my options. (Battery: Display to sleep after 5 minutes, computer to sleep after 10. Put hard disk to sleep when possible. Power adaptor: the same setting except 10min and 10 minutes.)
    Any idea what the heck is going on?

    Hi RobRZ -
    So first of all, sorry for dragging my feet on doing this. I saw all the article chat about changing setting in terminal and presumed I was going to go in there and end up changing something. But in the end I jsut put in the first command ot check the hibernation mode and, well, it says "hibernate 3" - safe sleep.
    So, that would indicate that my computer is already, according to Terminal, programmed to do something different than what it's actually doing. Right?
    If it's a clue to what's happening: I tried soemthing different (again?I'm sure I'd done this before but didn't get consistent results) the last few days, unplugging my computer before I go to bed. Once it made the "electronic movement" (harddrive?) sound when I unplugged it, but woke right up in the morning. The last 2-3 nights I have unplugged it, to no computer noises, and it woke up just fine in the morning.
    So, running the battery to below 20% causes it and, perhaps, leaving it plugged in when it's fully charged causes it?

  • HT5161 My Mac wont except dvds or cds. It doesnt even make any noise it acts like a dvd is already in there, but there isnt, please help?

    My Mac wont except dvds or cds. It doesnt even make any noise it acts like a dvd is already in there, but there isnt, please help?

    When you push one in, what happens? Whir and spit out? Can't put one in? Which machine? Details please. If the SuperDrive is empty, then Zap the PRAM and Reset the SMC and try inserting a disc again.

  • I connected an external monitor to my MacBook Pro, but it doesn't open any programs. It Just sits there with a blank screen.  How do I get it to open programs and act like a monitor?

    I connected an external monitor to my MacBook Pro, but it doesn't open any programs. It Just sits there with a blank screen.  How do I get it to open programs and act like a monitor?

    Dear Jean:
    It sounds like you are trying to get your external monitor to act as the primary viewing screen. For example it would have your Doc, Icons, Etc. In order to make the external monitor the primary screen you have to:
    Open System Preferences.
    Choose the Displays Icon
    There will be several tabs to choose from pick Arrangement
    Drag the toolbar to desired display
    Let me know if this helps at all!
    Lance

  • I have a Yahoo search bar acting like an App tab that I can't get rid of. There is no option to unpin when I right click on it.

    I have a yahoo search bar which was installed during a download and installation of SIW.exe a system information application from http://gtopala.com/. It was the freeware version which is add based software. However I didn't expect that the search function would be such a nusance and interfere with Firefox's functions.
    The search bar is acting like a App tab that I can't move or get rid of. Ther is no option to unpin the object when I right click on the bar or to change it in any way using the 'group your tab' function to the right of the tab tool bar.

    Reply: Cor-el > Excellent!! Thank You. In Tools, Add Ons, Extensions there was a Default Tab enntry which was the culprit. Am running W7 so the XP Tools, Options, Advanced , Use Hardware acceleration when available, wasn't of much help here, however I did fix a problem on another computer running XP with that same fix. Thank You very much! HD

  • I am having a problem. When I click on the Mobile Facebook icon it acts like it is going to start opening then it quits and goes back to the icon. So I can't use Facebook on my iPhone 4

    I am having a problem. When I click on the Mobile Facebook icon it acts like it is going to start opening then it quits and goes back to the icon. So I can't use Facebook on my iPhone 4

    Force quit the application and try again.
    Try a reset or restart of the device, trying the app after each step.

  • Is there a way to make the NAS200 act like a drive in my computer

    Not sure if this has been discussed here yet.
    I have a NAS200 connected to my router and I can access through my web browser no problem.
    I was wondering if there's a way to make it act like a drive that's in my computer. i.e give it a drive letter and have it show up in the "my computer" area.
    I am running win 8 pro desktop hard wired to the router with the nas200 connected. Is there a way to "mount" the nas200 as drive on the computer.
    Thanks,
    Bob
    Solved!
    Go to Solution.

    Yes, you just need to map the drive on your computer. You need to make sure first that the network drive is detected in the network. You can click on the following link to know how to map the drive:
    How to create a shortcut to map a network drive

  • I'm Just wondering how to make drum beats in garage band using the sounds it comes with? Also how can i use garage band like a drum machine which i can program an entire song part by part????

    I'm new to using Garageband and loops with garage band. I just wanted to see if there was a way for me to use the drum sounds provided in garageband to create my own original drum tracks and work with it like a drum machine that i can program an entire song into... any info or tutorials would be a great help.. Thanks!!!

    Ah ok, I have a better idea of what you want to do now. 
    Unfortunately there isn't anything inside GB that can come anywhere close to Acoustica Beatcraft, but there are two tools inside Garageband that can help you do something similar. 
    First are the built-in keyboards, which will enable you to trigger drum samples with your computer keyboard or mouse.  Go to Window -> Keyboard or Window -> Musical Typing.  Click with your mouse on the Keyboard or press keys on your computer keyboard with Musical Typing, and you will trigger different drum samples for whatever kit you've chosen for that software track.
    Next is the Track Editor: in Piano Roll mode, you can create and see midi notes somewhat similar to the view in this screenshot from AB.  On the left side of the Editor, you will see a sideways piano keyboard.  When you assign a drum kit to a software track, each of the piano keys corresponds to a different instrument: hi hat, snare, bass drum, etc---you'll have to play them using the on-screen keyboard or musical typing to see what they correspond to.   In order to add a MIDI note you hold the CMD button and click with the mouse. 
    So, if you wanted to add a closed hi-hat hit, you would CMD-click on the Track Editor row corresponding to the closed hi-hat piano key, and then you can drag the MIDI note left & right to change the beat it plays on, or resize the note, which will change its duration.
    Or, as you've already observed, you can use Musical Typing to play out a pattern on your computer keyboard while recording, and you will see the midi notes appear in real time in the Track Editor.
    Hope this helps, feel free to ask more questions.

  • Mobile account setup stops syncing and acts like a network user

    Mobile account setup stops syncing and acts like a network user system under ODM
    Setup: Mobile laptop users authenticating against an ODM. Every user has a networked home directory on an Xserve. The whole setup is 10.4 (client and server). All systems run a standard image. Most effected systems have been re-imaged since the onset of the issue.
    Issue: Some of the users are not syncing properly every time. It is as if the system forgets it is a mobile system and reverts to using the User's network home (instead of saving to /Users and syncing). If the user is effected, the system will not even accept cached credentials if they are off network. This forgetfulness does not seem to follow any pattern and does not effect all of our mobile users.
    In mucking about trying to find a cause to this issue I ran across an oddity in all effected systems Netinfo database. The users are each listed twice. Each entry has the same username, short name and UID. Also, In each case one record looks wrong... this varies somewhat from user to user, but in each case there is marked difference in the record's contents. Deleting the incomplete record in Netinfo manager seems to solve the issue (seems, as we are very early in testing this).
    Anyone have a clues as to where this double came from? The only lead so far is that it looks like the users having issues pre-date the use of mobile accounts. At some time they all had local accounts that authenticated against the ODM but never synced or had networked home directories. The pool of users who just got laptops (and thus never had a local account) seem unaffected so far.
    Also, what is the best way to browse the ODM master to find these duplicates?

    I have a similar issue with computers bound to Active Directory. Users occasionally have a problem logging into their computers even though their account is fine. Logging in as Admin and running netinfo manager always shows duplicate user accounts. Deleting the one that says disabled always clears up the issue. I'd like to find a startup script that would delete the disabled account, thus preventing the issue.

  • How do I return functionality of my bookmarks menu before Firefox update 23.0.1? I don't LIKE internet explorer, now my firefox is acting like IE; gee thanks.

    How can I restore the functionality of the Bookmarks shortcut. I DO NOT LIKE internet explorer, it is cumbersome and slow. How can I modify the bookmarks shortcut to act like a menu again? I do not like the bookmarks and history pop-out... Firefox was above the bar, now I have 2 copies of internet explorer on my computer, one with an icon that looks like an E and one that looks like my old firefox browser.... This was a result of the update 23.0.1 this morning, it was perfect when I went to bed last night.... Maybe I should use Chrome?

    does it work as expected when you launch firefox in safe mode once (to rule out the interfering of any addons)?
    [[Troubleshoot extensions, themes and hardware acceleration issues to solve common Firefox problems]]

  • Yesterday iTunes worked - today, it acts like it's newly installed (won't show any of my music or playlists) - what could have made it forget everything it knew yesterday and how can I fix it without having to redo all my previous work?

    The title says it all.  iTunes was working fine last night.  I added some more music to my playlists and synched my iPod last night, then shut down.  Today, when I start iTunes it opens up a welcome to setup screen and acts like it wants me to answer questions to configure it for the first time.  When I cancel out of that, it opens up a normal iTunes screen that's completely empty of music and has none of my custom playlists (all the playlists it does show are empty) and it's asking me if I want to have it search my PC and add media files, as if it's newly installed and that's never been done.
    Has anybody seen this behavior before, and is there some simple way I can fix it so it remembers all the stuff it knew last night, without having to start all over again and rebuild all my playlists and stuff?

    For general library squiffiness following an upgrade the easiest thing is to restore your last backup, but I guess if it were that simple you wouldn't be here.
    Empty/corrupt library after upgrade/crash
    Hopefully it's not been too long since you last upgraded iTunes, in fact if you get an empty/incomplete library immediately after upgrading then with the following steps you shouldn't lose a thing or need to do any further housekeeping. In the Previous iTunes Libraries folder should be a number of dated iTunes Library files. Take the most recent of these and copy it into the iTunes folder. Rename iTunes Library.itl as iTunes Library (Corrupt).itl and then rename the restored file as iTunes Library.itl. Start iTunes. Should all be good, bar any recent additions to or deletions from your library.
    See iTunes Folder Watch for a tool to catch up with any changes since the backup file was created.
    When you get it all working make a backup!
    tt2

  • My iPhone 4s acts like I need to plug in to iTunes and I got an error message saying it failed to download update and now the screen won't go away. USB port end on phone with arrow pointing to iTunes...

    My iPhone 4s acts like I need to plug in to iTunes and I got an error message saying it failed to download update and now the screen won't go away. USB port end on phone with arrow pointing to iTunes...

    Now iTunes will not recognize my phone as a device...

  • My desktop disappeared. When the computer starts, it opens in finder. Also, it acts like something is running. The spinning circle is spinning, will stop for a minute then starts again. What is wrong? Help please.

    My Mac g5 starts and goes to finder. The desktop has disappeared. Also the circle keeps spinning. It will stop for a minute, then start again. It acts like something is running. I have restarted multiple times. Can anyone help please? Thank you.

    Spinning Beach Ball
    Spinning Beach ball (2)

Maybe you are looking for

  • Buttons in dreamweaver

    Hello! I wonder if anyone could help me with my navigations buttons... I am trying to create buttons with images I have created with photoshop in a way that tthey behave like this: "up" stage with one image, the "over" stage with another image and I

  • Wireless on a beige G3 OS9

    Up until now the wireless era has passed me by on my 56k (in practice 28k) modem. Now the city where I live it talking about installing wireless on telephone polls, accessible for a subscription of $20. I have a G3 beige and my girlfriend has a G3 iM

  • Final Cut keeps crashing on startup!!!

    Trying to use FCP Studio on 1.67 powerbook. whenever I launch the program it crashes on startup. I remember a little application program that you can download to stop this but I can't remember what it was. Any ideas???? Thanks

  • SUS-MM Lanscape with SRM 5.0 as an Add-on with ECC6.0

    All- We are implementing SRM 5.0 as an add on with ECC 6.0. We are aware of all the constraints and those constraints do not matter within our scope. The open question that we have is that if SRM is installed as an Add on with ECC. Can we also levera

  • HT201272 cannot dowload message appears when tried to download tv episode from iCloud

    trying to download tv episodes to device but 'cannot download' message appears when tried to. what can I do?