Read from 2 tables, write only to one. Simple, but impossible??

I've been messing about with various annotations for quite a while now, and I can't seem to figure out how to accomplish this seemingly simple task. I'm hoping somebody could explain to me the probably very obvious and simple mistake that I am making.
I realize that question would otherwise point to problems in my database design and persistence strategy, but I can't seem to read from 2 tables, and write to only one. I have an entity bean that refers mainly to one table, but needs just one column of information from another table. It should not attempt to alter the secondary table, just join on it to get the one field it needs. So far, I've got the following:
@Entity
@Table(name = "ventureprofile")
@SecondaryTable(name = "venture",
                pkJoinColumns = @PrimaryKeyJoinColumn(name="ventureid"))
@NamedQueries( {
        @NamedQuery(name = "Ventureprofile.findByVentureprofileid", query = "SELECT v FROM Ventureprofile v WHERE v.ventureprofileid = :ventureprofileid"),
        @NamedQuery(name = "Ventureprofile.findByVentureid", query = "SELECT v FROM Ventureprofile v WHERE v.ventureid = :ventureid"),
        @NamedQuery(name = "Ventureprofile.findByVenturesummary", query = "SELECT v FROM Ventureprofile v WHERE v.venturesummary = :venturesummary"),
        @NamedQuery(name = "Ventureprofile.findByLogoimagelocation", query = "SELECT v FROM Ventureprofile v WHERE v.logoimagelocation = :logoimagelocation"),
        @NamedQuery(name = "Ventureprofile.findByVisible", query = "SELECT v FROM Ventureprofile v WHERE v.visible = :visible ORDER BY v.venturename")
public class Ventureprofile implements Serializable {
    @Id
    @GeneratedValue(strategy=GenerationType.AUTO, generator="Ventureprofile.ventureprofileid.seq")
    @SequenceGenerator(name="Ventureprofile.ventureprofileid.seq", sequenceName="ventureprofile_ventureprofileid_seq", allocationSize=1) 
    @Column(name = "ventureprofileid", nullable = false)
    private BigInteger ventureprofileid;      
    @Column(name = "ventureid", table="ventureprofile", nullable = false)
    private Long ventureid;
    @Column(name = "venturesummary")
    private String venturesummary;
    @Column(name = "logoimagelocation")
    private String logoimagelocation;
    @Column(name = "visible", nullable = false)
    private boolean visible;  
    @Column(table = "venture", name = "venturename", nullable=false, insertable=false, updatable=false)
    private String venturename;
//... The extra column of data is "venturename", the tables are related by the column "ventureid". I contest, that since I have specified for read/write access no fields mapped to the 'venture' table (I specified with 'table=' any ambiguous columns), and described the table relationship via my @PrimaryKeyJoinColumn annotation, that toplink should not try to persist anything to the 'venture' table. However, I am getting the following exception:
Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.0 (Build b58g-fcs (09/07/2007))): oracle.toplink.essentials.exceptions.DatabaseException
Internal Exception: org.postgresql.util.PSQLException: ERROR: null value in column "venturename" violates not-null constraint
Error Code: 0
Call: INSERT INTO venture (ventureid) VALUES (?)
        bind => [220]
Query: InsertObjectQuery(VCMarkWeb.db.entity.Ventureprofile[ventureprofileid=220])
        at oracle.toplink.essentials.exceptions.DatabaseException.sqlException(DatabaseException.java:311)
...It seems pretty clear that toplink is trying to insert an empty row into the secondary table, and barfing since it is inserting no values, including those constrained to be nonnull. Anyway...I hope it's clear what's going on here, and perhaps somebody knows the right way to do this. Thanks fot your help!

Tom and Cornelius,
Thank you both for your ideas. This what I think I will do:
1) Drive up to OWC (fortunately they are only about 15 miles away from where I live) and get a bigger HD and some more RAM.
2) Copy the OS9 applications on the existing HD to a thumb drive.
3) Install the new hard drive and memory
4) Install OSX TIger and 9.2.2
5) Maybe do the 4.1.8 firmware update also, maybe.
6) Look around for a Superdrive and if I can get one for a good price, I'll do it otherwise I'll just use USB thumb drives if I need to copy something off the PB.
One thing that I was fighting with the other day was that when I had the yoyo power supply plugged in and attached when the PB was in the kitchen, the batteries would not charge although the yoyo was outputting +24 VDC.
I move everything to the garage, where I originally fixed the yoyo power supply, plug it in out there and the batteries started charging!!! Scratching my head...then I check the voltage between the metal barrel (with the Vsensing resistor attached between the metal shell and the ground wire) of power supply plug and the +24 VDC wire and there is 22 to 23 VDC with the batteries being charged. In the kitchen when they were not being charged, it was about 1.0 VDC. So I rotate the plug a little bit and the batteries start charging. Rotate it more and the batteries don't charge. Something else to do when I have spare time.
Anyway, thanks for the help and suggestions.
John

