Java executeBatch() - Problem in INSERT (Order of  records not maintained)

When we make a executeBatch() . And when the use
select * from DUMMY_FILE_S order by ROWID
or
select * from DUMMY_FILE_SThe rows returned are in different order.( that is its not in the order what is inserted actually)
And this happens once in a While.
This is will happen only if we try many times also So please try with many INSERTs
Please find the Java Code and the Insert SQL.
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;
import java.io.*;
import java.sql.DriverManager;
public class warranty_dummy
     public static void main(String args[])
            String FILENAME = "D:/data.sql";
            Connection conn = null;
            //String db_file_name_prefix = "@localhost:1531:xxxx_y14";
               try {
                   Class.forName("oracle.jdbc.OracleDriver").newInstance();
                   // DriverManager.registerDriver(new oracle.jdbc.OracleDriver());
                    catch (ClassNotFoundException e) {
                           e.printStackTrace();
                           //System.out.println("INSIDE class forname :"+ e.getStackTrace());
               }catch(Exception e){
                    e.printStackTrace();
         try{
                conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1531:yyyy_xxxx","my_user","password");
             Statement stmt = conn.createStatement();
               BufferedReader in = new BufferedReader(new FileReader(FILENAME));
             String line = in.readLine();
             System.out.println("Line " + line);
              while(line != null) {
             System.out.println("Line 1" + line);
               stmt.addBatch(line);
             line = in.readLine();
             System.out.println("Outside While");
             in.close();
             int iarray[] = stmt.executeBatch();
             System.out.println("Count" + iarray.length);
             catch (Exception e ){
                     System.out.println("Error attempting to store results for batch " + e.getMessage());
                 } finally {
                     try {
                         conn.commit();
                         conn.close();
                     } catch (Exception se) {
                         System.out.println("Error attempting to store results for batch "+ se.getMessage());
}SQL Data sample
INSERT INTO DUMMY_FILE_S (FILE_NO,S_NO) values (44444,'123456789')
INSERT INTO DUMMY_FILE_S (FILE_NO,S_NO) values (44444,'567891234')
INSERT INTO DUMMY_FILE_S (FILE_NO,S_NO) values (44444,'333333333')
INSERT INTO DUMMY_FILE_S (FILE_NO,S_NO) values (44444,'323232323')

Thanks for your prompt reply.
If we even use ORDER BY clause, we still don't get the records in the order what we inserted.
And we see that the problem is in smt.executeBatch(); is not inserting the records the way its inserted
For Example.
if we insert
INSERT INTO MyTable (SERIAL_NUMBER, DESCRIPTION ) VALUES (1,"test1");
INSERT INTO MyTable (SERIAL_NUMBER, DESCRIPTION ) VALUES (2,"test2");
INSERT INTO MyTable (SERIAL_NUMBER, DESCRIPTION ) VALUES (3,"test3");
INSERT INTO MyTable (SERIAL_NUMBER, DESCRIPTION ) VALUES (4,"test4");Note : (Using smt.executeBatch();)
After that when we use
Select * from MyTable ORDER BY ROWIDFor some time we get the result of the query as ( In the order we Insert )
SERIAL_NUMBER, DESCRIPTION
==========================
1,test1
2,test2
3,test3
4,test4And For some time we get the result of the query as ( We don't get the records in the order we Insert )
SERIAL_NUMBER, DESCRIPTION
==========================
1,test1
3,test3
2,test2
4,test4Is there any work around for this?
Thanks in advance

Similar Messages

  • Insert order by records into a view with a instead of trigger

    Hi all,
    I have this DML query:
    INSERT INTO table_view t (a,
                              b,
                              c,
                              d,
                              e)
          SELECT   a,
                   b,
                   c,
                   d,
                   e
            FROM   table_name
        ORDER BY   dtable_view is a view with an INSTEAD OF trigger and table_name is a table with my records to be inserted.
    I need the ORDER BY clause because in my trigger i call a procedure who treat each record and insert into a table, used in the view. I need to garantee these order.
    If i put an other SELECT statement outside, like this:
    INSERT INTO table_view t (a,
                              b,
                              c,
                              d,
                              e)
          SELECT   a,
                   b,
                   c,
                   d,
                   e
            FROM   table_name
        ORDER BY   dIt works. But I can put these new SELECT because these query is created automatic by Oracle Data Integrator.
    What I'm asking you is if there any solution to this problem without changing anything in the Oracle Data Integrator. Or, in other words, if there is any simple solution other than to add a new SELECT statement.
    Thanks in advance,
    Regards.

    Sorry... copy+paste error :)
    INSERT INTO table_view t (a,
                              b,
                              c,
                              d,
                              e)
        SELECT   *
          FROM   (  SELECT   a,
                             b,
                             c,
                             d,
                             e
                      FROM   table_name
                  ORDER BY   d)I need to insert him by a D column order, because my trigger needs to validate each record and insert him. I have some restrictions. For example, my records are:
    2     1     2006     M
    1     2     2007 M
    1     3     2007     S 2007
    1     2     2007     S 2007
    2     1     2009     S
    2     1     2009     S
    I want to insert the 'M' records first and then the 'S' records because the 'S' records only makes sense in target table is exists 'M' records
    Regards,
    Filipe Almeida

  • Problems with counter in renaming interface not maintaining consistency across multiple libraries

    Happy New Year, all.
    We have a problem in Aperture that I was curious if others had, and I'm hoping somebody has figured out a workaround they will share with me. Originally, we used Aperture and it had one huge library for our different types of photography. We had to change away from that setup because if there was a problem it would take ages to troubleshoot a ~500GB library and perform actions like rebuilding the library. We didn't want to do this, but splitting into six libraries has improved the speed in general and has made rebuilding smaller individual libraries quicker.
    We shoot a lot of photos and want each photo to have a unique number (along with a custom name). We set up a rename option in Aperture that has "Custom Name_Counter" and set counter to be six digits. The problem this seemed to create is that the counter in the rename function doesn't produce a unique number consistently across libraries. If I'm in library A, and I rename a batch of files, the counter will go up and remember its last number as long as I stay in Library A. The minute I switch to Library B, the number is at where it was the last time I used Library B. This indicates to me that the preferences travel with the library.
    Does anybody know a way that I can have a global preferences file, rather than a library preferences file? It seems it maybe used to be this way, but one of the version 3 upgrades forced me to delete a preferences file for the Facebook bug a couple of version 3 subversions ago.
    On a different note, another problem with renaming is that it is so slow. Renaming master files for even 100 or so files takes minutes. Does anybody else have this happen? Sometimes it's faster, but I haven't been able to figure out a pattern to this.
    I've submitted feature requests for revamping the renaming interface for Aperture for at least a couple of years. It never seems to improve. iView Media Pro, a program I used six years ago, had a great renaming setup and I wish Aperture
    Maybe it's time to reinstall Aperture. I bought it on disc, so it's not through the App store. Does anybody have experience reinstalling? I would, of course, like to keep keywords and other preferences.

    hallerphoto wrote:
    Machine is a Mac Pro dual quad-core 2.16 GHz.
    I am unaware of a 2.16 GHz Mac Pro tower. Are you referring to a Macbook Pro or to an iMac? Or is it a configuration I am just unaware of?
    My concern is that it seems that you may be making major workflow compromises that might be better dealt with by hardware changes as feasible. E.g. most 2.16 GHz Mac CPUs are about 1/6 as strong as a top Mac Pro today or about 1/4 as strong as today's Macbook Pros, and that has huge implications on Aperture performance.
    Also, graphics processors of the 2.16 GHz era were ridiculously weak compared to modern Macs. Aperture has historically performed best with strong GPUs (e.g. the strongest G5 towers would not run Aperture without a GPU upgrade). If you stay with the existing box a GPU upgrade may (if feasible) be in order.
    You did not mention RAM, which has defining impact on Aperture performance.
    Even if no hardware upgrades are made, it is useful to know what hardware performance bottlenecks may exist. So some questions:
    • Which Mac(s), exactly?
    • Which OS version and which Aperture version?
    • How much RAM is on board?
    • If a Mac Pro, which GPU card is in use?
    • What mass storage (hard drives and SSDs), how connected and how full?
    Thanks.
    -Allen

  • Tried out samples and order of messages not maintained

    I tested out some of the samples from the JMS tutorial and I got some strange results. The first example in there creates a queue, a sender, and a receiver. The sender enqueses 10 messages (strings "1" through "10"). And the receiver dequeues and displays everything it gets. I was impressed with the fact that I can enqueue 10 messages and start the receiver later and still get my 10 messages back. Then I tried this: (1) run sender (i.e. enqueue "1" through "10"), (2) run sender again (i.e. enqueue "1" through "10"), (3) run receiver. This time it printed "1", "1", "2", "2", ... , "10", "10" instead of "1", "2", ... , "10", "1", "2", ... "10". Why isn't the order of the messages enqueued maintained?
    - Mike

    Message priorities
    You set the priority of a message (in the Priority field of the MQMD structure)
    when you put the message on a queue. You can set a numeric value for the
    priority, or you can let the message take the default priority of the queue.
    The MsgDeliverySequence attribute of the queue determines whether messages on
    the queue are stored in FIFO (first in, first out) sequence, or in FIFO within priority
    sequence. If this attribute is set to MQMDS_PRIORITY, messages are enqueued
    with the priority specified in the Priority field of their message descriptors; but if
    it is set to MQMDS_FIFO, messages are enqueued with the default priority of the
    queue. Messages of equal priority are stored on the queue in order of arrival.
    The DefPriority attribute of a queue sets the default priority value for messages
    being put on that queue. This value is set when the queue is created, but it can be
    changed afterwards. Alias queues, and local definitions of remote queues, may
    have different default priorities from the base queues to which they resolve. If
    there is more than one queue definition in the resolution path (see �Name
    resolution� on page 99), the default priority is taken from the value (at the time of
    the put operation) of the DefPriority attribute of the queue specified in the open
    command.
    The value of the MaxPriority attribute of the queue manager is the maximum
    priority that you can assign to a message processed by that queue manager. You
    cannot change the value of this attribute. In MQSeries, the attribute has the value
    9; you can create messages having priorities between 0 (the lowest) and 9 (the
    highest).
    Above is the documentation given for your problem in "ApplicationProgramming guide".
    Even I have tested by running sample program.
    It gives me FIFO only

  • Info record not updated from PO , PO updated from Info record

    Dear Gurus,
    I want to restrict Base price in PO will be copied from Valid info record. User does not permitted to change the Base price once info record not maintained.
    Kindly tell me the configuration steps to adopt the process ?
    I don't want to update infor record from PO also.
    I know while making PO i can untick infor record not update, but that is user specific.
    Thanks in advance
    With regards
    SD

    Dear Sidi,
    Thanks . Problem solved.
    When info record is maintained the price condition will get from there. for this change in condition type P001 , set "D" in  manual entries column.
    When info record is not maintained, then the system will try to get the price from last PO, if not present, it  will throw an error u201CNet price must be greater than 0u201D and sets price condition PBXX (manual entry) to manually enter the price you want.
    What you can do:
    Is make the condition type P000 as automatic only (option D as below) and also same for condition type PBXX.
    Regards
    Soumen

  • User master record not sufficiently maintain for object authori

    Dear Friends,
    I am getting error in the query for one of the test user id "User master record not maintained sufficiently for object authori".
    I have authorization variable call zso_auth, zdc_auth for authroization for sales office and distribution channel.  I have maintained value in pfcg.  Please help. What will be problem.
    Regards,
    Chetana Kotian

    HI Sourav,
    It means that you are not authorized to see the ODS data. (Your BW logon ID has not been added to the users list of the Role.
    Regards,
    R.Ravi

  • Oracle insert problem(records not in the order they are inserted)

    hi, all:
    I tried to insert a word list into a oracle table, everything is fine except that the words are not in the order they are inserted. For example, the words are inserted in the following sequence:
    accreted     
    accreting     
    accretion     
    accretionary     
    accretive     
    bladebone
    bladed     
    bladeless
    bladelike
    When I retrived the resultset from the table and iterate through each of the record, the words are not in the order inserted, i.e., it may look like this,
    accreted     
    accreting     
    bladebone
    bladed     
    accretion     
    accretionary     
    accretive     
    bladeless
    bladelike
    This strange phenomenon won't happen when the word list is small, like 500 words or so, but when the number of words reaches around 10,000, it takes place. My coworker also experienced this problem when trying to insert large volume of data into oracle table.
    The code I used to insert into the DB table:
    BufferedReader reader=new BufferedReader(new FileReader("C:\\Dictionary.txt"));
    while( (line=reader.readLine())!=null )
         sql="INSERT INTO DICT " +
         "VALUES ('" + line +"')";                         
         statement.executeUpdate(sql);
    Any advice will be highly appreciated,
    thanks

    Well, the best thing to do is follows scsi-boy's advice and add the additional column and either put a sequence number in it from the Java side as you insert, or use an Oracle sequence object to put a sequence number in it from the Oracle side (which is sort of like an auto-generated value, but different).
    Note that an Oracle sequence generates numbers in sequence, but possibly with gaps (usually if the database is rebooted), unless you do some things that slow sequences down substantially. Sequences can also be something of a bottleneck on RAC clusters. See:
    http://www.dizwell.com/oracle/articles/autonumbering.html
    However, if your coworker is commiting after each and every insert (which is bad form and slows the database down, -10 points), and if your coworker is also never ever ever updating the columns after they've been inserted, and if your coworker is using Oracle 10g and not some older version such as 9i, then your coworker could use the ORA_ROWSCN pseudo-column to order by. Those are very very severe constraints and you shouldn't begin to consider doing it that way without a very good reason, and right now you and your coworker wouldn't know a good reason if it snuck up and bit you on the butt, you've got a lot of learning the basics first.

  • Problem of user key while inserting a lead record

    hi all
    i am trying to insert a lead record. I have created WSDL client in java environment. I have used Web Services V2.0 and Generic WSDL.
    I have given following 3 field values as they are the required fields on Lead object to create a record
    LeadLastName
    LeadFirstName
    LeadOwner.
    I have called LeadInsert() service to enter the record into the application.
    now my problem is that i get following error:
    The record with search specification '[Id] = "\?"' in business component 'Lead' (integration component 'Lead') has been deleted by another user since it was retrieved.(SBL-EAI-04289)
    I am confused as i am inserting a new record why the value of ID has to present in the database?
    is it something related to Child insert?
    thanks in advance.
    regards

    Hi,
    Not sure what is the problem you are facing
    My code like this works fine without any issues
         LeadStub ls = new LeadStub(wsLocation);
         crmondemand.LeadStub.LeadInsert_Input leadInsert_Input2 = new crmondemand.LeadStub.LeadInsert_Input();
         crmondemand.LeadStub.ListOfLeadData param = new ListOfLeadData();
         crmondemand.LeadStub.LeadData newLead = new crmondemand.LeadStub.LeadData();
         newLead.setLeadFirstName("Venkatesan");
         newLead.setLeadLastName("Sundaram");
         param.addLead(newLead);
         leadInsert_Input2.setListOfLead(param);
         ls.LeadInsert(leadInsert_Input2);
         System.out.println("Lead inserted successfully");
    Hope this helps
    -- Venky CRMIT

  • Problem while inserting a record to infotype 416

    Iam facing a problem while inserting a record to the infotype 416 for a personnel no using the FM 'HR_INFOTYPE_OPERATION'.I have created a FM to insert a record to the infotype 416.In that FM iam using the FM 'HR_INFOTYPE_OPERATION' to create a record for infotype 416.while executing  my FM the FM 'HR_INFOTYPE_OPERATION' is returning the return value 0.But when i check in PA30 for the infotype 416,there is no record created for that personnel no.Also in the table PA0416 the record is not get created.SO what might be the problem.can anyone please provide me help on this.
    I have attached the code of my FM for ur reference.
    FUNCTION Y_ESS_FL_ENCASH.
    DATA: G_COMPENSATION_AMOUNT LIKE PA0416-AMONT,
          G_RETURN TYPE BAPIRETURN1.
    DATA T_PA0416 LIKE P0416 OCCURS 0 WITH HEADER LINE.
    CALL FUNCTION 'HR_READ_INFOTYPE'
        EXPORTING
           TCLAS                 = 'A'
           PERNR                 = '00000014'
           INFTY                 = '0416'
         BEGDA                 = sy-datum
         ENDDA                 =  sy-datum
           BYPASS_BUFFER         = 'X'
         LEGACY_MODE           = ' '
    IMPORTING
         SUBRC                 =
          TABLES
            INFTY_TAB             = T_PA0416
    EXCEPTIONS
      INFTY_NOT_FOUND       = 1
      OTHERS                = 2
        LOOP AT T_PA0416
        WHERE SUBTY = '1002'.
        ENDLOOP.
        IF SY-SUBRC <> 0.
          CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
            EXPORTING
               NUMBER = '00000014'
            IMPORTING
               RETURN = G_RETURN.
          IF SY-SUBRC <> 0.
             MESSAGE I016(RP) WITH ' RECORD IS ALREADY LOCKED'.
          ENDIF.
          T_PA0416-PERNR = '00000014'.
          T_PA0416-SUBTY = '1002'.
          T_PA0416-INFTY = '0416'.
          T_PA0416-OBJPS = ''.
          T_PA0416-SPRPS = ''.
          T_PA0416-SEQNR = ''.
          T_PA0416-AEDTM = SY-DATUM.
          T_PA0416-UNAME = SY-UNAME.
          T_PA0416-ENDDA = SY-DATUM.
          T_PA0416-BEGDA = SY-DATUM.
          T_PA0416-NUMBR = '10'.
          T_PA0416-WGTYP = '1530'.
          T_PA0416-AMONT = '15000'.
          T_PA0416-WAERS = 'INR'.
          T_PA0416-QUONR = '1'.
          APPEND T_PA0416.
          CALL FUNCTION 'HR_INFOTYPE_OPERATION'
            EXPORTING
              INFTY                  = '0416'
              NUMBER                 = '00000014'
              SUBTYPE                = '1002'
      OBJECTID               =
      LOCKINDICATOR          =
             VALIDITYEND            = '31129999'
             VALIDITYBEGIN          = SY-DATUM
            RECORDNUMBER           = ''
              RECORD                 = T_PA0416
              OPERATION              = 'INS'
              TCLAS                  = 'A'
      DIALOG_MODE            = '0'
            NOCOMMIT               = 'X'
      VIEW_IDENTIFIER        =
      SECONDARY_RECORD       =
            IMPORTING
              RETURN                 = G_RETURN.
      KEY                    =
          IF G_RETURN+0(1) EQ 'E'.
                  MESSAGE I086(ZHR) WITH 'Record is not inserted in IT416'.
          ELSE.
              COMMIT WORK.
          ENDIF.
          CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
            EXPORTING
              NUMBER = '00000014'
            IMPORTING
              RETURN = G_RETURN.
        ENDIF.
    ENDFUNCTION.

    Hi Murthy
    With a first glance, I think you have given a wrong parameter value to "validityend". It should be '99991231' not '31129999' .
    If your problem still persists, try inserting the data online from PA30. If your input causes no errors, then please state what the return parameter contains.
    Regards
    *--Serdar <a href="https://www.sdn.sap.com:443http://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.sdn.businesscard.sdnbusinesscard?u=qbk%2bsag%2bjiw%3d">[ BC ]</a>

  • Problem with inserting new records in Oracle Forms

    Hi Friends,
    I am a new user to Oracle Forms and I need a help from you people. The problem is as follows:
    I have a data block in which I can display a number of records. In this data block the user will be able to edit the fields if no child records are found in another table. I have used when-new-record-instance to attain this scenario. All are text items. One item licensee_id which is made invisible by setting the property in property palette and required=no ( as this is the primary key of the table). Also the audit columns are made invisible.
    The code for it is as follows:
    DECLARE
         v_alert_button NUMBER;
         v_cnt                          NUMBER;
    BEGIN
         SELECT COUNT (*)
    INTO v_cnt
    FROM id_rev_contracts
    WHERE licensee_id = :ID_REV_LICENSEES.licensee_id;
    IF v_cnt > 0 THEN
    set_item_property('ID_REV_LICENSEES.LICENSEE_NAME', UPDATE_ALLOWED, PROPERTY_FALSE);
    ELSE
         set_item_property('ID_REV_LICENSEES.LICENSEE_NAME', UPDATE_ALLOWED, PROPERTY_TRUE);
         -- set_item_property('ID_REV_LICENSEES.LICENSEE_NAME', INSERT_ALLOWED, PROPERTY_TRUE);
    END IF;
    END;
    Now in this data block I should also be able to insert new records and for the same I have used PRE-INSERT trigger and the code for it is as follows:
    DECLARE
         v_alert_button NUMBER;
    CURSOR v_licensee_id IS SELECT id_rev_licensees_s.NEXTVAL FROM dual;
    BEGIN
    OPEN v_licensee_id;
    FETCH v_licensee_id INTO :id_rev_licensees.licensee_id;
    CLOSE v_licensee_id;
    IF :id_rev_licensees.licensee_id IS NULL THEN
    Message('Error Generating Next v_licensee_id');
    RAISE Form_Trigger_Failure;
    END IF;
    :ID_REV_LICENSEES.created_by := :GLOBAL.g_login_name;
    :ID_REV_LICENSEES.last_updated_by := :GLOBAL.g_login_name;
    :ID_REV_LICENSEES.create_date := SYSDATE;
    :ID_REV_LICENSEES.last_update_date := SYSDATE;
    EXCEPTION
    WHEN form_trigger_failure
    THEN
    RAISE form_trigger_failure;
    WHEN OTHERS
    THEN
    v_alert_button :=
    msgbox ('ERROR in Pre-Insert - ' || SQLERRM, 'STOP', 'Contact IST');
    RAISE form_trigger_failure;
    END;
    Every thing is compiling fine but at the run time when I am trying to insert a new record I am receiving the following error:
    FRM-40508:ORACLE error:unable to insert record
    I also think the pre-insert record is not firing at the time of inserting a new record and saving it. So I request you to please delve into this problem and suggest me how to overcome this problem. Code snippets would do more help for me. If you need any other things from me please let me know. I will see if I could be of any help in that concern because I may not be able to send the entire form as it is.
    Thanks and regards,
    Vamsi K Gummadi.

    first of all
    pre-insert fires after the implicit/explicit commit/commit_form is issued and before the real insert is submitted to the db.
    i would suggest to remove the error handling part for the moment
    because i believe you might be getting "ora-xxxx cannot insert null"
    and also make visible the primary column to check if the pre-insert is executed.
    it would be better to make visible for a while the not null columns of the table/block
    i suppose that the block is insert allowed and you are using table as the source of the block and not any procedures or something...

  • ADF BC : Problem in Inserting a Master - Detail Record

    Hi,
    I am new to ADF Business Components. I am into a project where i use only the ADF BC as ORM/DB Operations and for the front end I use some other framework. The Problem is.
    I have two entity objects and a ViewLink between them. [Relation between "Order" to "Item" is (1 to many relation)].
    [I saw many examples in forums where its explained with View Objects But here I DID NOT create any View Object. I have only Entity Objects]
    (1) OrderEO [Entity Object for Order Table]
    (2) ItemEO [Entity Object for Items Table]
    (3) OrderItemsViewLink [A Viewlink where OrderEO.OrderId = ItemEO.OrderId]
    All The Primary keys (for the "Order" and "Items" table ) are handled by Trigger+Sequence at the time of insert in DB side.
    I created custom method to insert "Order" individually it worked fine.
    I created custom method to insert the "Item" individually it worked fine.
    But...
    When I created and "Order" with some "Items" It failing to insert and throws an
    Error : oracle.jbo.InvalidOwnerException: JBO-25030: Failed to find or invalidate owning entity: detail entity ItemEO, row key oracle.jbo.Key[0 ].
    My Custom Method in the AppModuleImpl is like below :
    public void createNewOrderWithNewItems() {
    String entityName = "com.proj.entities.OrderEO";
    EntityDefImpl orderDef = EntityDefImpl.findDefObject(entityName);
    OrderEOImpl newOrder = (OrderEOImpl)orderDef .createInstance2(getDBTransaction(),null);
    try {
    // 3. Set attribute values
    newOrder .setOrderStatusCode("CREATED");
    RowIterator items = newOrder .getItemEO();
    Row newItemRow = items .createAndInitRow(null);
    items .insertRow(newItemRow );
    newItemRow .setAttribute("itemDate", new Date());
    newItemRow .setAttribute("itemQty", new Number(10));
    // 4. Commit the transaction
    getDBTransaction().commit();
    } catch (SQLException e) {
    e.printStackTrace();
    } catch (JboException ex) {
    getDBTransaction().rollback();
    throw ex;
    Here the "Order" is also new and related Items is also new. What I expect is to save the Order with Items in one transaction. How to achieve this. Please suggest.
    Thanks
    Narayan
    Edited by: 817942 on Dec 3, 2010 8:16 AM

    Read through the blog posts which describes
    why this issue occurs and how it should be resolved.
    http://radio-weblogs.com/0118231/stories/2003/01/17/whyDoIGetTheInvalidownerexception.html
    http://one-size-doesnt-fit-all.blogspot.com/2008/05/jbo-25030-failed-to-find-or-invalidate.html
    Thanks,
    Navaneeth

  • Inserting and Updating records in ORACLE using WebDynpro Java

    Hi All
    I got connected to oracle backend (using my previous thread), but now i want to insert and update the records
    i have created views  for insert and update,
    Thanks in advance
    Sushma

    Hi shusma..
    chk this link..
    <b><u>Creating Connection</u></b>
    package com.sap.xirig;
    import javax.naming.*;
    import javax.sql.*;
    import java.sql.*;
    public class DBLookup {
    String Conn_Status = "Not Connected";
    String Language_Desc = "Empty";
    String Language_Cd = "Empty";
    Connection conn;
    Context ctx;
    DataSource ds;
    //Constructor for the DBLookup object
    public DBLookup {
    try {
    ctx = new InitialContext();
    if (ctx == null) {
    throw new Exception("Boom - No Context");
    // If JDBC 2.0 connection is used please create the DataSource object as below
    // ds = (DataSource) ctx.lookup("jdbc/ORACLEDATASOURCE");
    // If JDBC 1.0 connection is used please create the DataSource object as below
    // ds = (DataSource) ctx.lookup("jdbc/notx/ORACLEDATASOURCE");
    if (ds == null) {
    throw new Exception("Boom - No dataSource");
    catch (Exception e) {
    e.printStackTrace();
    public String getLanguageDesc(String v_str) {
    Statement stmt = null;
    ResultSet rst = null;
    try {
    if (ds != null) {
    conn = ds.getConnection();
    Conn_Status = "Could not get connection to
    datasource";
    if (conn != null) {
    Conn_Status = "Got Connection " +
    conn.toString();
    stmt = conn.createStatement();
    rst = stmt.executeQuery("SELECT
    LANGUAGE_DESC FROM LANGUAGETRANSLATION WHERE LANGUAGE_CD='" + v_str +
    if (rst.next()) {
    Language_Desc = rst.getString(1);
    conn.close();
    catch (Exception e) {
    e.printStackTrace();
    finally {
    if (rst != null) {
    try {
    rst.close();
    catch (Exception e) {
    e.printStackTrace();
    if (stmt != null) {
    try {
    stmt.close();
    catch (Exception e) {
    e.printStackTrace();
    if (conn != null) {
    try {
    conn.close();
    catch (Exception e) {
    e.printStackTrace();
    return Language_Desc;
    http://e-docs.bea.com/wls/docs81/oracle/API_joci.html
    Hope this will help u..
    URs GS

  • As i am fresher Please share the doc of ECMA script using java script in SharePoint 2013 also how we can insert,update,delete records in list using ECMA script.

    As i am fresher Please share the doc of ECMA script using java script in SharePoint 2013 step by step also how we can insert,update,delete records in list using ECMA script.
    Thanks and Regards, Rangnath Mali

    Hi,
    According to your post, my understanding is that you want to use JavaScript to work with SharePoint list.
    To create list items, we can create a ListItemCreationInformation object, set its properties, and pass it as parameter to the addItem(parameters) function
    of the List object.
    To set list item properties, we can use a column indexer to make an assignment, and call the update() function so that changes will take effect when you callexecuteQueryAsync(succeededCallback,
    failedCallback). 
    And to delete a list item, call the deleteObject() function on the object. 
    There is an MSDN article about the details steps of this topic, you can have a look at it.
    How to: Create, Update, and Delete List Items Using JavaScript
    Thanks & Regards,
    Jason
    Jason Guo
    TechNet Community Support

  • Find records based on their insertion order

    Hi to all,
    Is there any way I can find records based on their insertion order.
    Like i inserted 5 records, can I find fifth record based on that insertion order?
    Advance thanks for your inputs
    Regards
    Karthik

    Not without adding some kind of sequencing mechanism to your inserts.
    You could use sequence numbers, or for more robustness, insert timestamps alongside your inserts.
    Triggers will help you to acheive this.

  • Problem when inserting blank record.

    Dear All,
    I have following taskflow structure
    execute (master)
    createinsert (detail)
    pagefragment
    my page fragment has 1 master record.. 1 detail record. (which would be blank one except pk and fk generated from viewlink)
    when the user saves (commit action click)record the master saves.. but the child doesnot saves
    what i noticed is that when i enter any field in af:table(detail) it saves... but i want to insert the blank record to database.
    Any ideas..?
    Regards,
    Santosh
    jdev 11.1.1.5.0
    Edited by: Santosh Vaza on Aug 26, 2011 10:08 PM

    Hi..
    read following will useful
    http://blogs.oracle.com/shay/entry/master_with_two_details_on_the

Maybe you are looking for

  • What is mean of write-up in asset accounting

    Dear all, In asset accounting what is the mean of WRITE-UP.In which case we use this transaction. Can we use this t.code for any movement. Advise me Thanks & Regards, Srinivas

  • Time capsule painfully slow under windows 7

    I'm using a time capsule (latest gen, 3TB) with both a Mac and a PC. The Mac uses Time Machine to backup and things work great. However, on my PC (Windows 7), the TC is mounted as a network mounted (drive Z), and if I simply try to drag and drop file

  • Check_Changed_Data not working

    Hi all, In my BADI i am triggering an ALV grid pop-up to select values with check box. For getting the changed data i am using check_changed_data method. Even after selecting the check boxes in ALV pop i am not able to get the changed data. program c

  • Can't use function in creating record group

    Gurus, This question is for developers. Is this true one can't use function in creating record group. I am using form5. thanks, ZW

  • UTF 16 BE with BOM

    Hi, i need to write a file in UTF16 BE format to a NFS share. But i could not manage to force XI to write BOM (Byte order mark) Fe FF at the beginning of the file. Its always without BOM. How can i force XI to write the BOM? Which entry in the file p