Unable to read changes before commit

I have a mix of insert and select statements for a particular transaction operation.
I need to insert to table 1 a set of five records. ie. five inserts to table 1.
Then i need to sum up a column in table 1, this may have certain records which were inserted recently and some might be older ones.
This sum needs to be inserted into another table 2.
In my code i maintain the sequence of inserting, fetching the sum and inserting. I confirm the sequence by giving System.out.println().
But since everything runs inside a container managed external transaction controller.
Even though i see the System.out.println's in proper sequence, the suming query is happening before.
At the end, i have Before JTS completion, followed by my insert sqls, followed by After JTS completion.
Clearly the problem is, the fetch is happening before i insert, in JTS.
So how do i make sure, that the fetch happens after my first insert.

I assume that you are using the TopLink UnitOfWork. The UnitOfWork defers committing all changes to the database until the commit (beforeCompletion in JTA), so any queries you perform will not see any of these changes until after the commit. It does this to optimize the commit, maintain referential integrity, avoid deadlocks, avoid holding pooled connections, etc.
You must either:
- perform the inserts and the sum query in two separate transactions
- compute the sum from the objects in memory
- use a database session and insertObject instead of a unit of work
To compute the sum in memory you may wish to use a conforming query in TopLink to query the new objects that have not yet been inserted to the database.
In the 10.1.3 release, there will be support for a non-deferred unit of work, and a writeChanges() unit of work API to write changes before the commit.

