Handling update conflicts or overwriting of records from timesten to oracle

Hi Chris,
My question is this that I have read the documentation and found out the following:-
An update is committed on a cache table in an AWT cache group. The same update is committed on the cached Oracle table using a passthrough operation. The cache table update, which is automatically and asynchronously propagated to Oracle, may overwrite the passed through update that was processed directly on the cached Oracle table depending on when the propagated update and the passed through update is processed on Oracle.
To handle or to restrict this what is the option with which I can go because I want this as an exception that is to be handled but not to be ignored or overwritten by Timesten in database.
Moreover, I want to work with AWT cache group preferably.
Can you please help me with this part.

Chris,
First thanks for showing your interest:-
Let me explain it to you with different example:-
On two separate data stores (DS1, DS2), there is an AWT table for the same Oracle base table. A row is updated on DS1 and is committed. A row is updated on DS2 and is committed. Because the cache group behavior is asynchronous, the change on DS2 may be applied to the Oracle database before the change on DS1, resulting in the DS1 change overwriting the DS2 change.
I want to handle this overwriting so that I will be able to know which record is overwritten by which new value.
Or there is one more scenario:
If at some time my TimesTen is not connected to oracle database but I have the table cached in my TimesTen and some update is done on it for particular record and the same record is updated in the oracle database also with some different value then whenever I will connect my timesten to database it will overwrite the value which is updated earlier in database.
I hope now that you are able to understand what I am trying to do here.
Please suggest me some method to handle all these things.
Thanks for your support.

