JDeveloper 10.1.2.3 Row Insert Update issue

All,
We have a problem we hope you can help solve, using JDeveloper 10.1.2.3.0 with JHeadStart 10.1.3.3.87 and its easy to reporduce and its a bad one.
Create a simple web project > Create Entity/VO for one table > Enable JHeadStart >
Use JHS to create Master Detail drill down single record
Run app > Open Browser to the Master list > press button Create X to bring up a new row NOW open another browser TAB and do the same so we have 2 forms open in INSERT mode.
Press Save on 1st tab to trigger the Insert - fine it reloads the form after commit and row is in the DB THEN switch to the other tab and submit that one > this one will overwire the record you entered 1st.
This is bad and its happening often when we load the system with many users event without multiple (multiple tabs makes it easy to test) - trapping the doDML we expect the 2nd insert request to be DML_INSERT but we get DML_UPDATE. Depending on refresh setting on some attributes we will get error back JBO-25014 but if no refresh on insert update you still get the same issue only one row in db and 1st row gets over written.
If you have any ideas what is going on and how to solve this ASAP that would be great.
Thank you
Anthony

Steven,
Thanks for the entry. Yes, we realized that the two-tab browser scenario was the same session. The thing that baffled us was why our test without JHS allowed two inserts in a two-tab, same session situation whereas with JHS, the second insert did an update on the first record committed. We suspected it had something to do with how the current row pointer in the view cache/entity cache was being handled.
The main symptom we started with was that users in separate sessions in production are overwriting each other's records; and we agree with you, it is surprising but we can reproduce it when traffic is "heavy" (more than four users usually) or the operations are rapid fire -- less than a minute between User 1 inserting a record and User 2 inserting a record. The second user insert operation acutally updates user 1's record even though the data for both inserts is different.
We switched EnableTokenValidation to "true" and this "fixes" the two-tab, single session situation -- the second insert presents a row currency JBO error (much better than overwriting the first record). In a two-user session scenario, the effect is worse with this setting: the second user trying to insert actually updates a different record from the record the first user just inserted.
This seems to point to users sharing a view/entity cache and it seems like that might be an ADF or maybe an OC4J bug -- we are using datasources on OAS and an HTTPS protocol for this app.
So next we are going to try using a database procedure that overrides the Save operation on new (and updated) records. If the database procedure sees a negative ID (from DBSequence) it will insert regardless of the current record pointer. If the database procedure sees a positive ID, it will update that record. I think we'll also need to roll back the CreateInsert that got us to the new record screen, too. Messy, yes, but if this effect is due to an ADF 10.1.3 bug, rewriting the app in 11g would take much longer.
Our other ADF JHS 10.1.3 apps do not have this problem as far as we know, but they do not use datasources or HTTPS.
Peter

