BC4J FOR UPDATE problem

I created bc4j entity and view based on DB View with INSTEAD OF trigger. When I try to delete some rows from bc4j view I gut a mssg:
(java.sql.SQLException) ORA-02014: cannot select FOR UPDATE from view with DISTINCT, GROUP BY, etc.
How to make bc4j to do nothing and to pass control to view's INSTEAD OF trigger?
Thanks

I had the same problem using INSTEAD OF in combination with VPD. When i remember correctly, for views without VPD, the FOR UPDATE NOWAIT works.
You can overwrite the lock() method in your EntityImpl and lock the tables manually like this:try {
  getDBTransaction(  ).executeCommand( "declare v_my_table_id integer; begin "
                         + "SELECT my_table_id INTO v_my_table_id FROM mytable "
                         + "WHERE my_table_id = "
                         + getMyTableId(  )
                         + " FOR UPDATE NOWAIT; END;" );
  setLocked( true );
} catch( RuntimeException exception ) {
    throw exception;
}Sadly there is no SAVEPOINT support in BC4J, so if you have more than one table, better create a DB Package function that issues a savepoint, try to lock each of the tables and do a ROLLBACK TO savepoint if one of the SELECT FOR UPDATE fails.
hth, Markus

Similar Messages

  • Select for update problem

    i am having a query
    SELECT (max_no + 1) FROM eat_last_no
    FOR UPDATE
    when i execute this i am getting an exception
    java.sq.Exception : Not in transaction.
    what all could be the reason for this
    thanks in advance

    sorry for my information that the for update locks the table
    what i ment to say was that it locks the selected row
    but still what is the reason that i am getting execption
    java.sql.SqlException : Not In transaction

  • Please refer to this thread for updater problems o...

    Nokia 3109, Nokia 3110 Classic, Nokia 5200, Nokia 5300, Nokia 6300 and Nokia 7373 software removed from NSU - 21 January 2008
    Due to problems experienced while trying to update certain software with the Nokia Software Updater, Nokia has temporarily removed all software from the products listed above. Other Nokia products are not affected. We will endeavour to enable the software again soon and apologize for any inconvenience caused.
    This is on the Nokia Software Updater webpage under the news section... Pleasr take note...
    iPhone 5 32GB
    MacBook Pro Retina 15" Mac OS X Mountain Lion 10.8.4

    Hi Don,
    Could you tell us what error message or symptom did you come across?
    This guide is detailed, please read it:
    http://www.wikihow.com/Install-Windows-Xp-Mode-in-Windows-7
    Please Note: Since the website is not hosted by Microsoft, the link may change without notice. Microsoft does not guarantee the accuracy of this information.
    Karen Hu
    TechNet Community Support

  • ERROR using SQL Server 2000, FOR UPDATE clause problem

    Hi All,
    Because our main target for RDBMS mostly SqlServer2000, I try to use ADF BC with one. I successfully run the BC with Tester, scrolling up and down, BUT when i try to make changes and do commit, I receive ERROR, I have tried both JDBC Driver from Microsoft and jTDS, both FAILS.
    I have set the 'Default Locking Mode ..' to 'optimistic'
    (default is 'pessimistic'), it doesn't help.
    Here is the error :
    With Microsoft JDBC Driver :
    (oracle.jbo.DMLException) JBO-26080: Error while selecting entity for Departments
    ----- LEVEL 1: DETAIL 0 -----
    (java.sql.SQLException) [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer] FOR UPDATE cannot be specified on a READ ONLY cursor.
    With jTDS JDBC Driver :
    (oracle.jbo.DMLException) JBO-26080: Error while selecting entity for Departments
    ----- LEVEL 1: DETAIL 0 -----
    (java.sql.SQLException) Line 1: FOR UPDATE clause allowed only for DECLARE CURSOR.
    Pls any body help...
    Thank you,
    Krist

    Krist,
    we added a new SQL Flavor 'SQLServer' in JDeveloper 10.1.2
    This was implemented to handle special SQL syntax of SQLServer, different from SQL92 (among others the FOR UPDATE problem you're facing).
    For new projects, you can select this flavor during their creation. For projects that were defined with Flavor SQL92, you can switch to SQLServer at runtime by setting the parameter jbo.SQLBuilder=SQLServer (in your Application Module configuration or as a java option -Djbo.SQLBuilder=...)
    Regards,
    Didier.

  • HT204266 My iPad (version 1, IOS 5.1) has quit connecting with the store. I am unable to update or buy any app. I did a reboot and a reset with deleting the data. I can not find anything in support for this problem. Any help will be appreciated.

    My iPad (version 1, IOS 5.1) has quit connecting with the store. I am unable to update or buy any app. I did a reboot and a reset with deleting the data. I can not find anything in support for this problem. Any help will be appreciated.

    My iPad (version 1, IOS 5.1) has quit connecting with the store. I am unable to update or buy any app. I did a reboot and a reset with deleting the data. I can not find anything in support for this problem. Any help will be appreciated.

  • I am updating iphoto 9.1 to 9.3 and every time when I clicked for update aps store asked to open it in the account where you purchased. I am using the same account and its available in the purchased item of this account. Can someone resolve this problem.

    I am updating iphoto 9.1 to 9.3 and every time when I clicked for update aps store asked to open it in the account where you purchased. I am using the same account and its available in the purchased item of this account. But in my purchased item library it indicates that you update iPhoto. I am not sure which account the aps store asking. Can someone resolve this problem.

    Contact App Store support. They're the folks who can help with Account issues.
    Regards
    TD

  • Problem with "SELECT...FOR UPDATE OF..." and "POST command" combination

    Problem with "SELECT...FOR UPDATE OF..." and "POST command" combination
    Problem in committing transactions in Multiple Forms (Oracle Forms) with POST built-in command:
    Consider that the following statements are written in WHEN-WINDOW-CLOSED trigger of a called form.
    Statements in called form (Form name: FORM_CHILD):
    go_block('display_block') ;
    do_key('execute_query') ;
    -- Data from table_b will be populated in this block, based on the value of COLUMN_1 obtained
    -- from TABLE_A.
    -- Example: If the value of COLUMN_1 is 10, then all the matching records from TABLE_B, which
    -- are inserted with value 10 in TABLE_B.COLUMN_1 will be fetched and shown here.
    if user_choice = 'YES' then
    commit ;
    else
    rollback ;
    end if ;
    Statements in calling forms:
    There are two calling forms having following statements and it is going to call the above said called form.
    CALLING FORM 1
    Statements in KEY-COMMIT trigger:
    post;
    call_form(form_child, no_activate) ;
    Statements in ON-INSERT trigger:
    select column_1
    from table_a
    for update of column_1
    where column_2 = 'X' ;
    update table_a
    set column_1 = column_1 + 1
    where column_2 = 'X' ;
    insert into table_b ...;
    insert into table_b ...; Statements in KEY-COMMIT trigger:
    post;
    call_form(form_child, no_activate) ;
    CALLING FORM 2:
    Statements in ON-INSERT trigger:
    select column_1
    from table_a
    for update of column_1
    where column_2 = 'X' ;
    update table_a
    set column_1 = column_1 + 1
    where column_2 = 'X' ;
    insert into table_b ...;
    insert into table_b ...;
    insert into table_b ...;
    Our understanding:
    Assume that both the forms are running from two different machines/instances, issuing commit at the same time. In this case, forms will start executing the statements written in ON-INSERT trigger, the moment POST command is executed. Though the commit is issued at the same time, according to oracle, only one of the request will be taken for processing first. Assume that calling form 1 is getting processed first.
    So, it fetches the value available in COLUMN_1 of TABLE_A and locks the row from further select, update, etc. as SELECT...FOR UPDATE command is used (note that NOWAIT is not given, hence the lock will be released only when COMMIT or ROLLBACK happens) and proceed executing further INSERT statements. Because of the lock provided by the SELECT...FOR UPDATE command, the statements in calling form 2 will wait for the resource.
    After executing the INSERT statements, the FORM_CHILD is called. The rows inserted in to TABLE_A will be queried and shown. The database changes will be committed when user closes the window (as COMMIT is issued in its WHEN-WINDOW-CLOSED trigger). Then the SELECT...FOR UPDATE lock will be released and calling form 2's statements will be executed.
    Actual happenings or Mis-behavior:
    Calling form 2 starts executing INSERT statements instead of waiting for SELECT...FOR UPDATE lock. Also, the value selected from TABLE_A.COLUMN_1 is same in both the calling forms, which is wrong.
    The rows inserted into TABLE_B are having similar COLUMN_1 values in calling form 2 and they are fetched and shown in the called form FORM_CHILD.
    Note that in calling form 2 also POST only is issued, but the changes posted there are accessible in calling form 1 also, which is wrong.
    Kindly suggest us as to how to fix above problem. It will be much use, if you can send us the information regarding the behavior of Oracle Forms POST built-in also.
    Our mail ID: [email protected]
    Thanks a lot in advance.

    You have several problems:
    1. On-Insert will ONLY run if you have created a new record in a base-table block. If you haven't done that, then the POST command will not cause it to run.
    2. Select for update without a "no wait" will lock records for the first form, but when the second form tries this, it will hit the ORA-00054 exception, and will NOT wait. The only way you could make it wait is to issue an UPDATE sql command, which is not such a good way to go.
    All POST does is issues SQL insert or update commands for any changes the user has made to records in a form's base-table blocks, without following with a Commit command.
    Also understand that Commit is the same as Commit_Form, and Rollback is the same as Clear_Form. You should read up on these in the Forms help topics.

  • HI there, am having a big problem updating mu iphone due to me forgetting my password, can you tell me how to retrieve it. It seems like i have one apple id for downloads  and a different one for updates. Can you help ps.?

    Hi There
    Am having a big problem updating my iphone 4 Apps, due to a problem with my password for my apple id. But it seems that i have two different ids, one for the updates and another for the downloads. I am not able to retrieve my Id password for updating my Apps. Can you help me ps?
    Thank you

    What program did you use to fix the internal hard drive? What repairs did it report making? More crucially, if repairs were reported, did you re-run the utility until it reported no problems found? It's possible for one set of problems with a drive to mask others.
    If you have about 5GB or so free space on the internal hard drive, you can use your OS X Install disc to perform an Archive and Install to recover from the failed Software Update. When the computer restarts, download and run the OS X Update Combo 10.4.11 (Universal). When the Mac restarts after that, run Software Update. During all this, make sure nothing interrupts or shuts down the Mac! Note that the first start after each of these updates will take significantly longer than subsequent starts, so be very patient.
    How did you back up your internal drive to the external one? Did you just drag things over in the Finder, or did you use a utility such as SuperDuper! or CarbonCopyCloner? Does the external HD show up as a bootable volume in System Preferences > Startup Disk, or using Startup Manager?

  • Hi, Dear. I purcahse my iphone 4S on of the guy, my problem is when i update any app from App store and i click update there is an e-mail address is coming which i doesnt know about the password, how can i revome the e-mail address for update our apps.

    Hi, Dear. I purcahse my iphone 4S on of the guy, my problem is when i update any app from App store and i click update there is an e-mail address is coming which i doesnt know about the password, how can i revome the e-mail address for update our apps.

    Yes. Delete the Apps that were not Purchased using Your Apple ID.
    But a Restore as New is the way to go.

  • Lenovo Drivers Insufficient for update to 8.1 - Driver problem - H430

    Lenovo Drivers Insufficient  for update to 8.1 - Driver problem  (USB?) - H430
    my lenovo H430 is about 6 months old - worked okay with preinstalled Windows 8
    After update to Windows 8.1 computer no longer seemed to work well at all, although I am unable to provide hard evidence, but clearly it was not working as smoothly as in the previous 8 version with lots of irritating little problems - including sound.  
    One thing that very clearly was not functioning as it had in 8 version was the USB disconnect icon. In 8 you only had to click on icon and the USB selection window would open immediately. Additionally all USB connections would be shown - back and front USB.  Select the USB to be disconnected and it would be disconnected immediately (providing not in use). After update to 8.1 this was no longer the case.
    In 8.1 disconnect icon no longer worked as it had done in 8. After clicking on icon there was now always a lengthy pause, followed by the sound of the computer working (whirring sound) and then after a while the USB selection window would finally open. Sometimes it was necessary to click on icon a few times to get any reaction at all. A small MP3 player I had charged up on my computer every morning (front USB) in windows 8, was always in USB list, and disconnected without problem in 8. In 8.1 it was no longer in list and only charged sporadically  (would stop charging, but if I clicked on USB  icon it would start charging again - although still not shown in USB list).
    After about two weeks of 8.1 my screen suddenly - but only briefly - went black twice. I ran a sfc /scannow. problems were found but could not be resolved. I did a  Dism /Online/Clean-Image/RestoreHealth  this was reported as being successful.  About two days later my computer went into blue screen BSOD - "critical-services-failure" - from which I was unable to get out of. The only option open was the Lenovo restore option. Computer was returned to factory state with los of all data.
    back to Windows 8 the computer once again worked okay - no problems - and USB icon once again worked correctly (including with MP3 player).
    About 2 weeks later after receiving MS messages to update to 8.1 I called Lenovo support and asked about update to drivers for 8.1.
    the following list was given:
    Chipset: Intel chipset Driver for Windows 8.1 (64-bit) Version : 9.4.0.1022
    Video: CPP2 AMD DISCRETE VGA CARD DRIVER for Windows 8.1 (64-bit) Version: 13.152
    Audio: Realtek Audio Driver for Windows 8.1 (64-bit) Version: 6.0.1.7030
    LAN: Realtek Lan Driver for Windows 8.1 (64-bit) Version: 8.018.0621.2013
    STORAGE: Intel RST Driver for Windows 8.1 (64-bit) - Desktop Version: 12.8.0.1016
    I updated to 8.1 and then updated all the above drivers (no USB driver update was available).
    The same problems as the last update to 8.1 and USB was as bad as it was in last 8.1
    Some days later my computer went into blue screen BSOD once again - although this time did not stay stuck there, and quickly restarted - due to speed of restart I did not get time to read all the text and discover the cause of BSOD.
    Computer is still running badly - particularly the USB icon disconnect.
    Called Lenovo support but they have been no help!!!!!!!!!!!!!!
    Lenovo are failing us with the 8.1 update and the  DRIVERS FOR 8.1
    BSOD
    all i could find was this: (probably refers to after BSOD - the restarting part after BSOD???)
    <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
    - <System>
      <Provider Name="Microsoft-Windows-Kernel-Power" Guid="{331C3B3A-2005-44C2-AC5E-77220C37D6B4}" />
      <EventID>41</EventID>
      <Version>3</Version>
      <Level>1</Level>
      <Task>63</Task>
      <Opcode>0</Opcode>
      <Keywords>0x8000000000000002</Keywords>
      <TimeCreated SystemTime="2013-12-20T08:12:33.642341400Z" />
      <EventRecordID>9644</EventRecordID>
      <Correlation />
      <Execution ProcessID="4" ThreadID="8" />
      <Channel>System</Channel>
      <Computer>myleno</Computer>
      <Security UserID="S-1-5-18" />
      </System>
    - <EventData>
      <Data Name="BugcheckCode">209</Data>
      <Data Name="BugcheckParameter1">0xb8</Data>
      <Data Name="BugcheckParameter2">0x2</Data>
      <Data Name="BugcheckParameter3">0x0</Data>
      <Data Name="BugcheckParameter4">0xfffff8000020170a</Data>
      <Data Name="SleepInProgress">0</Data>
      <Data Name="PowerButtonTimestamp">0</Data>
      <Data Name="BootAppStatus">0</Data>
      </EventData>
      </Event>

    I have now seen the suggestion by Tomaspoko and Brillow at http://forums.lenovo.com/t5/ThinkPad-Edge-S-series​/Windows-8-1-update-S440-ThinkPad-black-screen-wit​...
    Despite the AMD driver giving an error during install at the last stage of the suggested fix, this has now yielded a working switchable graphics for my S540 for the first time with Windows 8.1.  Catalyst Control Center also works for the first time, so thank you to both the above-mentioned posters for a solution that does work.
    Hopefully in time AMD will release a non-broken updated AMD driver and CCC package.
    Thanks again for a nice solution from this forum - the problem was driving me nuts!

  • HT4623 hi..i just bought an iphone 5 yesterday 32GB..and now when i am trying to update the software..it says the following: unable to check for update/an error occurred while cheking for a software update...please help me..is it a problem in my new iphon

    hi..i just bought an iphone 5 yesterday 32GB..and now when i am trying to update the software..it says the following: unable to check for update/an error occurred while cheking for a software update...please help me..is it a problem in my new iphone??or it's just an temporary error in the apple software center???

    Lyndsay237 wrote:
    This device does not have a sim card in it. Could this be the reason or am I missing something when I am trying to update.
    Yes. You can't update or restore any GSM iPhone without a valid sim card installed in the phone. The sim card need not be activated, but it must be valid & present. If you want to update, you need to get a sim card.

  • My MacKeeper says iPhoto is out of date.  When I try to update the App Store says I need IOS 10.9 or later.  I have 10.7.5 and when I check for updates my Mac says the software is up to date.  How do I solve this problem??

    My MacKeeper says iPhoto is out of date.  When I try to update it, the App Store says I need IOS 10.9 or later.  I have 10.7.5 and when I check for updates my Mac says the OS software is up to date.  How do I solve this problem??

    1. First step to solving the Problem: Trash MacKeeper. It's a pile of trash that does far more harm to your computer than good.
    https://discussions.apple.com/docs/DOC-3691
    2. What version of iPhoto do you have? (iPhoto Menu -> About iPhoto)

  • When firefox checking for updates and updates found but due to proxy restrictions it unable to download the updates then it continue trying to download that and this time it creating problem on running javascript

    When firefox checking for updates and updates found but due to proxy restrictions it unable to download the updates then it continue trying to download that and this time it creating problem on executing javascript and raising errors.

    What are the error messages you are seeing?

  • Problem combining select, order by, rownum (top-N) and for update

    Hello,
    i have serious problems with this.
    -- drop table testtable;
    create table testTable (id number(10,0) primary key, usage number(10,10));
    -- delete from testtable;
    insert into testtable values (11, 0.5);
    insert into testtable values (10, 0.3);
    insert into testtable values (12, 0.3);
    insert into testtable values (9, 0.3);
    insert into testtable values (8, 0.9);
    insert into testtable values (3, 0.0);
    insert into testtable values (2, 0.02);
    insert into testtable values (1, 0.05);
    insert into testtable values (7, 0.7);
    insert into testtable values (6, 0.4);
    insert into testtable values (5, 0.2);
    insert into testtable values (4, 0.1);
    select * from testtable;
    -- without FOR UPDATE
    select * from (
    select tt.id id_, tt.*
    from testtable tt
    where tt.usage > 0.1
    order by tt.usage desc, tt.id desc
    where rownum <= 10;
    --> WORKS
    -- without ORDER BY
    select * from (
    select tt.id id_, tt.*
    from testtable tt
    where tt.usage > 0.1
    where rownum <= 10
    for update of id_;
    --> WORKS
    -- without WHERE ROWNUM <= 10
    select * from (
    select tt.id id_, tt.*
    from testtable tt
    where tt.usage > 0.1
    order by tt.usage desc, tt.id desc
    for update of id_;
    --> WORKS
    -- But what i need is this:
    select * from (
    select tt.id id_, tt.*
    from testtable tt
    where tt.usage > 0.1
    order by tt.usage desc, tt.id desc
    where rownum <= 10
    for update;
    --> ORA-02014: cannot select FOR UPDATE from view with DISTINCT, GROUP BY, etc., SQL State: 42000, Error Code: 2014
    select * from (
    select tt.id id_, tt.*
    from testtable tt
    where tt.usage > 0.1
    order by tt.usage desc, tt.id desc
    where rownum <= 10
    for update of id_;
    --> ORA-02014: cannot select FOR UPDATE from view with DISTINCT, GROUP BY, etc., SQL State: 42000, Error Code: 2014
    I have tried every single solution i could come up with.
    But nothing worked.
    My latest idea is to include a comment in the query and set up an ON SELECT trigger which evaluates the comment and enforeces the lock.
    But i'm not sure if this is even possible.
    I cannot split the statement into two because i need the lock immediately when the wanted rows are selected.
    One major criteria for the rows is the order by. Without it i get a random set of rows.
    And the rownum <= 10 is also needed because i don't want to lock the whole table but only the few needed rows.
    I tried row_number() over (order by ...) but this is considdered a window/group-function which disallows the for update as well as the order by.
    During these tests i noticed, that when using the row_number()-function the resultset is ordered automatically (without an additional order by clause).
    But this doesn't help anyway.
    I tried using piped functions to wrap the select to apply the rownum manually by cursor skip, but this doesn't work either. First of all i wasn't able to wrap the query the way i imagined and second the lock would be applied to the whole resultset anyway but only the reduced rows would be returned.
    I heared about LOCK-hints from other DBs, is there anything similar here?
    Any other solution??
    btw. it has to be high-performance after all.
    Greetings Finomosec;

    No, not perfect.
    This is the expected result (ordered by usage desc, id desc):
    ID     USAGE
    8     0.9
    7     0.7
    11     0.5
    6     0.4
    12     0.3
    10     0.3
    9     0.3
    5     0.2
    This ist the one produced by your statement:
    ID     USAGE
    5     0.2
    6     0.4
    7     0.7
    8     0.9
    9     0.3
    10     0.3
    11     0.5
    12     0.3
    Use limit 5 in your tests, and you will also notice that the following doesn't work either:
    select * from testtable ww where ww.id in
    select id from
    select tt.id, tt.usage
    from testtable tt
    where tt.usage > 0.1
    where rownum <= 5
    order by usage desc, id desc
    for update;
    It's because the order is not applied to the result.
    But the following modification works (at least principally):
    select * from testtable ww where ww.id in
    select id from
    select tt.id, tt.usage
    from testtable tt
    where tt.usage > 0.1
    order by usage desc, id desc
    where rownum <= 5
    order by usage desc, id desc
    for update;
    Thr problem here is:
    I need to expand the following Statement to the above form by (Java-) Code:
    -- statement-A
    select tt.id, tt.usage
    from testtable tt
    where tt.usage > 0.1
    order by usage desc, id desc;
    The main problem is:
    The order by clause needs to be duplicated.
    The problem here is, to identify it (if present) and NOT any order by in inner selects.
    I am using Hibernate and to implement this i have to modify the OracleDialect to solve this problem. I get the statement-A (see above) and have to apply the limit.
    Isn't there any other solution??
    Greetings Finomosec;

  • I have a problem with my ipad when choosing software update it is continously loading the message checking for updates without showing any results

    I have a problem with my ipad when choosing software update it is continously loading the message checking for updates without showing any results  

    Hello SuzMiller
    Check out the article for the troubleshooting steps for issues with email on your iPhone and iPad.
    iOS: Troubleshooting Mail
    http://support.apple.com/kb/ts3899
    Thanks for using Apple Support Communities.
    Regards,
    -Norm G.

Maybe you are looking for