Similar Messages

  • "Unable to read from or write to your play

    When I go to create a playlist with the music that is already on my Zen, this pops up. Why isnt it working? Its probably something really simple that I overlooked... but Im stumped. I came here as a last resort

    I received this same message and came on here to find some help. I am using the new Creative Zen, 6 gig.
    I am using a Windows Vista computer.
    When the player is docked and I am using the Zen Media Explorer, I go to "create playlists"
    The player loads, I can see all of my files and most of my music on the creative playlist wizard. I clicked on one file (containing most of my music) and this message pops up. "Unable to read from or write to your player"
    Any suggestions?

  • "Can't read from or write to disk...." iPod error

    I recently switched from my old PowerBook G4 (running Leopard 10.5.2) to a newer MacBook Pro (running Leopard 10.5.5). I migrated my account and permissions from the PB to the MacBook Pro, and everything is working just fine except for iTunes (version 8.0.2) and my older 160 GB iPod Classic (running 1.1.2).
    NOTE: THE VERSION OF iTunes ON THE PB WAS VERSION 8.0.1.
    Since the migration, I've been getting this "can't read from or write to disk..." error whenever I attempt to sync my iPod to iTunes. Previously, I'd never had any problems. I have tried to restore the iPod using iTunes - didn't work. I have tried different USB to dock connector cables - didn't work. I have even tried completely re-formatting the iPod using Disk Utility - didn't work. Everytime I begin syncing the iPod, it starts out just fine. At varying degrees of completion it ALWAYS fails with the same error.
    I had an idea. I tried syncing the iPod to a different computer - my G5 4 x 2.5 GHz (running Leopard 10.5.5) with iTunes (version 8.0.2). I still got the same error. I haven't dropped it, submerged it in water or done anything to it that would otherwise compromise its functionality. So, I'm at a loss.
    PLEASE! PLEASE! PLEASE!
    Does anyone have any other suggestions? - OTHER THAN BUYING A NEW IPOD

    UPDATE:
    OK, after the visit to my Genius Bar; I thought of a variable that wasn't previously considered. Because their transfer of media was successful without the slightest hitch, I had to figure out something else.
    Everytime I had tried to sync the iPod with my various Macs, I was using the same process. Since all of my music and movies "live" on an external 500 GB drive, I was attempting to use that same drive whenever I would try to sync. It occurred to me that possibly the failing was in the drive and not the iPod.
    I have part of that library on a Power Mac G4 867 DP (running 10.4.9). I updated the iTunes on that machine to 8.0.2, connected the iPod and made a successful transfer of a large amount of media!
    My only problem now is that I can't figure out how to get the 500 GB drive to stop hanging on transfer and update of my Genius information. The drive just completely stalls and I get the spinning wheel from iTunes and the application ceases to respond. When I force quit iTunes, the drive recovers fine. I don't have any problems transferring data to and from it and Disk Utility reports that the drive is healthy.
    I have tried re-installing iTunes on all affected Macs - didn't help. I believe my problem may exist in the iTunes Library file or in the associated .xml document. My only concern is that if I do a completely fresh install of iTunes where those files would be re-created, I would lose all of my play and ratings data as well as the information about when my files were added. On a related note, when playing the music from this drive through iTunes. I don't have any issues at all.
    ANY SUGGESTIONS?

  • Zen - Can't Read from or Write to Your Pla

    I recently bought a Creative Zen and had no problems with the software until recently one day when I was trying to work with a playlist, it said it could not read from or write to my player. I tried a different computer with a different operating system, installed the playlist manager disk on that computer, and got the same result.
    Additionally, when I try to record something, the player freezes up. However, the big issue for me is not being able to manage my playlists at all. I can still download books and tunes and get updates from Creative, so that's not the problem.
    Any help? I looked in the FAQ for this, but the link is broken.

    Try the instructions in this article.
    (24952)

  • Managed Metadata (Failed to read from or write to database. Refresh and try again. If the problem persists, please contact the administrator)

    When creating a new site column of the managed meta data type in SharePoint2010, and you select "customize your term set", you are presented with one of the following errors:
    - This operation cannot be completed. The term store may be unavailable.
    - Failed to read from or write to database. Refresh and try again. If the problem persists, please contact the administrator

    Hi,
    I have been facing the same issue, however managed to resolve it.
    This is due to the uncommitted statements. From Powershell try running the following script
    #Connect to Central Admin, Replace the url with the environment specific URL
    $taxonomySite = get-SPSite http://centraladmin:40000
    #Connect to Term Store in the Managed Metadata Service Application, Ensure you put the right Metadate service application name
    $taxonomySession = Get-SPTaxonomySession -site $taxonomySite
    $termStore = $taxonomySession.TermStores["Managed Metadata Service"]
    write-host "Connection made with term store -"$termStore.Name
    #Connect to the Group and Term Set
    $termStore.RollbackAll()
    Hope it would help

  • How to read from and write into the same file from multiple threads?

    I need to read from and write into a same file multiple threads.
    How can we do that without any data contamination.
    Can u please provide coding for this type of task.
    Thanks in advance.

    Assuming you are using RandomAccessFile, you can use the locking functionality in the Java NIO library to lock sections of a file that you are reading/writing from each thread (or process).
    If you can't use NIO, and all your threads are in the same application, you can create your own in-process locking mechanism that each thread uses prior to accessing the file. That would take some development, and the OS already has the capability, so using NIO is the best way to go if you can use JDK 1.4 or higher.
    - K
    I need to read from and write into a same file
    multiple threads.
    How can we do that without any data contamination.
    Can u please provide coding for this type of task.
    Thanks in advance.

  • "Unable to read from or write to your player" Zen 1

    I have a new Creative Zen 6G and am using Windows Vista. While using the Creative Media Organizer, I tried to create a new playlist. The player shows all my folders, and when I try to open the folder that contains the majority of my music, the message "Unable to read from or write to your player" appears. Does anyone know what this message means or what I have to do to fix it's Thank you-Melissa

    Have you tried adding from a folder rather than iPhoto to see if that makes a difference? Create a folder on your hard drive called called "iPod Photos" or something similar and drag the photos you want on your iPod to it. Under the photo preferences for the iPod, point iTunes to "synchronize photos from" and choose to update from your new folder.

  • Multiline table binding only transfers one row after 4.6C to ECC6 upgrade

    Good day everyone,
    I have a workflow task binding that was working fine in our 4.6C system before our upgrade to ECC6.  Now when I run the workflow, I can see that a table in the container is only transferring one line in the binding to the next task.  I have verified that the first task successfully fills both lines of the table but the second line is lost when the container table is read from the next activity.
    I have tried deleting and re-creating the bindings, thinking that perhaps something had changed in ECC6, but I still have the problem.  Once again, the code worked exactly as it should in 4.6C.
    Does anyone have any thoughts or ideas?
    Thank you in advance.
    Geoff

    Thanks Rick.
    I do not attempt to pass the CURRENCYAMOUNT table back from the task that calls method POST.  I put a breakpoint in the method POST code and there is where I see that the container only passes the last line of the table.  Here's the code in SAP's standard POST method of BUS6035:
    DATA: CURRENCYAMOUNT LIKE BAPIACCR09 OCCURS 0,
    SWC_GET_TABLE CONTAINER 'CurrencyAmount' CURRENCYAMOUNT.
    So my thought is that CURRENCYAMOUNT should have the two lines that are in the container.  Also, note that this was working exactly as I think it should in 4.6C and the only change to the workflow was the upgrade to ECC6.
    Thanks again,
    geoff

  • Converting WAV files to AAC  Error convert Can't read from or write to disk

    For several weeks I had no problem converting WAV files (from an Olympus Digital Recorder) to AAC format in iTunes, then one day I clicked "Convert Selection to AAC" and received the message "Error occured while converting the file. The disk could not be read from or written to." There is no Error # associated with the Error message.

    I recently spent over 14 hours converting all my CD songs to WAV. WAV conversion was the only one of two options available with my older Nero software, and MP3 conversion was not an option. I intended to make mixed CD's. By the time I was done, I had over 300 songs that take up over 17 GB in this WAV format.
    The thought of sitting even more endless hours making these CD's made me even more exhausted, and I realized that I should get with the times and get an MP3 player. So, I bought an iPod directly from Apple two days ago (12/16), and get this, MaclessInAZ, the sales person told me that I all my WAV files could be imported into my iPod with iTunes. (!!!)
    I am very glad to have read this thread before I got my iPod. I would have been so upset if there was no easy solution. My new iPod is supposed to be delivered tomorrow, and I am looking forward to getting it. Many thanks to weavercs for the information on the Switch program that converts WAV to MP3. Even if I decide to buy the full version of Switch, it is a lot less expensive than other conversion programs that I just found online, like Roxio.

  • Read from Table T001

    Hi Folks,
    I have a requirement to create a pull down of all "plants" (locations) from T001. Is there a way to read that information "on the fly" or at least update it on a scheduled basis?
    Thanks,
    Matt

    Ooookay.
    Well, to get the start for the pass, that reads the content from the ABAP table, you can create a job with the wizard and there choose "Jobs > SAP NetWeaver > ABAP Read Help Values" with the repository you want the data to be read from.
    It will create a job with some passes that use the "fromSAP" pass type to read tables (e.g. "Address Salutation ReadTable: TSAD3"). Just take one of those passes and change it up to fit the T001 table and in the destination tab change to a appropriate table name of your choosing to save the data.
    And then use this temp table for a second pass, a "to ID store" this time and fill whatever attribute you created to hold the data with it. 
    Since it's a job you can just schedule it to refresh the temp table whenever you want or need it to.
    Regards,
    Steffi.

  • My table lists only up one row at a time. dynamic don't work

    Hi!
    I have a table that consists of: ID, NAME, LINK and
    CONTENTID.
    It's 5 records in it at the moment.
    I create a recordset.
    I choose all (ID, NAME, LINK and CONTENTID).
    It only shows up ONE row. I mark the table and choose
    repeating behavior. I still only get up one row.
    I follow this tutorial:
    http://www.adobe.com/support/dreamweaver/building/users_delete_rcrds_php/users_delete_rcrd s_php03.html
    I use Dreamweaver CS3.
    Any good advice, cause I haven't got a clue.
    I've tried everything: the embassy, the German government,
    the consulate. I even talked to the U.N. ambassador. It's no use, I
    just can't bring my wife to orgasm.
    Marw

    Can't get it to work. But I start off with this:
    1.
    http://img521.imageshack.us/my.php?image=01tablexk1.png
    After I follow your instructions, and mark
    name I get this:
    http://img514.imageshack.us/my.php?image=02trselectedzg6.png
    But still I only get one post and have to use a Recordset
    navigation bar instead.
    Marw

  • How to read from and write to remote data file?

    Hi there
    I have two variables that I would like to store in a remote data file which can be accessed by my Flash file. It is for a voting system, so the first variable would be a counter that is incremented each time a user votes, and the second would be the total rating. The average rating would then be calculated from these.
    How would one store, retrieve, and then update these variables from the data file?
    I can create the system within a single Flash file for a single session, but obviously I'd like multiple users opening the file simultaneously to be able to access the data and update it.
    I'm using AS2 in CS3. Any help would be appreciated.

    Right, I've made significant progress since I started this topic. I now have my Flash and php files set up, and the communication between them is working. I'm having difficulty now retaining my variables in the php and updating them for the next session. The script that I have is as follows:
    <?
    $totalRating1 += $_POST['latestRating1'];
    $ratingCount1 ++;
    $averageRating1 = $totalRating1 / $ratingCount1;
    echo "&averageRating=$averageRating1";
    ?>
    The first line receives the variable "latestRating1" from the SWF. The new average rating is calculated and returned to the SWF as "averageRating". When I run it, however, the variables are reset each time. The average rating is always the same as the latest rating. How can I retain the variables so that they are updated and available for the next user?
    Any advice would be appreciated. I am very new to php, and don't have any experience with other scripting languages. I'm using ActionScript2.

  • Cant read from or write to disk...

    I am having a problem with my Click-wheel iPod which has worked flawlessly for the 2+ years I have had it. For me, this problem just started happening with the release of iTunes 7.02 which seems to correlate. When syncing with iTunes, it will copy anywhere from 15-150 songs at one time before giving the message [Exclamation point] "Attempting to copy to the disk {ipod name} failed. The disk could not be read from or written to." Nothing other than the iTunes version has changed with my desktop (same USB port, same hardware, same cable, etc.)
    Since I found no issues on the apple forum about this I searched elsewhere and found the following link:
    http://elyliu.com/blog3/2006/05/01/the-ipod-cannot-be-updated/
    Clearly there are a LOT of frustrated iPod owners out there having the same issue. What is Apple doing about this? How is this going to be resolved? I am hopeful that the company is not going to simply pretend it doesn't exist as was asserted by some of the posters in this forum. Please help...
    For clarification I am using iTunes 7.02 running on OSX 10.4.8 and the iPod has been restored using the most up-to-date firmware.
    1.8 Ghz G5 Single Proc   Mac OS X (10.4.8)  

    Jeff,
    Thanks but I have already either tried the items in this article or determined they are not issues. I have a video iPod and an iPod shuffle that both successfully sync with iTunes. Given that, I am guessing that I have no issues with iTunes, PC Disk corruption, PC hardware and/or cabeling, or bad music files.
    Also, since the click-wheel seems to copy songs with no issue up to a point, I also don't believe there are physical connector issues with it. It appears to be some type of buffer issue that gets overloaded or some type of data field that causes the problem. If it happens on a given song, I can go right back and sync again and it will copy the song it bombed out on last time and another 15-150 songs before doing it again. It is likely an application or driver issue as it is happening to both PC and Mac users.
    I also think Apple needs to take a serious look at the article you sent and ask themselves, "Who really wants to go through all of this to listen to their music?". For a company that is "all about the user experience" they seem to be conveniently turning a blind eye to the pain they inflict on iPod owners. If the product truly is this unstable then maybe a re-engineering is in line...

  • Difference between read from table or load into table in Mappings

    Hi everybody.
    i wanted to deploy a mapping. Following error was shown:
    ora-04021 timeout occurred while waiting to lock object Mapp_xyz
    I tried to deploy another Mapping which was successfull. I found out that a specific table was locked and both mappings this table is used. In the Mapping which was deployed successfully i load into this table. In the other Mapping i read from this table. So my question is, is there any difference between reading from a table in a mapping and loading into a table?
    Because after the Lock was broken up the mapping was deployed successfull.
    Any Information would be appreciated.
    Greetings

    Hi,
    thanks for the reply. A Processflow was aborted while he was executing the mapping. So on our DB we had a active session which was causing the lock.
    Thanks.
    Greetings

  • Itunes cannot read from or write to disk

    So I just got this new notebook, and I moved all my itunes files over and tried to sync my ipod touch. It didn't work out so well... I got an error message saying that the disk could not be found, it begins to sync and then I got an additional message saying that the ipod could not be read from or written to.

    Pack the old ipod up and send it back, soon or they will charge you $119 on your Credit Card. Sounds like there may be a possibility that your ipod shuffle may not be communicating with your USB ports properly. Try running the ipod updater software and try restoring the ipod. If that does not work, test your shuffle on another computer to see if it may not be an issue with the USB port. I know the 20GB works fine...But it still just may not communicate properly for some reason. As for updating the shuffle, I create a playlist in my itunes and when I plug in my shuffle, it gives me an option to autofill. I just select the playlist I want loaded to my ipod and hit autofill...Which works just fine for me.

Maybe you are looking for

  • Extracting resourse like .ai & png files from a flash project

    Hi! I have been assined the task of extracting the images from old flash projects and am having a devil of a time doing so. There are lots of programs that you can extract info out of the swf files, but these don't give you the original .ai Ilustrato

  • Premiere cs4 not running in Windows 7

    I recently started editing some AVChd files pulled off of my Sony hd cam on Premiere cs3 using Windows XP pro. I quickly realized that the HD files were not supported by CS3 and therefore upgraded to CS4 with significant lag. Not knowing much about a

  • Reports Developer V9.0.2.0.3, problem when adding sum field

    My report stops working as soon as I add a summary field to the first query. Not even using it yet, just adding it, and closing the report (.jsp) and then opening it again. I have been trying to debug this problem for a couple of days now. This is ho

  • Deleting queued email notifications in SCSM 2012

    Hi, We have disabled the email notification channel in SCSM 2012 and the workflows which are used to trigger the email notification were running. Now, we need to enable the notification channel. But, we suspect that all the old emails which are queue

  • Continuous scripts in conky?

    I would like to know if there is a way to run scripts that go continuously in conky. For example, I have one that displays the volume in the command line and just remains running, displaying the new volume instantly when I change the volume with the