Similar Messages

  • Multi-Row insert/update/delete not working via db-link

    App. Version: 2.0.0.00.49
    DB: Oracle 9i, not sure about the build
    Problem: Multirow Update/Insert/Delete doesn't work via db-link.
    Error received: ....ORA-1460: unimplemented or unreasonable conversion requested....
    Where: Tabular Form generated via Wizard
    Side note: It's working properly when local table(s) is/are used, it's not working via db-link or view.
    I've encountered this error with single update/insert/delete operations before, but was able to fix it via using temp-variables (v_xyz := :Px_xyz; as the proposed v('Px_xyz') was really slow with my scripts)...but with the automated DML-action I don't see a way to edit it accordingly.
    Workaround found:
    1a) Use local* collection on HTML-DB-Server, then write single row updates/deletes/inserts to the remote DB via DB-Link
    1b) Use local* table on HTML-DB-Server, then write single row updates/deletes/inserts to the remote DB via DB-Link
    * Local = on the same server that HTML-DB is running on...
    So,...to my questions:
    1. Can someone confirm that this is a "known feature" (aka bug)?
    2. Can someone tell me if this "known feature" has been eliminated in the newer version of HTML-DB/APEX (> 2.0.0.00.49)?
    Thanks.
    Ingo

    Hi,
    Do you have a small test case program that demonstrates this? A JDeveloper project showing what exactly is the problem when trying to use the BDB SQL JDBC driver to insert data into the BDB SQL database? What do you mean by "not working", do you get any errors, you do not get errors but you do not see the data in the database etc?
    What are the versions of Java, JDeveloper, ADF and BDB SQL you are using, and on what OS?
    Regards,
    Andrei

  • Handling error with multiple row insert/update

    Hi,
    I need to insert multiple rows into a table, and I understand that i need to use executeArrayUpdate().
    My problem is this :
    1. How do I know in case some of the rows in the array failed during the INSERT?
    2. When I do know that, how do I find those particular rows?
    Thanks

    ODAFEONIHOWO wrote:
    Please i need help on how to enter multiple row into mysql with one insert
    statement and jsp it's not possible - you'll need to do a batch insert
    i have been trying this for weeks without sucess e.g how much experience do you have with Java?

  • Auditing number of rows Insert/Update/Delete

    Hi,
    We have turn on auditing on our database (audit=db), but we don't know where to find the numbe of rows processed by each DML.
    Does anyone have an idea ?
    Thank's
    Regard.
    Edited by: user5774759 on Sep 14, 2011 2:50 AM

    To check all the DML statements you have to set the Fine-grained-auditting(FGA) .
    For you have to set the triggered against the statements .
    http://vishwanath-dbahelp.blogspot.com/2011/09/setting-fga-at-schema-level.html
    let me know if u face any problem .
    Hope this help you :)
    --neeraj                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • TopLink Insert Update Issue

    Hi,
    From my ADF Page I am calling the TopLink Query to update a record if it exists else insert a new record. I have an issue where first time if the record doesn't exist a new record is inserted in the Database table, next time if another call is made the record is updated. Now if I go and delete a Record in the Table and again Run the Query from my ADF Page the record is never inserted as it should insert a Record because I manaully deleted the Record before running the query again. Any idea what might be wrong looks like something is cached and when the query runs again it never creates the record. If I don't delete a record and manually update the data and run the query again it still doesn't update the record. Looks like only first time it works i.e. inserts a record and then updates it but after that any requests never do anything in the table. As it should update or insert a record for each request coming from ADF Page. Here is the code I have:
              Session session = getSessionFactory().acquireSession() ;
            UnitOfWork uow = session.acquireUnitOfWork() ;
            ExpressionBuilder builder = new ExpressionBuilder() ;
            Expression expression = builder.get("stateName").equal("TX").and(builder.get("deptDesc").equal("HR")).and(builder.get("id").equal("1234")).and(builder.get("user").equal("XASW")).and(builder.get("mngCont").equal("3A45")) ;
            DepartmentDescription dd = (DepartmentDescription)uow.readObject(DepartmentDescription.class,
                                                                            expression) ;
            if (dd == null)
                dd = new DepartmentDescription() ;
                dd.setStateName("TX") ;
                dd.setId("1234") ;
                dd.setDeptDesc("HR") ;
                dd.setUser("XASW") ;
                dd.setMngCont("3A45") ;
                dd.setValue("Record Inserted") ;
            else
                dd.setValue("Record Updated") ;
            uow.registerObject(dd) ;
            uow.commit() ;
            session.release();
              Thanks

    This is because the object is still in the TopLink cache.
    <p>
    You can either invalidate the object in the TopLink cache (session.getIdentityMapAccessor().invalidateObject()), or use registerNewObject to force the insert. If it is just a test, you could also clear the cache (session.getIdentityMapAccessor().initializeIdentityMaps()), ).
    <p>
    You could also disable the cache by setting your descriptor to be isolated.
    <p>
    -- James : EclipseLink

  • How to get last insert/update/delet row of a table?

    I hava a table A and table B which is a copy of A. I want to create a trigger to record the changes of A in B. So every time inserting/updating/deleting A I record the row inserted/updated/deleted in B, But I can't find a effiencial way to get the latest row changed.
    So is there any sys_var in oracle table like cur_rowid or something to record the latest inserted/updated/deleted in a table? I don't want to check a index or a table to get the max_seq_id again.

    user11228816 wrote:
    I hava a table A and table B which is a copy of A. I want to create a trigger to record the changes of A in B. So every time inserting/updating/deleting A I record the row inserted/updated/deleted in B, But I can't find a effiencial way to get the latest row changed.
    So is there any sys_var in oracle table like cur_rowid or something to record the latest inserted/updated/deleted in a table? I don't want to check a index or a table to get the max_seq_id again.Sounds like an ugly requirement, any reason you're not going for materialized views or advanced replication here?

  • Issues in Table with Multi-Row Insert

    I have created a master detail screens using jheadstart on 2 separate pages, Master in the Form layout and detail in the Table Layout with multi-row insert, update and delete flags ON. Have set the New Rows count = 2.
    Issue 1
    If I try to delete any existing rows, it gives error for new rows saying value is required for the mandatory fields. It should just ignore the new rows if I have not updated any values for any attributes in the those row(As it does for non Master-Detail Table layout). I guess this might be happening because the jheadstart code is setting the foreign key for new rows the detail, but not resetting the status of the rows back to INITIALIZED.
    I also noticed that the create() of underlying EO is getting called for those blank rows when I click on 'Save' button, even if I have not changed any data in those rows.
    Issue 2
    When I try to select the new rows also for deletion, I am getting a '500 Internal Server Error' with following stack trace... This is also happening for normal (non Master-Detail) Table layout.
    java.lang.IllegalStateException: AdfFacesContext was already released or had never been attached.     at oracle.adf.view.faces.context.AdfFacesContext.release(AdfFacesContext.java:342)     at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl.doFilter(AdfFacesFilterImpl.java:253)     at oracle.adf.view.faces.webapp.AdfFacesFilter.doFilter(AdfFacesFilter.java:87)
    Issue 3
    I have put some validation code in the validate() method in the MyEntityImpl.java class.
    The validate method seems tobe getting called lots of times, in my case 20 times, where the new rows are just 2.
    Environment:
    Jdeveloper 10.1.3, JHeadStart 10.1.3 build 78, Windows XP
    thanks

    Thanks for the reply.
    Issue 1:
    What I have observed that in case of multi-row select enabled tables, the blank rows do not have any data. This is because the EO's create() method is called only when we post the data using 'Save' button. Thus the Foreign Keys are also not setup. This is a correct behavior since create() and FK setups etc should get done only if the user has inputted any value in the new rows and thus intend to insert new data into the table.
    I am able to find the exact cause of this issue. It is happening because in the details table, I have a column which needs tobe shown as checkbox. Since we can only bind checkbox to an Boolean attribute in VO, I have created a transient attribute of type Boolean, which basically calls the getter/setter of actual attribute doing the String "Y"/"N" to true/false conversion. Here is code for the transient attribute getter/setter
    public Boolean getDisplayOnWebBoolean() {
    return "Y".equals(getDisplayOnWeb()) ? Boolean.TRUE : Boolean.FALSE;
    public void setDisplayOnWebBoolean(Boolean value) {
    if(Boolean.TRUE.equals(value))
    setDisplayOnWeb("Y");
    else
    setDisplayOnWeb("N");
    Now when I click on the "Save" button, the setter for the boolean field is getting called with the value = false and this is resulting into the row being maked as dirty and thus the validation for the required attributes is getting executed and failing.
    Issue 2:
    Confirmed that correct filter-mapping entries are present in the web.xml.
    Now when I select the new blank rows for deletion and click save, following exception is thrown:
    java.lang.ClassCastException: oracle.jheadstart.controller.jsf.bean.NewTableRowBean at oracle.jheadstart.controller.jsf.bean.JhsCollectionModel.getRowsToRemove(JhsCollectionModel.java:412) at oracle.jheadstart.controller.jsf.bean.JhsCollectionModel.doModelUpdate(JhsCollectionModel.java:604) at oracle.jheadstart.controller.jsf.lifecycle.JhsPageLifecycle.processModelUpdaters(JhsPageLifecycle.java:541) at oracle.jheadstart.controller.jsf.lifecycle.JhsPageLifecycle.validateModelUpdates(JhsPageLifecycle.java:571)
    thanks - rutwik

  • How can I use multiple row insert or update into DB in JSP?

    Hi all,
    pls help for my question.
    "How can I use multiple rows insert or update into DB in JSP?"
    I mean I will insert or update the multiple records like grid component. All the data I enter will go into the DB.
    With thanks,

    That isn't true. Different SQL databases have
    different capabilities and use different syntax, That's true - every database has its own quirks and extensions. No disagreement there. But they all follow ANSI SQL for CRUD operations. Since the OP said they wanted to do INSERTs and UPDATEs in batches, I assumed that ANSI SQL was sufficient.
    I'd argue that it's best to use ANSI SQL as much as possible, especially if you want your JDBC code to be portable between databases.
    and there are also a lot of different ways of talking to
    SQL databases that are possible in JSP, from using
    plain old java.sql.* in scriptlets to using the
    jstlsql taglib. I've done maintenance on both, and
    they are as different as night and day.Right, because you don't maintain JSP and Java classes the same way. No news there. Both java.sql and JSTL sql taglib are both based on SQL and JDBC. Same difference, except that one uses tags and the other doesn't. Both are Java JDBC code in the end.
    Well, sure. As long as you only want to update rows
    with the same value in column 2. I had the impression
    he wanted to update a whole table. If he only meant
    update all rows with the same value in a given column
    with the same value, that's trivial. All updates do
    that. But as far as I know there's know way to update
    more than one row where the values are different.I used this as an example to demonstrate that it's possible to UPDATE more than one row at a time. If I have 1,000 rows, and each one is a separate UPDATE statement that's unique from all the others, I guess I'd have to write 1,000 UPDATE statements. It's possible to have them all either succeed or fail as a single unit of work. I'm pointing out transaction, because they weren't coming up in the discussion.
    Unless you're using MySQL, for instance. I only have
    experience with MySQL and M$ SQL Server, so I don't
    know what PostgreSQL, Oracle, Sybase, DB2 and all the
    rest are capable of, but I know for sure that MySQL
    can insert multiple rows while SQL Server can't (or at
    least I've never seen the syntax for doing it if it
    does).Right, but this syntax seems to be specific to MySQL The moment you use it, you're locked into MySQL. There are other ways to accomplish the same thing with ANSI SQL.
    Don't assume that all SQL databases are the same.
    They're not, and it can really screw you up badly if
    you assume you can deploy a project you've developed
    with one database in an environment where you have to
    use a different one. Even different versions of the
    same database can have huge differences. I recommend
    you get a copy of the O'Reilly book, SQL in a
    Nutshell. It covers the most common DBMSes and does a
    good job of pointing out the differences.Yes, I understand that.
    It's funny that you're telling me not to assume that all SQL databases are the same. You're the one who's proposing that the OP use a MySQL-specific extension.
    I haven't looked at the MySQL docs to find out how the syntax you're suggesting works. What if one value set INSERT succeeds and the next one fails? Does MySQL roll back the successful INSERT? Is the unit of work under the JDBC driver's control with autoCommit?
    The OP is free to follow your suggestion. I'm pointing out that there are transactions for units of work and ANSI SQL ways to accomplish the same thing.

  • How to display the result of  excutions(insert/update/delete rows)

    Hello.
    Does anyone know how to display the result of scenario executions just like a scenario executions tab of package (insert/update/delete rows) in other screen (in the intergated operating platform for operators using http)
    In additional, I also like to show the hierarchy of scenario in the same view.
    So, I need the query using the information of the ODI repository.
    If it is possible, I also like to have the decription of the tables in the ODI repository.
    Can anyone tell me how can I get the information of the counts of excution?
    Thanks in advance.

    Hi,
    You can get that information from the API getPrevStepLog. Does it work for you?
    Download the last API reference manual from:
    http://www.oracle.com/technology/products/oracle-data-integrator/10.1.3/htdocs/1013_support.html#docs

  • Polling Strategy to get back inserted/updated rows from BPEL

    Hi,
    Can anybody have code to get back the newly inserted/updated rows from database table, using DbAdapter Polling Strategy from BPEL Process.

    Hi user559009,
    Could you please elaborate a bit more about what it is you need.
    If you create a Partner link that polls a table and then create a receive activity that uses the partner link the variable in the receive activity will contain the data from the table.
    Regards Pete

  • Multiple rows insert and update form example

    I just want to share with you an example of a multiple rows insert and update form. You can access it HERE (http://tryapexnow.com/apex/f?p=12090:21)
    You will find on the same page the complete description of all elements used to buid it.
    I'm waiting for opinions, suggestions, and questions here in this thread.
    Thanks

    Hello Valentin,
    I got an error message when I clicked on the weblink. Here is the message
    Error ERR-7620 Could not determine workspace for application. Could you please take a look at this.
    Thanks,
    Karol

  • Data Load Wizard not Inserting/Updating all rows

    Hello,
    I am able to run through the whole Data Load Wizard without any problems. It reports that it successfully inserted/updated all the rows, but when I look in the table, I find a few rows that were not updated correctly. Of the entries I've identified that don't get inserted/updated properly, I've noticed they are the same rows that I was having issues with earlier. The issue was a number format error, which I solved by providing an explicit number format.
    Is it possible that the false inserts/updates might still be tied to the number format, or are there other reasons why the data load is failing on only some rows.
    Thanks,
    Brian
    Edited by: 881159 on Mar 14, 2012 5:05 PM

    Hi Brian,
    I am not aware of the situation where you get false results. However, there were some issues with number/date formats that sometime were not properly parsed, and this has been fixed in 4.1.1 patch. would your case be different from the one described in bug 13656397, I will be happy to get more details so that I can take a look at what is going on.
    Regards,
    Patrick

  • Pre Database Insert / Update Validation

    Hi,
    I have a maintenance view that allow user to insert / update.
    Let's say, z_my_table is my table
    key1
    key2
    field1
    field2
    field3
    I want to validate whether field1, field2, field3 whether exist in my table before insert / update.
    However, due to some restriction, I cannot make it as part of the key.
    My question is, how can I capture OR validate it before the data get inserted into the table ?
    I checked some online help, and found that suggestion is to write a function module OR enhancement point.
    Just wonder what is the common practice and how should I do it ? Thanks.

    I don't agree with the design but if you want to do it anyway it can be done using Events in the Maintenance View.
    After you've generated the Maintenance View of your Z table, within SE11 pull out menubar Utilities->Table Maintenance Generator, then menubar Environment->Modifcation->Events. Create New Entries and I think for your requirement you would need 2 entries - one at event 05 and another at event 18. Input the name of your routine and write the code by clicking its corresponding button.
    The following is an example of a scenario where text of an object is retrieved and filled into the view display-only column according to user input of its related object id - for your requirement you would validate the user input after checking the input values in your existing table:
    form fill_text_05.
      data begin of w_total.
              include structure zfv_fbt_acct_rel.
      data: action,
            mark,
      end of w_total.
      data: w_extract type zfv_fbt_acct_rel.
      clear: zfv_fbt_acct_rel-fbt_rel_acc_txt,
             zfv_fbt_acct_rel-fbt_cost_grp_txt.
    * populate GL a/c text
      select txt50 up to 1 rows
             from skat
             into zfv_fbt_acct_rel-fbt_rel_acc_txt
             where spras = sy-langu
             and   saknr = zfv_fbt_acct_rel-fbt_rel_acc.
      endselect.
    * populate Cost Group text
      select single fbt_cost_grp_txt
             from  zft_fbt_cost_grp
             into  zfv_fbt_acct_rel-fbt_cost_grp_txt
             where company_code = zfv_fbt_acct_rel-company_code
             and   fbt_cost_grp = zfv_fbt_acct_rel-fbt_cost_grp.
      if sy-subrc <> 0.
        message e074(zf_enhancements) with zfv_fbt_acct_rel-company_code.
      endif.
    endform.                    "fill_text_05
    Hope this helps.
    Cheers,
    Sougata.

  • How to add new row and update existing rows at a time form the upload file

    hi
    How to add new row and update existing rows at a time form the upload file
    example:ztable(existing table)
    bcent                      smh            nsmh         valid date
    0001112465      7.4                       26.06.2007
    0001112466      7.5                       26.06.2007
    000111801                      7.6                       26.06.2007
    1982                      7.8                       26.06.2007
    Flat file structure
    bcent                       nsmh         valid date
    0001112465     7.8     26.06.2007  ( update into above table in nsmh)
    0001112466     7.9     26.06.2007  ( update into above table in nsmh) 
    000111801                     7.6      26.06.2007 ( update into above table in nsmh
    1985                      11              26.06.2007   new row it should insert in table
    thanks,
    Sivagopal R

    Hi,
    First upload the file into an internal table. If you are using a file that is on application server. Use open dataset and close dataset.
    Then :
    Loop at it.
    *insert or modify as per your requirement.
    Endloop.
    Regards,
    Srilatha.

  • How to find out the rows inserted between a time period.

    Hi,
    Please help me to solve this.
    Table - emp.
    Colmns - empno(Primary Key),ename, mgr
    How to find out the rows inserted between a time period.
    For eg:- Between 02-Oct-2006 1 PM and 03-Oct-2006 2 PM.
    regards,
    Mathew.

    Hi,
    Maybe work:
    For each row, ORA_ROWSCN returns the conservative upper bound system change number (SCN) of the most recent change to the row. This pseudocolumn is useful for determining approximately when a row was last updated. It is not absolutely precise, because Oracle tracks SCNs by transaction committed for the block in which the row resides
    e.g.:
    SGMS@ORACLE10> create table test(cod number);
    Table created.
    SGMS@ORACLE10> insert into test values (1);
    1 row created.
    SGMS@ORACLE10> insert into test values (2);
    1 row created.
    SGMS@ORACLE10> commit;
    Commit complete.
    SGMS@ORACLE10> insert into test values (3);
    1 row created.
    SGMS@ORACLE10> commit;
    Commit complete.
    SGMS@ORACLE10> select SCN_TO_TIMESTAMP(ora_rowscn),ora_rowscn,cod from test;
    SCN_TO_TIMESTAMP(ORA_ROWSCN)       ORA_ROWSCN        COD
    06/11/06 08:56:56,000000000         727707205          1
    06/11/06 08:56:56,000000000         727707205          2
    06/11/06 08:57:05,000000000         727707210          3Cheers

Maybe you are looking for

  • Upgrade to iPhone 4

    I am currently using the Samsung Fascinate. It started giving me a problem (no service at all, battery dying fast-even after buying a new battery) about 2 months ago and I started calling in time after time. I would even go to the store. Today I spok

  • Error During Replication of Data Source in BI 7.0 SAPKW70017

    Hi Experts We have recently imported Support Pack SAPKW70017 into our quality system. The Quality System Client setting is -  No changes Allowed -  No change to Repository and cross-client Customizing objects After upgrade when ever we are trying to

  • Can you tell me what is the error?

    Hi all I am new to dynamic sql I am trying to execute below block But i am getting below error ERROR at line 8: ORA-06550: line 8, column 19: PLS-00306: wrong number or types of arguments in call to '||' ORA-06550: line 8, column 1: PL/SQL: Statement

  • DS Designer crashes when attaching UDC repo

    Hi, Have just installed DS 3.2 SP2 on windows 2008 R2. We have deployed the DS software on a server different from the server holding the SQL server repositories. DS Designer is installed on desktops. We have created a cleansing package repository an

  • I cannot get my Epson R800 printer to work with Lion

    I have updated to Lion and now I cannot print on my Epson stylus photo R800. Trying to add a printer goes out to find software only to tell me to go to Epson. Going to Epson only tells me that if there is no software then I already have it. Any ideas