Multiple updates using hibernate

Hi,
I'm doing multiple record updates, and presently updating one by one record individualy.
But i have a requirement that i have to do the batch updates and the batch operation shoud continue even one record fails.
please help me

fdfddf wrote:
Hi JsChell,
Thanks for your reply.
my requirement is i have to update list of records irrespecitve of failures in the record,
and have to log the information of failed records .
can do batch updates but how to log the failed records information.well sadly that what a good hibernate tutor aswell recommends however,there few things which you might want to catch up...
[http://www.hibernate.org/hib_docs/reference/en/html/batch.html]
and btw,u cud have given some worth to the question by posting at [http://forum.hibernate.org/]
REGARDS,
RaHuL

Similar Messages

  • SQL Update a Single Row Multiple Times Using 2 Data Sets

    I'm working in tsql and have an issue where I need to do multiple updates to a single row based on multiple conditions. 
    By Rank_
    If the column is NULL I need it to update no matter what the Rank is.
    If the Ranks are the same I need it to update in order of T2_ID.
    And I need it to use the last updated output.
    I've tried using the update statement below but it only does the first update and the rest are ignored. Here is an example of the data sets i'm working w/ and the Desired results. Thanks in advance!
    update a
    set Middle = case when a.Rank_> b.Rank_ OR a.Middle IS NULL then ISNULL(b.Middle,a.Middle) end,
    LName = case when a.Rank_> b.Rank_ OR a.Lname IS NULL then ISNULL(b.LName,a.LName) end,
    Rank_ = case when a.Rank_> b.Rank_ then b.Rank_ end
    from #temp1 a
    inner join #temp2 b on a.fname = b.fname
    where b.T2_ID in (select top 100% T2_ID from #temp2 order by T2_ID asc)

    The Merge clause actually errors because it attempt to update the same record.  I think this CTE statement is the closest I've come but I'm still working through it as I'm not too familiar w/ them.  It returns multiple rows which I will have to
    insert into a temp table to update since the resulting row I need is the last in the table.
    ;WITH cteRowNumber
    AS(
    Select DISTINCT
    Row_Number() OVER(PARTITION BY a.LName ORDER BY a.LName ASC, a.Rank_ DESC,b.T2ID ASC) AS RowNumber
    ,a.FName
    ,a.LName
    ,b.LName as xLname
    ,a.MName
    ,b.MName AS xMName
    ,a.Rank_
    ,b.Rank_ AS xRank
    ,b.T2ID
    FROM #temp1 a
    inner join #temp2 b
    ON a.fname = b.fname
    ), cteCursor
    AS(
    Select a.RowNumber,
    a.Fname
    ,a.LName
    ,a.xLname
    ,a.MName
    ,a.xMName
    ,a.xRank
    ,a.T2ID
    ,CASE WHEN a.Rank_ >= a.xRank THEN ISNULL(a.xRank,a.Rank_) else ISNULL(a.Rank_,a.xRank) end AS Alt_Rank_
    ,CASE WHEN a.Rank_ >= a.xRank THEN ISNULL(a.xMName,a.MName) else ISNULL(a.MName,a.xMName) end AS Alt_MName
    ,CASE WHEN a.Rank_ >= a.xRank THEN ISNULL(a.xLName,a.lname) else ISNULL(a.LName,a.xlname) end as Alt_Lname
    FROM cteRowNumber a
    where a.RowNumber = 1
    UNION ALL
    Select crt.RowNumber
    ,crt.FName
    ,crt.LName
    ,crt.xLname
    ,crt.MName
    ,crt.xMName
    ,crt.xRank
    ,crt.T2ID
    ,CASE WHEN Prev.Alt_Rank_ >= crt.xRank THEN ISNULL(crt.xRank,Prev.Alt_Rank_) else ISNULL(Prev.Alt_Rank_,crt.xRank) end AS Alt_Rank
    ,CASE WHEN Prev.Alt_Rank_ >= crt.xRank THEN ISNULL(crt.xMName,Prev.Alt_MName) else ISNULL(Prev.Alt_MName,crt.xMName) end AS Alt_MName
    ,CASE WHEN Prev.Alt_Rank_ >= crt.xRank THEN ISNULL(crt.xLName,Prev.Alt_Lname) else ISNULL(Prev.Alt_Lname,crt.xLName) end as Alt_Lname
    FROM cteCursor prev
    inner join cteRowNumber crt
    on prev.fname = crt.fname and prev.RowNumber + 1 = crt.RowNumber
    SELECT cte.*
    FROM cteCursor cte

  • How to update software on multiple iPhones using same iTunes account?

    How to update software on multiple iPhones using same iTunes account?

    SeanB15 wrote:
    Here are more details on my situation which should help clarify things...
    I purchased three iPhone 4 models back when they first came out (for my family) that all share the same iTunes account for access to apps and music, but each phone/user still has his/her custom contact list, email accts, and select lists of apps and music from the one iTunes acct library.  The problem is (as I understand it) that I can only update the software on one of the three iPhones – the primary phone I used to setup the iTunes acct without wiping out the separate contact lists, etc. As it stands today... the first (primary) iPhone associated with the iTune acct has been updated with the latest software version 5.1.1 and sync'd up with all the apps, music, etc from the one iTune acct, while the other two iPhones are still running on the original software version 4.0.2 and are experiencing problems now. I was advised by AT&T back in January that it would be necessary to setup separate iTunes accts for the second and third iPhones in order to receive system updates and still be able to manage separate contact lists, etc. If I go this route, I assume we will lose all the apps on phones #2 and #3 that we have been "sharing"... correct? Since this AT&T advice was prior to iCloud coming out, would iCloud be a better solution or at least part of the solution? I really don't yet understand how iCloud works. Hopefully, one of you can help me??
    we have 2 iphone 4's synced to the same itunes account for apps and music since the day we bought them, but each has a different icloud acct. they have both been updated on the same itunes account with every update that has come out since we bought them in december of 2010. nothing on either phone has ever been lost or duplicated. having said all that, maybe i'm missing something here, but we have had no problems. we do have itunes setup to sync manually. i do believe i'm a piker compared to lawrence finch, but i'm just telling you what happens in my house. maybe check with apple? is there a store near you?

  • Update Multiple Rows using Row Selector

    Hi,
    I want to update multiple rows using a tabular form with row selector, and an item in another region of the page, using an update expression and a button.
    The syntax would be like this:
    update MY_TABLE set UPDATABLE_COLUMN = :P10_NEW_VALUE where {row selector = true}
    What is the syntax for the WHERE clause, anyone knows? In the manual there is no information at all for doing this.
    PD. I added the row selector after creating the form, so I don't have any wizard-created MRU processes in the page.
    HTMLDB version is 1.6
    Thanks.

    Hi,
    I want to update multiple rows using a tabular form with row selector, and an item in another region of the page, using an update expression and a button.
    The syntax would be like this:
    update MY_TABLE set UPDATABLE_COLUMN = :P10_NEW_VALUE where {row selector = true}
    What is the syntax for the WHERE clause, anyone knows? In the manual there is no information at all for doing this.
    PD. I added the row selector after creating the form, so I don't have any wizard-created MRU processes in the page.
    HTMLDB version is 1.6
    Thanks.

  • Updating multiple tables using JDBC Adapter

    Hi,
    I am trying to insert/update multiple tables using one message via JDBC adapter. The following is the message being posted. However, only the first statement was executed. Anything wrong?
    Thanks in advance!
    Hart
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:DeliveryDBUpdate xmlns:ns0="http://test.com/r3_integration"><DeliveryData><DelHeader action="UPDATE_INSERT"><table>DelHeader</table><access><DelNo>0080000230</DelNo><DelType>LF</DelType><XOverwrite>X</XOverwrite><ShipTo>0000000026</ShipTo><SoldTo>0000000026</SoldTo><Priority>00</Priority><DocDate>02/17/2007</DocDate><GText>CIF Test</GText><DelDate>02/20/2007</DelDate><PickDate>02/20/2007</PickDate><ShipPoint>NO02</ShipPoint><PackCount>00000</PackCount></access><key><DelNo>0080000230</DelNo></key></DelHeader>
    <DelItem action="INSERT"><table>DelItem</table><access><DelNo>0080000230</DelNo><ItemNo>000010</ItemNo><GText>10# GRAN-GREAT VALUE</GText><Material>G04410G611</Material><Plant>6005</Plant><SLoc>6005</SLoc><RefDoc>mmenon32</RefDoc><RefItem>00000000</RefItem><DelQty>5.000</DelQty><UOM>BL</UOM></access><access><DelNo>0080000230</DelNo><ItemNo>000020</ItemNo><GText>25# GRAN- GREAT VALUE</GText><Material>G04025G611</Material><Plant>6005</Plant><SLoc>6005</SLoc><RefDoc>mmenon32</RefDoc><RefItem>00000000</RefItem><DelQty>5.000</DelQty><UOM>BG</UOM></access></DelItem></DeliveryData></ns0:DeliveryDBUpdate>

    Hi,
    You need 2 STATEMENT level tags,
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:DeliveryDBUpdate xmlns:ns0="http://test.com/r3_integration">
    <b><DeliveryData1></b>
    <DelHeader action="UPDATE_INSERT">
    <table>DelHeader</table>
    <access>
    <DelNo>0080000230</DelNo>
    <DelType>LF</DelType>
    <XOverwrite>X</XOverwrite>
    <ShipTo>0000000026</ShipTo>
    <SoldTo>0000000026</SoldTo>
    <Priority>00</Priority>
    <DocDate>02/17/2007</DocDate>
    <GText>CIF est</GText>
    <DelDate>02/20/2007</DelDate>
    <PickDate>02/20/2007</PickDate>
    <ShipPoint>NO02</ShipPoint>
    <PackCount>00000</PackCount>
    </access>
    <key>
    <DelNo>0080000230</DelNo>
    </key>
    </DelHeader>
    <b><DeliveryData1></b>
    <b><DeliveryData2></b>
    <DelItem action="INSERT">
    <table>DelItem</table>
    <access>
    <DelNo>0080000230</DelNo>
    <ItemNo>000010</ItemNo>
    <GText>10# GRAN-GREAT VALUE</GText>
    <Material>G04410G611</Material>
    <Plant>6005</Plant>
    <SLoc>6005</SLoc>
    <RefDoc>mmenon32</RefDoc>
    <RefItem>00000000</RefItem>
    <DelQty>5.000</DelQty>
    <UOM>BL</UOM>
    </access>
    <access>
    <DelNo>0080000230</DelNo>
    <ItemNo>000020</ItemNo>
    <GText>25# GRAN- GREAT VALUE</GText>
    <Material>G04025G611</Material>
    <Plant>6005</Plant>
    <SLoc>6005</SLoc>
    <RefDoc>mmenon32</RefDoc>
    <RefItem>00000000</RefItem>
    <DelQty>5.000</DelQty>
    <UOM>BG</UOM>
    </access>
    </DelItem>
    <b></DeliveryData2></b>
    </ns0:DeliveryDBUpdate>
    Try with such a strcuture and let us know if it works.
    Regards
    Bhavesh

  • Need to update multiple records using store procedure

    Hi i am trying to update multiple records using store procedure but failed to achieve pls help me with this
    for example my source is
    emp_name sal
    abhi 2000
    arti 1500
    priya 1700
    i want to increase salary of emp whose salary is less than 2000 it means rest two salary should get update..using stored procedure only
    i have tried following code
    create or replace procedure upt_sal(p_sal out emp.sal%type, p_cursor out sys_refcursor)
    is
    begin
    open p_cursor for
    select sal into p_sal from emp;
    if sal<2000 then
    update emp set sal= sal+200;
    end i;f
    end;
    and i have called the procedure using following codes
    set serveroutput on
    declare
    p_sal emp.sal%type;
    v_cursor sys_refcursor;
    begin
    upt_sal(p_sal,v_cursor);
    fetch v_cursor into p_sal;
    dbms_output.put_line(p_sal);
    end;
    the program is executing but i should get o/p like this after updating
    1700
    1900
    but i am getting first row only
    2000
    and record is not upsating...please help me with this
    thanks

    Hi Alberto,
    thanx for your valuable suggestion. but still i have doubt. the code which i have mentioned above might be simple but what if i have big requirement where i need update the data by using loops and conditional statement.
    and i have similar kind of requirement where i need to deal with procedure which returns more than one row
    my source is
    empno ename salary
    111,abhi,300
    112,arti,200
    111,naveen,600
    here i need to write a store procedure which accepts the empno (111) as input para and display ename and salary
    here i have written store procedure like this
    create or replace procedure show_emp_det(p_empno in emp.empno%type, p_ename out emp.ename%type,p_salary out emp.salary%type, p_cursor out sys_refcursor)
    is
    begin
    open p_cursor for
    select ename,salary into p_ename,p_salary from emp where empno=p_empno;
    end;
    and i have called this by using
    declare
    p_salary emp.salary%type;
    p_ename emp.ename%type
    v_cursor sys_refcursor;
    begin
    show_emp_det(111,p_ename,p_salary,v_cursor);
    fetch v_cursor into p_ename,p_salary;
    dbms_output.put_line(p_ename);
    dbms_output.put_line(p_salary);
    end;
    here i should get
    abhi,300
    naveen,600
    but i am getting first row only
    abhi,300
    but i want to fetch both rows...pls help me to find the solution

  • Update multiple records using checkbox

    Hi All,
    I have one requirement related to multiple record update using checkbox.
    HTML form has 6 columns and many rows.
    Now i want to update all 6 columns in the table for selected checkbox.
    Can any body give me some idea/code about this.
    Thanks in advance.
    Ravi

    I did not understand your idea.
    multiple columns can be updated as follows...
    update table set col1=value,col2=value,col3=value where conditions;
    We are using adodb driver in our environment. So I will explain concern to it. Store all the form new values in $var array and you can pass this $var to query execution.
    A vague idea
    $rs = $conn->Execute($update_sql,$var);     
    if ($rs===false) die('DB Error: '. $conn->ErrorMsg() );

  • How to update a column using hibernate

    how to update a particular column using hibernate..
    iam using oracle database

    I think you didn't get the point. This is a generic Java forum... not a Hibernate forum.

  • Adding data to multiple tables using one form in Access 2010?

    Hi All,
    I have a access database with two tables and I want to create a single form to enter data into that tables.
    How to adding data to multiple tables using one form in Access 2010?
    I don't have to much knowledge of access database?
    Please help me
    Thanks
    Balaji

    You really don't enter identical data into 2 tables.  You enter dat into one single table, and then you have an unique identifier that maps to another table (you have a unique relationship between two tables). 
    Maybe you need to read this.
    http://office.microsoft.com/en-001/access-help/database-design-basics-HA001224247.aspx
    Think about it this way...  What is you update data in 2 tables, and then the data in one of those tables changes, but the data in the other table does NOT change.  WHOOPS!!  Now, you've got a BIG problem.  For instance, you have a customer
    named Bill Gates.  In one Table you update Bill's address to 1835 73rd Ave NE, Medina, WA 98039 and in the other table you accidentally update Bill's address to 183 73rd Ave NE, Medina, WA 98039.  Now you have 2 addresses for Bill.  Why would
    you want that???  Which is right?  No one knows.  If you have one address, you just have to update one address and if there is a mistake, you just have to update one address, but you don't have to waste time trying to figure out which is right
    and which is wong...and then update the one that is wrong.
    Post back with specific questions.
    Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.

  • How to merge with multiple updates

    Hi All,
    can someone help with merge and multiple updates when matched ?
    create table foo
    id number,
    name varchar2(30),
    col1 date,
    col2 date
    create table bar
    id number,
    name varchar2(30),
    col1 date,
    col2 date
    insert into foo values ( 1, 'test1', sysdate + 30, sysdate);
    insert into foo values ( 2, 'test2', sysdate + 30, sysdate);
    insert into foo values ( 3, 'test3', sysdate + 30, sysdate);
    MERGE INTO BAR T1
    USING (SELECT id, NAME, col1, col2 FROM foo) T2
    ON (T1.id = T2.id)
    WHEN MATCHED THEN
    UPDATE SET T1.NAME=T2.NAME where T1.Name != T2.Name
    UPDATE SET T1.col1=T2.col1 where T1.col1 != T2.col1
    UPDATE SET T1.col2=T2.col2 where T1.col2 != T2.col2
    WHEN NOT MATCHED THEN
    INSERT (ID, NAME, col1, col2 ) VALUES (t2.Id, t2.NAME, t2.col1, t2.col2);
    Reason for having multiple updates to same row is i want to update the column only if name, col1, and col2 columns have changed. So, I want to first match by rows and then update the columns in bar that have changed in foo.
    Any thoughts on how I might do this in merge ?. I get the foll. error
    ERROR at line 6:
    ORA-00933: SQL command not properly ended
    Thanks
    Vissu

    I think you will be better off reading this link.
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_9016.htm#SQLRF01606
    It will be something like this.
    MERGE INTO BAR T1
    USING (SELECT id, NAME, col1, col2 FROM foo) T2
    ON (T1.id = T2.id)
    WHEN MATCHED THEN
    UPDATE SET T1.NAME=T2.NAME ,
                          t1.col1 = t2.col2 ,
                          t1.col2 = t2.col2
    where T1.Name != T2.Name or t1.col1 != T2.col1 or t1.col2 != t2.col2
    WHEN NOT MATCHED THEN
    INSERT (ID, NAME, col1, col2 ) VALUES (t2.Id, t2.NAME, t2.col1, t2.col2);Please note this code is untested.
    Regards
    Raj

  • Using Hibernate Functionality and pass it on to the JCAPS Oracle eWay

    Hi All,
    I need to use the Existing Hibernate API's and pass it on to the JCAPS oracle eWay to persist the Data.
    As the present Application is using the Hibernate for persisting the Data as we have parent child relation with multiple tables , so we need to push the whole thing in to JCAPS.
    Thanks & regards
    Srikanth

    narayanaa wrote:
    Hi,
    You cannot use hibernate using oracle or any other database eWays. If you want to leverage the same or the existing code you have for the Data Access you use JCD.
    So what you can do is have the required jars available for the application and then use the available classes with in the JCD.
    Thanks,
    NarayanaaI don't think that is secesarily true. You can use oracle eWay to handle the database connection, pooling and XA transactions. You just retrieve the java.sql.Connection object from the eWay and use that in you hibernate code.
    -Mario

  • How to handle multiple updates and creates sequentially

    Hi All,
    I have a requirement where multiple updates and creates will happen on an Order (say Purchase Order). I need to capture all these updates/creates and synchronize the other system in real time. In other words, as soon an order is updated/created in EBS, the same needs to be reflected in other system database.
    I have thought of using a JMS queue that'll store all the incoming creates/updates and a BPEL process will keep polling this queue. But in this case how do I ensure the sequence in which the new instances will be created. e.g. create order message was picked first from the queue and an instance got created. While this instance was in execution, another update happened on the same order for which another instance got created. Now before the first instance could get completed and created an order, second instance is trying to update the custom database because of which it would fail. How to restrict second instance from running before the completion of the first one?
    I have also thought of capturing Order Update/Create business events from EBS but there also the same problem. Instance created by Update event can try to do the update before the instance created by Order Create could create a new order.
    Any method to solve this.
    Any pointers/suggestions/approaches are more than welcome.
    SOA Suite 11.1.1.3
    Regards,
    Neeraj Sehgal

    maybe unit of order and unit of work can help you on that, though i haven't any experience on both topics :
    http://download.oracle.com/docs/cd/E12840_01/wls/docs103/jms/uow.html
    http://download.oracle.com/docs/cd/E12840_01/wls/docs103/jms/uoo.html
    or the mediator supports some sort of sequencer, see : http://www.xenta.nl/blog/2010/05/14/oracle-soa-suite-11g-resequence-messages-in-mediator/

  • How to build a Report/Form sharing the same page and do multiple Updates

    Hi, I´m building and APEX application (V4.2). Customer is demanding a report/form with the ability to do multiples Updates with only one click. For example, they check multiples "check box" for Aprpove and then only one click for  "Apply Changes".
    Thanks in advance,
    Luis E Contreras

    Hi Luis,
    If I understand you correctly you want to check a number of rows for approval and update their status. The jQuery function used looks for checked checkboxes. In your case that will correspond with an update on the IND_PROBACION column. You can simply log the PK column value of each checked row:
    var pkS = $('.uReportStandard input[type=checkbox]:checked').map(
       function() {
       return $(this).parent().parent().find('td[headers="PK"] input').val();
       ).get().join(':');
    $('#P1_PKS').val(pkS);
    You need to replace PK with the actual column name of your primary key column, or rowid for that matter.
    In your submit process you can simply set each IND_PROBACION to your apporval value for each pk stored in the P!_PKS item.
    If you need further assistence, please set up an example on apex.oracle.com
    Regards,
    Vincent
    http://vincentdeelen.blogspot.com

  • Insert into multiple tables using a page variable

    Hi Guys,
    I was going to trawl the PL/SQL forum for this but as I need to use a page variable I thought I would try here first.
    I have 4 tables 2 live and 2 archive, company_table, company_table_arch, product, product_arch the tables are set up with a company Id as the join.
    you can have multiple products to a company.
    what I want to do is have an archive button on a form that will select the current record on the company table, and insert it into archive then select all records with that id in the product table and insert them into the product_arch table.
    I was thinking about doing this as a couple of page proccess, sound about right?
    the other option was using a package,
    is it possible to use page variables in a package? If so what is the sintax
    cheers
    Bjorn

    OK, I have got the basis of this working I press the archive button and the records update as per the code.
    I have one problem however.
    The button is on a form. and if the user updates the form then presses the archive button it copies the data before the table is updated (the table is updated using a save button).
    One way round this would be to jump to an "are you sure?" page
    Does anyone know a better way of doing this?
    cheers
    Bjorn

  • Cannot attach multiple photos using the ' Message ' option iOS 5.0.1 in  ' Photos ' app.

    Since i have updated my iPhone 4 to iOS 5.0.1 i cannot attach multiple photos using the ' Message ' option in the  ' Photos ' app.
    i browse my photos and then select ' Message ' on a photo. i am then able to attach the first image to the message.
    When i then select the Camera icon on the created message to add another image ,  either  ' Choose existing ' or ' Take Photo or Video ' ,  it does nothing and takes you back to your existing message.
    I am able to attach multiple images when accessing the iMessage app  it is just from the Photos app it is occuring
    is anyone else having the same issue ?

    You can submit the feedback to Apple here:
    http://www.apple.com/feedback

Maybe you are looking for

  • How to fix Online help issue with F1

    Dear All, I think you already know this issue : when using a proxy, Online help is not working on Adobe Reader XI. message displayed : "Online Help content cannot be displayed. Verify you can launch your web browser and have access to the Internet."

  • Connecting multiple companies at a time????

    hi all,          Can we connect to multiple companies at a time through DI-API.this is the coding where i connect to single company through combobox..        oCompany.CompanyDB = Combo1.Text         oCompany.UserName = Text1.Text         oCompany.Pas

  • Enhancement Required for filling Reference No(LFBNR) in MIGO Tx

    Hi All, In Migo Transaction , when i am doing plant to plant goods transfer , i am entering source plant and target plant and doing posting of the material, and one document no .(MBLNR)is generated for a movement type . Now by taking the same documen

  • Exchange 2013 ECP 500 Error

    We are in the beginning phase of migrating from Exchange 2010 to Exchange 2013. When I login to the exchange 2013 admin console and navigate to servers it does not show me any of my servers. When I navigate to mailflow-receive connectors I receive a

  • Cannot install Flash 10.3 on Windows 7

    I thought this would be the best place to start this discussion. I've tried every trick in the book to install flash updates on my system with no luck. A few of my applications need Flash Player so I'm pulling my hair out at this stage. Everytime I u