Similar Messages

  • Ora-01466 unable to read data table definition has changed oracle.

    hi all,
    i truncated a table before 10 min. now i want the data's so i used this query ;
    select *
    from ( select *
    from sometable where some_condition )
    as of timestamp sysdate-1;
    but it shows:
    """ ora-01466 unable to read data table definition has changed oracle"""";
    how to get the deleted records from database????????????
    Edited by: 887268 on Oct 24, 2011 4:02 AM

    Error:  ORA 1466
    Text:   unable to read data -- object definition has changed
    Cause:  This is a time-based read consistency error for a database object,
            such as a table or index.
            Either of the following may have happened:
            The query was parsed and executed with a snapshot older than the time
            the object was changed.
            The creation time-stamp of the object is greater than the current
            system time.
            This happens, for example, when the system time is set to a time
            earlier than the creation time of the object.
    Action: If the cause is
            an old snapshot, then commit or rollback the transaction and resume
            work.
            a creation time-stamp in the future, ensure the system time is set
            correctly.
            If the object creation time-stamp is still greater than the system
            time, then export the object's data, drop the object, recreate the
            object so it has a new creation time-stamp, import the object's data,
            and resume work.

  • Commit Changes Before Updating

    Hi
    I know this request sounds strange but I have a master-detail block where the records in the detail block are all checked for completion dates/module status etc before the master block field 'Project Status' is set to 'Completed'.
    So for instance if I have 3 detail records - and one is not set to finished - when I try to set master to 'Completed' I have a count which counts the detail records then counts the detail records with 'finish' set and then compares them, if they don't match (one or more status is not set) then a message is displayed telling user to set status before trying to set the whole project to 'Completed'.
    I cannot figure out where to put a commit in because I need the detail record changes to commit before I then retry and set the project to 'Completed' but after I make detail record changes, so that the count is counting the change to the records BEFORE i try and complete project record.
    So I can't put it in when validate, and when I use commit in when new record instance in detail block then the changes will commit the first time but if I cycle the status on the detail record more than once, the when new record doesn't fire and commit, so I have to consider that a user may cycle through the record twice in one go and this means the commit won't fire.
    Can anyone suggest where I could commit after validation on the detail block but before I change master record?
    Thanks
    User605593
    Edited by: user605593 on Nov 21, 2008 1:51 AM

    You can do this using POST, but i would suggest a different approach.
    You can use formula-items to achieve this without any need for commiting anything before the data is valid:
    Create a new non-database-item IS_FINISHED in the detailblock, set calculation-mode to formula and set the formula to:
    CASE WHEN :BLOCK.STATUS='FINISHED' THEN 1 ELSE 0 ENDAdjust :BLOCK.STATUS and 'FINISHED' to appropiate values.
    Create a control block and put two items (COUNT_TOTAL and SUM_FINISHED) in their. Set calculation mode for both items to "Sum", set calculated Block for both items to yout detauil-block,
    set summary item for COUNT_TOTAL to your PK-Item in the detailblock and summary-function to COUNT.
    set summary item for SUM_FINISHED to your IS_FINISHED-item in the detailblock and summary-function to SUM.
    Now you can just check the two fields COUNT_TOTAL against SUM_FINISHED, if they are not equal there is an unfinished item.

  • I changed my Adobe user ID when we changed from Windows PC to Mac and now I am unable to read previously downloaded ebooks on my Sony Reader device due to Digital Rights Management.  Can I resolve this?

    I changed my Adobe user ID when we changed from Windows PC to Mac and now I am unable to read previously downloaded ebooks on my Sony Reader device due to Digital Rights Management.  Any ideas how I can get access to these now?

    Hi Blotontheland,
    Thanks for the prompt reply. The interesting thing is that my Macbook Pro was upgraded today to Yosemite and I still have the spinning wheel on the start up screen before the login page comes up.

  • Deleted Rows Flashback : unable to read data - table definition has changed

    Hi All,
    Its Really Important.
    I Unfortunately truncated a table using
    Trancate table mytable;
    and Made a alter table to decrease data pricision length.
    But i Need the tabla data back,
    i used the below command to get deleted rows, it shows error.
    query : select * from pol_tot versions between timestamp systimestamp-1 and systimestamp;
    error : ORA-01466: unable to read data - table definition has changed
    query : flashback table pol_tot to timestamp systimestamp - interval '45' minute;
    error : ORA-01466: unable to read data - table definition has changed
    Kindly Share your ideas How Can i Get thoose Deleted Records.
    Edited by: 887268 on Jul 8, 2012 12:26 AM

    BluShadow wrote:
    Khayyam wrote:
    Flashback dont works after DDL. Truncate command is DDL. Only recover from backup can help.Please don't spread untrue statements.Working of flashback after Drop command is so clear to say. I mean such DDL commands as CREATE, ALTER, TRUNCATE and so on...
    "Remember that DDLs that alter the structure of a table (such as drop/modify column, move table, drop partition, truncate table/partition, and add constraint) invalidate any existing undo data for the table. If you try to retrieve data from a time before such a DDL executed, you will get error ORA-1466. DDL operations that alter the storage attributes of a table (such as PCTFREE, INITRANS, and MAXTRANS) do not invalidate undo data."
    [http://docs.oracle.com/cd/B28359_01/appdev.111/b28424/adfns_flashback.htm#BJFJHDAG]

  • Auto Time change, Sound mute and trying to read something before windows 7.

    Dear,
    I recently bought a MacBook Pro i7. I installed Windows 7 Ultimate through Boot Camp. But after installing i am faceing few problems as listed below:
    1: *Automatic Time change*
    When i am in windows 7 and i switch to Mac OS X the time of my Mac OS X automaticly changes every time and i have to adjust the time every time i switch from Windows 7 to Mac OS X. This problem is when i change my operatinf system from Win to Mac.
    2: *Sound Mute*
    Whenever i log into Windows 7 i always fine the sound to be mute and i always have to unmute the sound from the button.
    3: *MacBook trys to read something before Windows 7 starts booting*
    Whenever i start windows 7, before the windows 7 booting screen, there is a black screen with a gray underscore (_) which blinks for a minute or two. And after that the booting of windows 7 starts. That (_) makes me wait a lot before booting into windows 7.
    Please help me regarding these problems of mine. I even called the Apple care but they dint have any solution to it.
    Waiting for your reply.

    hi,
    I tried all the methords as u said and it dint work atoll for me. If you have a video or some kinda software which can dignolise these problems than i feel that i can do it. Neways im rely getting so ****** off that after buying such an expensive product, it cant give me complete satisfaction, I feel that apple should first make their current products perfect and then go on launching some other products. Apple shoudent lie to sell it products that windows is compatible with MacBook. I went to a authorised service center Unicorn Infosolutions Pvt Ltd situated in Mumbai,Maharashtra,India. Even they said that all these three problems cant be resolved. This is rely bad, i never thought that apple is like this!!!! i always was a fan of apple n used to always pro-vogue people to buy its products. But now i dont think so. Neways if buy chance there is some other methord or way than please tell me.

  • Unable to read information of application in app store. Still can download but unable to read the application infor before downloading

    Hi,
    Please help, unable to read information of application in app store. Still can download but unable to read the application infor before downloading.
    I'm using iphone4, ios 6

    Yes it sounds like your application could be corrupt.
    First I would make sure you don't have a program like backup software or virus protection trying to read the files when you try to start the application. If not,
    Do you have any backups or data exports? If so, I would try to restore them for the application
    If you do what EsbHelper suggests, you will have to recreate the database. I think he is missing a few steps.
    If you are going to try to recreate the application, you need to copy your outline rules files calc scripts and report scritps (.otl, CSC, REP and rul files) to s saved directory.
    If you delete the directory using the file system, you orphan things in the security file. It's better to try to do it from EAS.
    Once it has been deleted, and recreated from EAS, then copy back in the objects. You will have everything but data and security. those will have to be recreated.
    As aI said first, the best way to do this is from some sort of backup. othersiwe it can get a bit messy

  • HT1567 my cd drive is saying unable to read cd    it has never said this before, why is it doing this

    my cd drive is saying unable to read cd,  it has never said this before i have imported hundreds of cds to my i tunes library , but now i am unable too.

    Could you post your diagnostics for us please?
    In iTunes, go "Help > Run Diagnostics". Uncheck the boxes other than DVD/CD tests, as per the following screenshot:
    ... and click "Next".
    When you get through to the final screen:
    ... click the "Copy to Clipboard" button and paste the diagnostics into a reply here.

  • My second generation iPod screen went completly blank.  It plays, lights up, but I'm unable to read anything...100% white.  Has anyone confronted this issue before? Could it be battery related?  Suggestions would be greatly appreciated.  DB

    My second generation iPod Nano screen went completly blank.  It plays, lights up, but I'm unable to read anything...100% white.  Has anyone confronted this issue before? Could it be battery related?  Suggestions for solving this would be greatly appreciated.  Thanks,

    dieo99daniel wrote:
    My second generation iPod Nano screen went completly blank.  It plays, lights up, but I'm unable to read anything...100% white.  Has anyone confronted this issue before? Could it be battery related?  Suggestions for solving this would be greatly appreciated.  Thanks,
    Please describe in detail all you have attempted to do in order to resolve the issue.  Don't want to repeat what you have already tried.

  • I have master suite cs6. on mac osx. bridge has been quitting unexpectedly. Also, getting message at start up that states that "bridge encountered a problem and is unable to read the cache. Please try purging the central cache in Cache Preferences to corr

    I have master suite cs6. on mac osx. bridge has been quitting unexpectedly. Also, getting message at start up that states that "bridge encountered a problem and is unable to read the cache. Please try purging the central cache in Cache Preferences to correct the situation" I have purged the cache several times and adjusted settings with no change. I also downloaded the entire suite and installed. Do I need to uninstall all of the programs before installing the suite? There is not an option to install only Bridge from the install package.

    Maria,
    Topic or subject titles should be clear, pertinent and concise so that individual users can tell at a glance if they can help or not.
    That field is not for attempting to fit your entire question in there.
    Please keep this in mind next time you post.  Thank you.

  • Unable to read excel attachment received thru email using function module ?

    Hi...
    I am using the function module 'SO_DOCUMENT_SEND_API1' to send an email attachement in EXCEL format.
    The email is getting received along with the attachment, but when i try to open the excel file, i am getting an error stating "Unable to Read File"......
    What could be the reason behind this error.......
    Plz Help......

    Hi,
    Firstly, convert Excel Format with FM: SAP_CONVERT_TO_TXT_FORMAT ,
    " Format convert(Excel content)
      CALL FUNCTION 'SAP_CONVERT_TO_TXT_FORMAT'
        EXPORTING
          I_LINE_HEADER        =  'X'
        TABLES
          I_TAB_SAP_DATA      = GIT_DATA                     "Before convert
        CHANGING
          I_TAB_CONVERTED_DATA = GIT_EXCEL           "After convert
      LOOP AT GIT_EXCEL INTO LFC_STMP.
        LI_ITMP = STRLEN( LFC_STMP ).
        LFC_STMP+LI_ITMP = CL_ABAP_CHAR_UTILITIES=>CR_LF.
        MODIFY GIT_EXCEL FROM LFC_STMP.
      ENDLOOP.
    Then, send Email with .xls attachment via FM: SO_DOCUMENT_SEND_API1.
    Best Regards
    Lily

  • Zen Xtra (Nomad) - Unable to read from device error (have tried everythi

    Recently, I've been having problems with my Creative Zen Xtra Nomad mp3 player. One day it started freezing and lagging massi'vely when I would enter nomad explorer. Now it's virtually impossible to drag and drop something from nomad explorer to my computer or vise versa (keep getting the unable to read from device error). However, sometimes I am able to get an mp3 or two after about 5 minutes of transfer time.
    I have no idea why it is doing this. One day I'm transferring my data back and forth with no problem, and the very next day I am getting this freezing, lagging, and errors when trying to transfer. The only thing that changed was me formatting my computer in between it working and it not working, but I did reinstall the driver and nomad explorer once I formatted (I'm also using the same USB 2.0 cable, but it worked fine the day before, so I am pretty sure that's not part of the problem). I was using the mp3 player to store about 0 GB worth of data for when I formatted, and now I'm unable to retrieve virtually any of it. I've tried everything under the PC Connectivity link short of formatting the mp3 hard dri've (and that is not an option because I need the files). I took it to a friends house to try on his computer, but it acted the same way. I'm completely stumped. Is there anything I haven't ruled out? Also, I'm running Windows XP Pro SP2, and I was using SP2 before the format as well if that has any relevance.
    Please let me know if I've left out any important information relevant to this issue. Any help would be very much appreciated.
    Thanks in advance.
    -Noah Patterson
    Edit: I'm having the exact problem as this guy, but I didn't seem to find any answers on his thread.
    http://forums.creative.com/creativelabs/board/message?board.id=dap&message.id=6459&query.id=3264 5#M6459
    Message Edited by talzok on 09-20-2005 08:03 AMMessage Edited by talzok on 09-20-2005 08:09 AM

    Never use MP3 players to store important data, or as a single point of storage for any data (that includes keeping a backup of the player's audio tracks). You can have problems like this with accessing the data, as well as simply dropping the player and losing the lot.
    There are a couple of methods I've seen that have worked to retrieve data:
    . Driver update - either update to the latest drivers, or nonsensically downgrade to the drivers that come on the install CD.
    2. Notmad Explorer - use the Xtreamer function in Notmad Explorer's trial version (which is free) to access the data and download it. It will be tedious, because I assume you have to download one file at a time.
    As for your general problem, I would try using Creative's MediaSource instead of Nomad Explorer to access the player (people generally don't have good experiences with Nomad Explorer).
    Also make sure you download the latest versions of the drivers (taking above into account), MediaSource, and the MediaSource plugin from Nomadworld.com downloads.
    Once you have the data off (hopefully!) you might simply want to reformat it if none of the above hel
    ps.

  • Encrypt value before commit

    Hello,
    I'm using Oracle JDeveloper 11g Release 2 (11.1.2.3.0).
    I have a form that the user must enter some values, one of these values is a password. I need to pick up that value before commit and encrypt it. Actually the password is stored in the database without encyptation, just as the user entered it.
    My application does not use adf security, and now it's too late to change everything.
    Any idea that how  can I fix this?
    Thanks in advance!

    Hello Shay!
    Thanks a lot for your answer, I'm newby in ADF and I don't know how to do that. I think that the easiest option is to overwrite the doDML method.
    I overwrite this method in the EOImpl and, now I have this:
         * Custom DML update/insert/delete logic here.
         * @param operation the operation type
         * @param e the transaction event
        protected void doDML(int operation, TransactionEvent e) {
            super.doDML(operation, e);
    I have a method called encrypt(password), that return the password encrypted.
    How can I set the new string to the password attribute when I update on database? I guess I have to insert this code before super.doDML(operation e);, is it?
      if (operation == this.DML_UPDATE){
                // CODE HERE
    Please can you help me with this? Thanks in advance!

  • 8iR3; EJB deploy; "Unable to read class bits" error

    Hi,
    I have a strange situation going on at the moment. Every time I wish to deploy an EJB to 8iR3, the JDeveloper Message View shows the following (after app specific messages):
    "Reading Deployment Descriptor...done
    Verifying Deployment Descriptor...done
    Gathering users...done
    Generating Comm Stubs...............................................done
    Compiling Stubs...done
    Generating Jar File...done
    Loading EJB Jar file and Comm Stubs Jar file...
    Unable to read class bits from library/sqlhelper/sjb/SQLHelperOperations.class
    *** Errors occurred while deploying the EJB to 8i JVM ***
    *** Deployment completed ***
    If I then just redeploy without changing a thing, it deploys fine and everything works.
    I haven't seen a post on this forum like this, is there a configuration problem at my end?
    Cheers,
    Jono
    null

    I think it is due to the fact that I am writing a 'business interface' for my EJB, then including it in my deployment package.
    This technique is recommended in O'Reilly's 'Enterprise Java Beans' 2nd Edition p344 to ensure the bean interface and the bean match their signature.
    I don't get the 'class bits' error when I write EJB from the wizard, but when I add a business interface it happens first deploy, and is OK for the second one.
    Hope this helps anyone else who is getting this behaviour, I guess we'll have to see what happens in OC4J/Orion.

  • How to solve this problem "ORA-01466: Unable to read data -- Table definiti

    Hi,
    I had deleted the entry and i want back now and in between i done the following
    alter table pv_head enable constraint FK_PV_HED__CRF_HEDwhen i try in the following one
    SELECT * FROM PV_HEAD AS OF TIMESTAMP TO_DATE('28-FEB-2011 9:45:00','DD-MON-YYYY HH24:MI:SS')
    WHERE PV_NO IN (703705,703704) the error i am receiving           
    ORA-01466: Unable to read data -- Table definition has changed how to solve this issue.
    please guide me.
    Kanish

    You can not perform DDL and then perform a flashback query to before the DDL.
    One might wonder why you chose this particular time to perform an ALTER TABLE but you did. It is what it is.

Maybe you are looking for

  • HT204053 can I use 2 different apple id's and one itunes id for two seperate I-phones?

    can I use 2 different apple id's and one itunes id for two seperate I-phones?

  • I can no longer play iTunes rentals on Apple TV

    I just rented a movie from iTunes, and when I try to play it via my Apple TV via AirPlay mirroring all I get is a checkerboard pattern. If I play on my laptop it works, but AirPlay fails with the checkerboard pattern. I rented from the movie in iTune

  • Not enough memory to finish iDVD

    I have a 19 GB iMovie I am trying to burn to a DVD. I need 6GB of memory to complete the burn and have ditched everything I wish to off my hard drive to come up with 4 GB left. I tried burning it and of course it didn't work. So I bought a 60GB exter

  • Sort messages in Folder "Inbox"

    Dear all, How do I sort the messages in the Inbox folder using JavaMail API? Rgds, Seetesh

  • SLES disk space cleanup

    Sorry if this is not the correct place to post but I have a question. I am running GW8 on SLES 10sp3, OES 2.02 sp2 in an ESX virtualized environment. I noticed I have thousands of binary files in the /tmp directory. They appear to be sequential in na