Similar Messages

  • Server java trace error while updating bulk records from AIX to Oracle 10g

    Hi
    I am getting an error in TCL (Tool Command language) script that updates the records in a database table i.e around 2500 records are to be updated. I am using update statement with bind variables to insert the data.
    SQL "insert into netuser.visit_temp (FP_FROM,FP_TO,HOPS,FP_FROM_ID) values (:SN,:EN,:HP,:FPID)" [list SN $startnode EN $endnode HP $hops FPID $fpId]
    However, after processing 900 or so records (takes around 8 hours) I get the following error:
    environment variable "SERVER_JAVA_TRACE" undefined
    while executing
    "getenv SERVER_JAVA_TRACE"
    invoked from within
    "dotransaction {
         logm "Processing $fp"
         set value [SQL $query3 [list FP $fp]]
         logm "Found value $value"
         set fpid [Koplingspunkt quer..."
        ("foreach" body line 3)
        invoked from within
    "foreach fp $cmd2 {
         UtilityObject cleanCache
         dotransaction {
             logm "Processing $fp"
             set value [SQL $query3 [list FP $fp]]
         logm "Found v..."
    Could anyone please suggest the possible cause of error?

    Not a Java question. Locking.

  • Update Tax Code in Infor record from PO

    Dear Experts ,
    I want to update the tax code in info record through PO , just like net price etc .
    Please let us kw hw can it be done ?
    Regards
    Anis

    Hi,
    Tax code is picked as per following priority:
    1) From condition NAVS in transaction MEK1.
    If point 1 is not maintained then it goes to point 2
    2) From Purchasing data of the infor record.
    In your case, you can skip point 1 and then directly maintain the tax code in purchasing data of infor record.
    Regards
    Karan

  • Retrieve a range of records from SQL query Oracle

    I want to retrieve range of rows in Oracle database. This is the table structure:
    CREATE TABLE ACTIVESESSIONSLOG(
      ASESSIONID VARCHAR2(30 ) NOT NULL,
      USERID VARCHAR2(30 ),
      ACTIVITYSTART TIMESTAMP(6),
      ACTIVITYEND TIMESTAMP(6),
      ACTIVITY CLOB
    /This is the SQL command that I use to get rows from the table:
    SELECT * FROM ACTIVESESSIONSLOG WHERE ROWNUM >= 5 AND ROWNUM <= 10 ORDER BY USERID ASC;When I rum it no data is displayed. What is the proper way to get only 5 rows from the database?
    Best wishes
    Peter

    Is this SQL query valid?I tend to say no: ORDER BY is applied last, so your rownum is not in correct anymore:
    SQL> select rownum, ename, empno from emp order by empno
        ROWNUM ENAME           EMPNO
             3 SMITH            7369
             4 ALLEN            7499
             5 WARD             7521
             6 JONES            7566
             7 MARTIN           7654
             8 BLAKE            7698
             9 CLARK            7782
             2 SCOTT            7788
            10 KING             7839
            11 TURNER           7844
            12 ADAMS            7876
             1 JAMES            7900
            13 FORD             7902
            14 MILLER           7934
    14 rows selected.You either use analytic ROW_NUMBER() as in my previous post - or you need to nest once again:
    SQL> select rn, empno, ename
      from (select rownum rn, ename, empno
              from (  select ename, empno
                        from emp
                    order by empno))
    where rn between 4 and 5
            RN      EMPNO ENAME    
             4       7566 JONES    
             5       7654 MARTIN   
    2 rows selected.

  • Fetching data from timesten to oracle 10g database

    Hi Folks,
    Please provide me the steps to fetch a table data and load in to oracle database table. I need to do feasibility study on this connectivity. kindly do the needful.
    Thanks,
    PR

    782011 wrote:
    Hi Folks,
    Please provide me the steps to fetch a table data and load in to oracle database table. I need to do feasibility study on this connectivity. kindly do the needful.
    Thanks,
    PRFetch it from where?

  • Update conflict resoltion ORA-01403: no data found

    I have set up multimaster replication environment with two database and I have implemented Update conflict resolution on a table using DISCARD method(Oracle provided) as below.
    Some how it is not able to resolve the conflict and I am getting erro ORA-01403: no data found.
    On MDS(M1) I run the follwing SQL
    update menu_code
    set ipp_uid = 20
    where id = 4;
    commit;
    on master(M2) database in table menu_code row with ID=4 doesn't exsit.
    When I apply deffred transaction that gnerated by above SQL
    I get ORA-01403: no data found and ofcourse trnsaction doesn't apply to db and goes to deferror. Since I am using DISCARD method
    it should be resolved and not to gnerate error message.
    Here is detail info.
    Table name: menu_code
    --creating column group
    BEGIN
    DBMS_REPCAT.MAKE_COLUMN_GROUP (
    sname => 'SYNAPSE',
    oname => 'MENU_CODE',
    column_group => 'MENU_CODE_CG1',
    list_of_column_names => 'id,ipp_uid');
    END;
    -- adding update conflict resolution
    BEGIN
    DBMS_REPCAT.ADD_UPDATE_RESOLUTION (
    sname => 'SYNAPSE',
    oname => 'MENU_CODE',
    column_group => 'MENU_CODE_CG1',
    sequence_no => 1,
    method => 'DISCARD',
    parameter_column_name => 'id,ipp_uid');
    END;
    --regenerating support for the table.
    BEGIN
    DBMS_REPCAT.GENERATE_REPLICATION_SUPPORT (
    sname => 'SYNAPSE',
    oname => 'MENU_CODE',
    type => 'TABLE',
    min_communication => TRUE);
    END;
    Thanks.
    Pravin

    You are absolutely right. Now we decided not to write any conflict resolution routine at all.
    Non MDS database is read-only till fail over. After fail over non MDS (other master) will allow insert/update operation.
    To fail back to MDS we will write our procedure/function, out side of Oracle conflict resolution( both database will be in Read only mode during synchronizing).
    We will delete all deferred transaction/error form the queue and once data transfer is complete, again MDS becomes primary database to use.
    Oracle conflict resolutions are to complicated and has lots of overhead and maintenance.
    Thanks.
    Pravin

  • How to handle an update of the same record from two different user JSP

    how do you handle an update of the same record from two different users in JSP... if one person updates the record from one drop downs should be updated as well.. is the possible.

    I'm not sure whether I understand your question. If one user changes a record then you would like other users to see those changes. Normally those changes will be visible to other users when they refresh their browser, after the first user has committed changes to the record. I you want to be sure that the same row isn't updated at the same time by to different user, you need to configure some locking (pessimistic locking) - this depends of what technology you use. In EJB3 pessimistic locking is performed by adding a version to every entity object. If you are using ADF, the framework is able to handle either pessimistic or even optimistic locking.
    If you want the changed row to be updated in other users browsers without any user interaction by these users, you should take a look at Reverse Ajax (ex. DWR http://ajaxian.com/archives/reverse-ajax-with-dwr) - or Ajax in general. But you will never get a realtime solution, where changes is visible in other users browsers right after each record update.

  • How to handle an update of the same record from two different user  in JSP

    how to handle an update of the same record from two different user
    how do you handle an update of the same record from two different users in JSP... if one person updates the record from one drop downs should be updated as well.. is the possible.

    Usually, if two users try to update the same row at the same time, you want the first to commit to succeed, and when the second commits, they should fail with the error that the row was being concurrently updated. They you may want to show them the new row values and give them the opportunity to merge their values with the new row values...
    How can you achieve this? Google optimistic locking.

  • Oracle Replication update conflict handler creating notifications

    Hi All,
    I want to use an update conflict handler that overwrites the records in the destination database, while notifying the dba about the conflict by creating a log entry to a log file (alert log or other custom log file).
    I know that I can use prebuilt overwrite update conflict handler to overwrite the conflicting record. As far as I know there is no way to create a log entry using this prebuilt conflict handlers.
    Is there a way to create a log entry via prebuilt conflict handlers?
    Or else I can use pl/sql to create a log entry and a pl/sql can be used as conflict handler.
    But how can I create a pl/sql overwrite conflict handler?
    Thank you,
    Sasika.

    You must create your own update conflict handler.
    Conflict handler is a PL/SQL procedure (usually in package). For given conflict type is defined what parameters this procedure must have.
    And in procedure you simply put locig you need:
    1/ write a log entry
    2/ update (overwrite) data in table

  • How to handle the deleted records from R3

    Hello,
    We have created a generic data source on a database table in R3 side and now we have a case where there is a huge volume of data gets deleted and new records get updated every day.
    By doing a delta load we are able to load the New records and also the changed ones but we are unable to identify the deleted records from that table and move them to BI for deleteing those records in BI also.
    Can any one please suggest a solution for the handling the deleted records.
    Thanks,
    Ravindra.

    we had the same requirement some time ago and had two option:
    1. ask the R/3 development team add a deletion indicator in the table (and thus not actually deleting the record). this deletion indicator could then be used like for any other standard datasource
    this option was however refused, due to huge data volume after a while
    2. at the end of the load we copied the ZTABLE1 to ZTABLE2. then in the begin of the load (day after) we compare the data of table1 to table2. entries available in table2 but not in table1 are deleted, and we put a 'D'. in deletion indicator; as we only keep the deleted entries for one day, the volume of the new table is acceptable.
    M.

  • Update/Insert records from Oracle to MySQL

    Hi team, 
    My application will insert/update records into Oracle database, I need to sync all of records into MySQL database.  I designed a package to load data from Oracle to MySQL, the Oracle database use OLE DB component and MySQL database use ADO.NET.
    How to insert new records into MySQL? If the old record exists, we also need to replace with new record. I did some research, someone suggest to create a stage table to handle this scenario, but I have 14 tables in this case. How to handle this scenario
    with high performance? 
    If there is anything unclear, please let me know. 
    Thank you in advance. 

    Finally, I created 14 tables as same as in our MySQL database system with prefix "updated" , they are use to store the updated records from Oracle system. All of new records we add a flag, the "1" means insert a new record into the system,
    and the "0" means we should updated. So, I can use the conditional split component to split all of new records. The new records insert into the target table and the updated records insert into the "updated_table". Finally, we can add a
    SQL Script task to run a update script to sync all of records. 
    I don't use Lookup Transformation because we must use Cache
    Transform transformation in this case, the Cache connection manager to save the data to a cache file (.caw), it will hard to
    trace the history data in the future.  
    In addition, I recommend to use ODBC connection if somebody face the similar scenario with me, there is a bug  if we use ADO.NET to
    load data from Oracle to MySQL by using SSIS. For more information, please refer the MSDN document: http://blogs.msdn.com/b/mattm/archive/2009/01/07/writing-to-a-mysql-database-from-ssis.aspx
    @Arthur, thanks again for your input.  Have a nice day! :)

  • How to update Records from Internal table to u2018Zu2019 table?

    Hi Friends,
    How to update Records from Internal table to u2018Zu2019 table.
    I have records in Internal table , that records want to update on u2018Zmarau2019 Table.
    ( my internal table & u2018 Zu2019 table structures are same.)
    Thanking you.
    Regards,
    Subash

    Hi,
    loop at internal table.
    modify <Z- table > from values < internal table Workarea>.
    if sy-subrc = 0.
      COMMIT work.
    else.
      ROLLBACK waork.
    endif.
    endloop.
    or
    UPDATE <Z- table > from table < internal table Workarea>.
    if sy-subrc = 0.
      COMMIT work.
    else.
      ROLLBACK waork.
    endif.
    Prabhudas

  • Updating control record from EXIT_SAPLVEDF_001

    My ultimate goal is to update SNDPRN of the control record with identifier based on the org structure in an IDoc for outbound invoices. Our organizations share the same sold-to records so our EDI subsystem needs a way to distinguish between organizations.
      So far, I have a function to look up an ID from a custom table but now I need to add the code to ZXEDFU01 to modify the control record. I know I'll have to loop through the IDoc data to find E1EDK14 SEGNAM for the org data first and pass VKORG, VTWEG and SPART to my function.
      What I am not clear on though is how I actually access the IDoc data in my include(ZXEDFU01}? How do I investigate this? Does anyone have a similar example or know of a good source of information?

    Hi Greg;
       I see by that user exit program that you do not have access to the segments of the IDoc, only the control record in the importing parameter CONTROL_RECORD_OUT.  However, it looks like you may also get the org data you are looking for in the importing parameter DVBDKR.  Did you check to see if the fields there have the data you are looking for?
       If that does not work, you can access the segment data of the IDoc from the control record data using a couple of function modules shown below:
         i_edidc type edidc,
         i_edidd type standard table of edidd.
         CALL FUNCTION 'EDI_DOCUMENT_OPEN_FOR_PROCESS'
             EXPORTING
                  document_number          = CONTROL_RECORD_OUT-docnum
             IMPORTING
                  idoc_control             = i_edidc
             EXCEPTIONS
                  document_foreign_lock    = 1
                  document_not_exist       = 2
                  document_number_invalid  = 3
                  document_is_already_open = 4
                  OTHERS                   = 5.
    and
    CALL FUNCTION 'EDI_SEGMENTS_GET_ALL'
             EXPORTING
                  document_number         = i_edidc-docnum
             TABLES
                  idoc_containers         = i_edidd
             EXCEPTIONS
                  document_number_invalid = 1
                  end_of_document         = 2
                  OTHERS                  = 3.
    Cheers,
    John
    Message was edited by: John Carlson

  • Importing and Updating Non-Duplicate Records from 2 Tables

    I need some help with the code to import data from one table
    into another if it is not a duplicate or if a record has changed.
    I have 2 tables, Members and NetNews. I want to check NetNews
    and import non-duplicate records from Members into NetNews and
    update an email address in NetNews if it has changed in Members. I
    figured it could be as simple as checking Members.MembersNumber and
    Members.Email against the existance of NetNews.Email and
    Members.MemberNumber and if a record in NetNews does not exist,
    create it and if the email address in Members.email has changed,
    update it in NetNews.Email.
    Here is what I have from all of the suggestions received from
    another category last year. It is not complete, but I am stuck on
    the solution. Can someone please help me get this code working?
    Thanks!
    <cfquery datasource="#application.dsrepl#"
    name="qryMember">
    SELECT distinct Email,FirstName,LastName,MemberNumber
    FROM members
    WHERE memberstanding <= 2 AND email IS NOT NULL AND email
    <> ' '
    </cfquery>
    <cfquery datasource="#application.ds#"
    name="newsMember">
    SELECT distinct MemberNumber
    FROM NetNews
    </cfquery>
    <cfif
    not(listfindnocase(valuelist(newsMember.MemberNumber),qryMember.MemberNumber)
    AND isnumeric(qryMember.MemberNumber))>
    insert into NetNews (Email_address, First_Name, Last_Name,
    MemberNumber)
    values ('#trim(qryMember.Email)#',
    '#trim(qryMember.FirstName)#', '#trim(qryMember.LastName)#', '#
    trim(qryMember.MemberNumber)#')-
    </cfif>
    </cfloop>
    </cfquery>
    ------------------

    Dan,
    My DBA doesn't have the experience to help with a VIEW. Did I
    mention that these are 2 separate databases on different servers?
    This project is over a year old now and it really needs to get
    finished so I thought the import would be the easiest way to go.
    Thanks to your help, it is almost working.
    I added some additional code to check for a changed email
    address and update the NetNews database. It runs without error, but
    I don't have a way to test it right now. Can you please look at the
    code and see if it looks OK?
    I am also still getting an error on line 10 after the routine
    runs. The line that has this code: "and membernumber not in
    (<cfqueryparam list="yes"
    value="#valuelist(newsmember.membernumber)#
    cfsqltype="cf_sql_integer">)" even with the cfif that Phil
    suggested.
    <cfquery datasource="#application.ds#"
    name="newsMember">
    SELECT distinct MemberNumber, Email_Address
    FROM NetNewsTest
    </cfquery>
    <cfquery datasource="#application.dsrepl#"
    name="qryMember">
    SELECT distinct Email,FirstName,LastName,MemberNumber
    FROM members
    WHERE memberstanding <= 2 AND email IS NOT NULL AND email
    <> ' '
    and membernumber not in (<cfqueryparam list="yes"
    value="#valuelist(newsmember.membernumber)#"
    cfsqltype="cf_sql_integer">)
    </cfquery>
    <CFIF qryMember.recordcount NEQ 0>
    <cfloop query ="qryMember">
    <cfquery datasource="#application.ds#"
    name="newsMember">
    insert into NetNewsTest (Email_address, First_Name,
    Last_Name, MemberNumber)
    values ('#trim(qryMember.Email)#',
    '#trim(qryMember.FirstName)#', '#trim(qryMember.LastName)#', '#
    trim(qryMember.MemberNumber)#')
    </cfquery>
    </cfloop>
    </cfif>
    <cfquery datasource="#application.dsrepl#"
    name="qryEmail">
    SELECT distinct Email
    FROM members
    WHERE memberstanding <= 2 AND email IS NOT NULL AND email
    <> ' '
    and qryMember.email NEQ newsMember.email
    </cfquery>
    <CFIF qryEmail.recordcount NEQ 0>
    <cfloop query ="qryEmail">
    <cfquery datasource="#application.ds#"
    name="newsMember">
    update NetNewsTest (Email_address)
    values ('#trim(qryMember.Email)#')
    where email_address = #qryEmail.email#
    </cfquery>
    </cfloop>
    </cfif>
    Thank you again for the help.

  • Oracle Streams Update conflict handler not working

    Hello,
    I've been working on the Oracle streams and this time we've to come up with Update conflict handler.
    We are using Oracle 11g on Solaris10 env.
    So far, we have implemented bi-directional Oracle Streams Replication and it is working fine.
    Now, when i try to implement Update conflict handler - it executed successfully but it is not fulfilling the desired functionality.
    Here are the steps i performed:
    Steap -1:
    create table test73 (first_name varchar2(20),last_name varchar2(20), salary number(7));
    ALTER TABLE jas23.test73 ADD (time TIMESTAMP WITH TIME ZONE);
    insert into jas23.test73 values ('gugg','qwer',2000,SYSTIMESTAMP);
    insert into jas23.test73 values ('papa','sdds',2050,SYSTIMESTAMP);
    insert into jas23.test73 values ('jaja','xzxc',2075,SYSTIMESTAMP);
    insert into jas23.test73 values ('kaka','cvdxx',2095,SYSTIMESTAMP);
    insert into jas23.test73 values ('mama','rfgy',1900,SYSTIMESTAMP);
    insert into jas23.test73 values ('tata','jaja',1950,SYSTIMESTAMP);
    commit;
    Step-2:
    conn to strmadmin/strmadmin to server1:
    SQL> ALTER TABLE jas23.test73 ADD SUPPLEMENTAL LOG DATA (ALL) COLUMNS;
    Step-3
    SQL>
    DECLARE
    cols DBMS_UTILITY.NAME_ARRAY;
    BEGIN
    cols(1) := 'first_name';
    cols(2) := 'last_name';
    cols(3) := 'salary';
    cols(4) := 'time';
    DBMS_APPLY_ADM.SET_UPDATE_CONFLICT_HANDLER(
    object_name => 'jas23.test73',
    method_name => 'MAXIMUM',
    resolution_column => 'time',
    column_list => cols);
    END;
    Step-4
    conn to strmadmin/strmadmin to server2
    SQL>
    DECLARE
    cols DBMS_UTILITY.NAME_ARRAY;
    BEGIN
    cols(1) := 'first_name';
    cols(2) := 'last_name';
    cols(3) := 'salary';
    cols(4) := 'time';
    DBMS_APPLY_ADM.SET_UPDATE_CONFLICT_HANDLER(
    object_name => 'jas23.test73',
    method_name => 'MAXIMUM',
    resolution_column => 'time',
    column_list => cols);
    END;
    Step-5
    And now, if i try to update the value of salary, then it is not getting handled by update conflict handler.
    update jas23.test73 set salary = 1500,time=SYSTIMESTAMP where first_name='papa'; --server1
    update jas23.test73 set salary = 2500,time=SYSTIMESTAMP where first_name='papa'; --server2
    commit; --server1
    commit; --server2
    Note: Both the servers are into different timezone (i hope it wont be any problem)
    Now, after performing all these steps - the data is not same at both sites.
    Error(DBA_APPLY_ERROR) -
    ORA-26787: The row with key ("FIRST_NAME", "LAST_NAME", "SALARY", "TIME") = (papa, sdds, 2000, 23-DEC-10 05.46.18.994233000 PM +00:00) does not exist in ta
    ble JAS23.TEST73
    ORA-01403: no data found
    Please help.
    Thanks.
    Edited by: gags on Dec 23, 2010 12:30 PM

    Hi,
    When i tried to do it on Server-2:
    SQL> ALTER TABLE jas23.test73 ADD SUPPLEMENTAL LOG DATA (ALL) COLUMNS;
    it throws me an error,
    Error -
    ERROR at line 1:
    ORA-32588: supplemental logging attribute all column exists

Maybe you are looking for