Xquery update transaction (xqilla)

Hi,
it seems that when performing an xquery update such as 'insert node' that a transaction is allocated for this query, so that (using the Java API) there is no need to explicitly create a transaction - is this true?
If it is, then just using xquery gets rid of a transaction management problem and the try/finally.
thanks,
Norman

An updating query is auto-transacted if a transaction is not provided. However, auto-transacted methods still need to catch deadlock exceptions and retry.
John

Similar Messages

  • XQuery Update Facility

    I see on the Wikipedia article for XQuery Update Facility, that XQilla, which BDBXML uses, implements the XQUF (not sure to which degree though). Can you utilize these commands in any XQuery, and does it require a special use of the API? Any documentation on your site? This looks like a very exciting language extension to have available.
    thank you,
    Brett

    Brett,
    Thanks. This also means XmlModify will eventually disappear since it's no longer
    necessary (and now implemented in terms of XQuery Update anyway). It's still around for
    now.
    As for security, we're considering one or both of:
    1. bool XmlQueryExpression::isUpdateExpression() to allow the application
    to ask the question and decide.
    2. A flag (e.g. DBXML_NO_UPDATES) passed to the relevant execute() and query() functions. In Java it'd be a new configuration option in XmlDocumentConfig
    Do you have a preference? I'm leaning toward (1) -- it's a slightly simpler change
    and just as easy to use.
    Regards,
    George

  • Decreasing performance when executing consecutive XQuery Update operations

    hello,
    I am writing an application in java using Berkeley DB XML (2.5.16). I have to run a test over the application, in which a lot of XQuery Update operations have to be executed. All update operations are insert statements. In the beginning the test works fine. However, as the number of updates increases (over 1000 XQuery Updates), there is also a great increase in time of execution. How can I enhance the performance of updates?
    Note that:
    1) The environment configuration is the following:
    EnvironmentConfig envConfig = new EnvironmentConfig();
    envConfig.setAllowCreate(true);
    envConfig.setInitializeCache(true);
    envConfig.setCacheSize(512*1024*1024);
    envConfig.setInitializeLocking(false);
    envConfig.setInitializeLogging(false);
    envConfig.setTransactional(false);
    2) No transactions are used
    3) The container is a node container
    4) Auto-indexing is on (I need that)
    5) The container includes only one xml of 2,5MB size.
    6) In some insert statements 1000 nodes are to be inserted.
    7) I am running windows vista on a 4GB Ram pc.
    Thank you in advance,
    theo

    Hi Lucas,
    Thanks a lot for your reply! However, I have a few more questions.
    Given that the xml is about 2.5MB size, is it considered to be that big for Berkeley DB so it needs to be break down into smaller documents?
    Also, after having executed ~4000 xquery update insert operations and doubled xml’s size, the performance it’s really getting worse… An insertion may even take 1.5 min, when for each of the first 3000 insertions only less than 0.5 sec is needed… Is there something I am missing in the configuration of Berkeley DB? If I set autoindexing off and try to maintain fewer indexes, is it possible to see significantly better performance? Till now I am just getting the following error when I set my indexes and try to execute consequent insertions over the same node:
    Exception in thread "main" com.sleepycat.dbxml.XmlException: Error: Sequence does not match type item() - the sequence does not contain items [err:XUDY0027], <query>:1:1, errcode = QUERY_EVALUATION_ERROR+
    at com.sleepycat.dbxml.dbxml_javaJNI.XmlQueryExpression_execute__SWIG_1(Native Method)
    at com.sleepycat.dbxml.XmlQueryExpression.execute(XmlQueryExpression.java:85)
    +<myClasses>+
    Thanks,
    theo

  • Updating transaction MD61 using information from inbound IDOC

    Is there any standard IDOC type for Planned Independent Requirement(having fields of table PBED and PBIM in its segment)?If such an IDOC type doesnt exist then i have to go for custom idoc type creation
    I have an inbound IDOC having 4 fields in its segment
    1.SAP Material number
    2.Plant
    3.Plant Quantity
    4.Requirement date
    Now i have to use this information in IDOC to update transaction MD61(create a planned order).
    constraints:
    in MD61 screen1
    SCREEN 1
    Material radio button is defaulted to on. This must also be set in the interface. Material number will be valued from the input file.
    Plant will be valued from the input file.
    Version number defaults to 00, so that value should also be used for the interface.
    Planning Horizon From and To dates will be the same date and valued from the input file.
    Planning Period should be set to D for Day
    SCREEN 2
    Material number should default from SCREEN 1 input. The interface should also do this.
    MRP Area will default from the Plant on SCREEN 1 input. The interface should also do this.
    Version will default from the 00 on SCREEN1. If needed on interface, also default to 00.
    Version Active checkbox will be checked by default.
    Base Unit of Measure will default from material master.
    Only a single date column will appear which should be the date input on SCREEN 1. Value this column with the quantity from the input file.
    Input fields are highlighted in screenshots below.
    After input is complete, use the SAVE icon to store the data.
    Kindly tell me the approach to prepare this interface?

    Done,used BAPI_REQUIREMENTS_CREATE TO DO SO

  • How to update transaction data automatically into MySQL database using PI

    Dear All,
    With reference to subject matter I want a sincere advice regarding how to update transaction data automatically into MySQL database using PI. Is there any link available where I can get step-by-step process.
    Ex: I have a MYSQL database in my organization. Whenever a delivery created in SAP some fields like DO Number, DO quantity, SO/STO number should get updated in MYSQL database automatically.
    This scenario is related to updation of transactional data into MYSQL DB and I want your suggestions pertaining to same issue.
    Thanks and Regards,
    Chandra Sekhar

    Hi .
    Develop a sceanrio between SAP to Database system,When the data updates in SAP Tables read the data and update it in DATA Base using JDBC adapter,but there will be some delay in updating data in MySQL.
    serach in sdn for IDOC-TOJDBC sceannario,many documents available for the same.
    Regards,
    Raja Sekhar

  • Xml Validation & XQuery Update

    Hello,
    I have a question on xml validation in Berkeley DB XML (2.5.16).
    I read in documentation that an xml can be validated against an xml DTD or Schema when is loaded into a container. However, when an XQuery Update is to be executed is there any configuration that allows checking if the XQuery Update leads to an xml that does not conform with the DTD/Schema? If so, how this case is managed? The XQuery is executed, or not? Is there any exception thrown?
    I made a test over this: I wrote an xml (and a related DTD) where an element contains an id attribute and another element a referencing attribute to the aforementioned id. Then, an XQuery Update 'delete' expression deletes the element with the id attribute. The element is indeed deleted, the xml is left in an inconsistent state and I am allowed of making more update operations to this document...
    I was wondering if there is any way of handling this case, except from being careful with what updates you choose, so that the xml is kept in a valid state. Is there something I am missing?
    thank you in advance,
    theo

    Hello,
    I believe that XQuery execution does not support DTD yet. I'll investigate further and let you know what else I can find.
    Thanks,
    Sandra

  • Use of XQuery Update Facility

    Dear all,
    I am looking for some database systems that use the W3C XQuery Update facility specification to modify their data.
    To the best of my knowledge, no of well-known commercial database systems uses XQuery Update primitives.
    For instance, Oracle 11g defines some SQL/XML update functions (combined with some XQuery expressions) to modify XML data stored within the database through the XMLType data type.
    IBM DB2 9 uses SQL update statement to modify the whole XML document stored as an XML column and no update is proposed to modify parts of the document.
    Are there some database systems providing XQuery-Update-Facility-based update of their data.
    Thank you in advance.
    Best regards.

    Were you aware of
    [url http://www.liberidu.com/blog/2011/09/22/oracle-xmldb-xquery-update-in-database-release-11-2-0-3-0/]Oracle XMLDB XQuery Update in Database Release 11.2.0.3.0
    Given it is new, expect a few bugs, such as
    {thread:id=2355054}
    If you have specific questions related to XQuery Update, the best place to ask them is over in the {forum:id=34} forum.

  • XML DML XQuery Update syntax

    Hi everybody,
    Certainly my question will appear strange and even stupid , but I want to be sure to use the best syntax and also to be confirmed about some points.
    In the document Oracle XML DB Best practices, we can find a lot of statements for modifying XML documents. In page 11 and 12 we have statements with and without XQuery syntax. What is exactly the best way ? Using insertchildxml, updatexml or the update statement with the XMLQuery clause ?
    Why we use copy in these statement, but the keyword copy is not used in a XQuery expression.
    I think copy is not specific to Oracle, is it used in XQuery language ?
    In page 15, the SQL statement to modify XML document uses deletexml, not a XQuery update syntax.
    I'm using Oracle 11G.
    Thanks in advance for your explanations

    user4423142 wrote:
    In the document Oracle XML DB Best practices, we can find a lot of statements for modifying XML documents. In page 11 and 12 we have statements with and without XQuery syntax. What is exactly the best way ? Using insertchildxml, updatexml or the update statement with the XMLQuery clause ?The recommended way is closely tied to the version you're using, which you didn't give.
    "11g" is not a version, it's a product name.
    You can find the version by running :
    SQL> select * from v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    PL/SQL Release 11.2.0.3.0 - Production
    CORE     11.2.0.3.0     Production
    TNS for Linux: Version 11.2.0.3.0 - Production
    NLSRTL Version 11.2.0.3.0 - Production
    XQuery Update on Oracle in available in the latest version only : 11.2.0.3.
    If you're using this version, Oracle recommends you start using XQuery Update.
    Why we use copy in these statement, but the keyword copy is not used in a XQuery expression.
    I think copy is not specific to Oracle, is it used in XQuery language ?<tt>copy</tt> is specific to the XQuery Update Facility (XQUF) extension of the XQuery 1.0 language.
    The XQUF was primarily intended to work with native XML databases where it's OK to directly invoke update primitives (insert, delete, replace etc.) to modify database content.
    On Oracle, it's not possible and the current implementation only supports XQUF through the "transform" operation (copy/modify syntax) where a copy of the original document/fragment is modified and written back to the db.
    However, XQuery rewrite and related optimizations may occur so that piecewise updates actually take place.

  • XQuery Update implementation

    Hello,
    is it possible to get prerelease of the next version of DBXML or at least the documentation focused on XQuery Update implementation.
    Thanks
    Mario

    Mario,
    2.4 will be generally available quite soon. The Getting Started Guides in the documentation have sections on basic XQuery Update usage (replacing the old sections on XmlModify). The candidate recommendation is a detailed (if not user-friendly) source of information:
    http://www.w3.org/TR/xquery-update-10/
    Regards,
    George

  • XQuery update

    Hello,
    I seems that the CVS version of XQuilla implements a large part of the XQuery Update working draft, which is great !
    Does it mean that it's usable with BDB XML as-is to get database updates ?
    Thanks,
    Fabrice

    Hi Fabrice,
    I'm afraid there is significant work to do in DB XML before XQuery Update can be used from it. However, It is our intention to support XQuery Update in some future version.
    John

  • XQuery Update Facility in XMLDB?

    Hi
    I didn't find information about XQuery Update Facility
    support or XUpdate support in Oracle XML DB. Do you have
    such info?
    Regards,
    --drkm                                                                                                                                                                                                                                                                                                                           

    Xquery update is NOT anywhere near well enougth defined for us to implement it at present. We are actively involved in the standards process for XQuery update. It's very unclear what the future of the XUpdate is at this point...
    We support node-level updates through a set of SQL functions
    updateXML (9iR2 and later), insertChildXML, appendChildXML, insertXMLBefore and deleteXML (10gr2 and later)
    Message was edited by:
    mdrake

  • XQuery Update (11.2.0.3) and the path table

    Hi,
    I'm currently using XQuery update on 11.2.0.3 to merge 2 XML documents, having tried a number of approaches up to now on 11.2.0.2.
    My table has one XMLType column (securefile binary containing unstructured xml) which has XML deltas applied to it via a stored procedure.
    An unstructured XML index is defined on the column.
    Previously, I was doing the following:
    1) Merge documents using XMLQuery; only produce a merged document if changes were detected
    2) Update the table if the merged document is non-null
    i.e.
    select XMLQuery(<merging code>) passing oldDoc as "oldDoc", delta as "delta" returning content) into mergedDoc from dual;
    if (mergedDoc is not null) then
        update myTable set xmlDoc = mergedDoc where id=v_id;
    end if;However, this replaces the entire document if any changes are detected (with an obvious impact on the path table).
    I then read (UpdateXML query rewrite with unstructured data? about the use of XQuery Update in 11.2.0.3 to only target the affected document fragments so my current approach is:
    update myTable
    set xmldoc =
            xmlquery('declare namespace m="http://www.blah.com/merge";
            (: See if two nodes have matching text (or no text which is an empty sequence :)
            declare function m:matchText($one as element(), $two as element()) as xs:boolean {
                if ($one/text() = $two/text() or count($one/text())=0 and count($two/text())=0) then true() else false()
            declare updating function m:merge($old as element()?, $new as element()?) {
                (for $o in $old/* return
                    for $n in $new/* where name($o) = name($n) return
                        if (count($n/*) > 0) then
                            m:merge($o, $n)
                        else
                            if (m:matchText($n, $o)) then () else replace value of node $o with $n,
                    for $n in $new/* where (not(some $o in $old/* satisfies name($o) = name($n))) return insert node $n into $old)
            copy $d := .
            modify (
                (m:merge($d/*,$delta/*))
            ) return $d'
            passing xmldoc, delta as "delta"
            returning content)
    where id = v_id;If no changes were detected between the documents (i.e. the XQuery update did not actually modify the document), would you expect this statement to have no impact on the path table? Is there any way to get more trace information which shows what the update is actually doing when it executes?
    Apologies if this is overlong or if I have omitted any supplementary information.
    Thanks for any assistance
    Larry

    Hi,
    many thanks for your reply.
    A simple testcase is below. The recursive approach is required because the documents may be hierarchial.
    create table mytable (id number(19,0), xmldoc xmltype) xmltype column "XMLDOC" store as securefile binary xml;
    insert into myTable values (1,xmltype('<xml><el1>1</el1><el2>2</el2><el3>3</el3></xml>'));
    update myTable
    set xmldoc =
            xmlquery('declare namespace m="http://www.blah.com/merge";
            (: See if two nodes have matching text (or no text which is an empty sequence :)
            declare function m:matchText($one as element(), $two as element()) as xs:boolean {
                if ($one/text() = $two/text() or count($one/text())=0 and count($two/text())=0) then true() else false()
            declare updating function m:merge($old as element()?, $new as element()?) {
                (for $o in $old/* return
                    for $n in $new/* where name($o) = name($n) return
                        if (count($n/*) > 0) then
                            m:merge($o, $n)
                        else
                            if (m:matchText($n, $o)) then () else replace value of node $o with $n,
                    for $n in $new/* where (not(some $o in $old/* satisfies name($o) = name($n))) return insert node $n into $old)
            copy $d := .
            modify (
                (m:merge($d/*,$delta/*))
            ) return $d'
            passing xmldoc, xmltype('<xml><el1>1-UPDATE</el1><el4>4</el4></xml>') as "delta"
            returning content)
    where id = 1;This results in one update and one insert:
    <xml><el1>1-UPDATE</el1><el2>2</el2><el3>3</el3><el4>4</el4></xml>It currently produces the following trace:
    *** 2012-03-13 10:13:34.708
    not delete/insert/replace in modify clause
    --------- XQuery NO rewrt expr END-----
    --------- XQuery NO rewrt expr BEG-----
    UDF with noderef
    --------- XQuery NO rewrt expr END-----I've noticed that even with a simple XQuery update like the following:
    update myTable set xmldoc =
            xmlquery('copy $d := .
            modify (
                (replace value of node $d/xml/el1 with "1-UPDATE-2",insert node <el4>4</el4> into $d/xml)
            ) return $d'
            passing xmldoc
            returning content) where id = 1;I get the following trace:
    *** 2012-03-13 10:31:42.280
    --------- XQuery NO rewrt expr BEG-----
    non-simple content in target expression
    --------- XQuery NO rewrt expr END-----
    --------- XQuery NO rewrt expr BEG-----
    not delete/insert/replace in modify clause
    --------- XQuery NO rewrt expr END-----
    Non-iterator usage
    Non-iterator usageDoes this also indicate that a rewrite is not occurring, or is this only when a message like "NO REWRITE Reason ==> xseq:not optuop" is traced?
    I'll try XSLT in the meantime.
    Regards
    Larry

  • Startroutine issue when updating transactional DSO from parallel process

    Hi
    I have the following issue.
    In a start routine i do some processing of data. In some cases errors missing master data creates a potiential error but does not stop the processing. What i want to achieve is the following.
    I have created a transactional DSO where i want to update information about the records where issues is found in processing. I use a standard ABAP modify statement to update the DSO. This works fine when i run the DTP in 1 batch process but i get errors when i run the DTP in parallel.  The problem is related to the database locking of the DSO table. I have tried to play around with ENQUEUE but cant get it right.
    Any input to get this to work in parallel would be appreciated.
    /Chris

    Hi ,
    fiscal year variant, go into Customizing for Financial Accounting (FI) under Financial Accounting Global Settings >>>Fiscal Year >>>Maintain Fiscal Year Variant.
    check this link ..
    http://help.sap.com/saphelp_scm41/helpdata/en/50/0d89f2ad919c40b95b9ae7583c8c96/frameset.htm
    http://help.sap.com/saphelp_scm41/helpdata/en/50/0d89f2ad919c40b95b9ae7583c8c96/content.htm
    Regards,
    shikha

  • Is it possible with out BPM- update transaction from flat file - XI -RFC

    Hi
    my requirment is:  i need to update 2 values transaction(ks01)
    Required data we get in flat file(Val1,Val2), that data needs to be updated in transaction KS01 in r/3 system.
    Scenario is: Flat file - XI - Rfc -KS01.
    im have come across couple of doubts while thinking this way:
    ->is it possible using fie -to- rfc scenario to update KS01 transaction in R/3 system through RFC, if possible some body please explain the complete process to implement this scenario.
    ->is it possible file -to- rfc without BPM in XI 
    can somebody please help out me, how can i approach for the above requirment
    -> help would be appriciated and thanks in advance
    Regards
    Rajesh

    The BAPI / RFC corresponding to your requirement is :
    BAPI_COSTCENTER_CREATEMULTIPLE
    You scenario on  a high level would be FILE-XI-RFC
    in your IR, map the corresponding fields of the fiel to the fields in the BAPI's interface.
    As BAPI is synchronous , you may have to use  BPM to implement the Asynch-Sync bridge.
    Regards,
    Ravi

  • Update Transaction(IQS2) using BDC

    Hi All,
    I am developing BAPI (using BDC) which creates quality notification in SAP which is entered via front end web application. Structure p_qmsm contain 3 lines of task in notification. The code is as given below. To avoid problem of large no of lines on screen,code lines starting with * is used. This actually for pagedown after entering every 2 lines and creates new line. so that 2 lines always push up on screen and there will not be problem for creating large no of lines on screen
    perform bdc_dynpro using 'SAPLIQS0' '7200'.
    perform bdc_field using 'BDC_OKCODE' '=10\TAB11'.
    LOOP AT p_qmsm INTO wa_qmsm.
    perform bdc_dynpro using 'SAPLIQS0' '7204'.
    perform bdc_field using 'BDC_OKCODE' '/00'.
    CONCATENATE 'VIQMSM-QSMNUM(' wa_qmsm_cntr ')' INTO wm_qmsm_qsmnum.
    CONCATENATE 'VIQMSM-MNGRP(' wa_qmsm_cntr ')' INTO wm_qmsm_mngrp.
    CONCATENATE 'VIQMSM-MNCOD(' wa_qmsm_cntr ')' INTO wm_qmsm_mncod.
    CONCATENATE 'VIQMSM-MATXT(' wa_qmsm_cntr ')' INTO wm_qmsm_matxt.
    CONCATENATE 'VIQMSM-PSTER(' wa_qmsm_cntr ')' INTO wm_qmsm_pster.
    CONCATENATE 'VIQMSM-PETER(' wa_qmsm_cntr ')' INTO wm_qmsm_peter.
    perform bdc_field using wm_qmsm_qsmnum wa_qmsm-qsmnum.
    perform bdc_field using wm_qmsm_mngrp wa_qmsm-mngrp.
    perform bdc_field using wm_qmsm_mncod wa_qmsm-mncod.
    perform bdc_field using wm_qmsm_matxt wa_qmsm-matxt.
    perform bdc_field using wm_qmsm_pster wa_qmsm_pster.
    perform bdc_field using wm_qmsm_peter wa_qmsm_peter.
    wa_qmsm_cntr = wa_qmsm_cntr + 01.
    ENDLOOP.
    CALL TRANSACTION 'IQS2' USING wt_bdc
    MODE 'N'
    UPDATE 'A'
    MESSAGES INTO P_MESSTAB.
    The same code is used in modify mode also.  web application is sending all 3 lines in modify mode even if single line is modified. It is already decided to send all rows back from web application to SAP in same sequence.  It is working fine if i comment 5 lines which is starting with *. But in modify mode,  how can i ensure that correct row is modified? and how can i achieve problem of large no of lines on screen?
    Please suggest?
    Edited by: Rob Burbank on Dec 14, 2009 3:20 PM

    Moderator message - Please respect the 2,500 character maximum when posting. Post only the relevant portions of code. And please do not try to get around this by using two posts. I was able to re-format this by simply removing your commented out code.

Maybe you are looking for