Questions about sender JDBC adapter

Normally we use sender jdbc adapter in this way:
query statement:
SELECT * FROM table WHERE processed = 0
update statement:
UPDATE table SET processed = 1 WHERE processed = 0;
The update statement will be executed after the message has been successfully sent to XI.
My questions is that what will happen in this scenario:
A new record (processed=0) is added to the database table when a message is sent to XI with query statement but not finished?
After the message is sent to XI successfully, XI will execute the update statement. Then  the new added reocrd will also be updated to 1 although it hasn't been sent to XI.
Does XI have some control or special check for this issue?
Regards
Hui

Hi,
this can be handled by the ISOLATION LEVEL FOR TRANSACTION  setting of the sender Jdbc adapter.
make the transaction handling to SERIALIZABLE  or REPEATABLE READ and then until the data is not read from the JDBC adapter and it is not updated by the UPDATE statement , no new rows will be allowed to be inserted into the database. The database will be write locked.
http://help.sap.com/saphelp_nw04/helpdata/en/7e/5df96381ec72468a00815dd80f8b63/content.htm
<i>Isolation Level for Transaction
There are different levels of database transactions known as isolation levels. The isolation level determines how transactions running in parallel influence each other. The options correspond to the JDBC constants:
   Default (default setting of the respective database)
     None
    read_uncommitted (weakest setting)
    read_committed
     repeatable_read
     serializable (strongest setting)</i>
Regards,
Bhavesh

Similar Messages

  • About sender jdbc adapter

    can I define multiple query statments in sender jdbc adapter?
    because i wanna get multiple recordsets from database according to multiple querty statements.
    like:
    <recordset1>
          <row>
                  <col1>
                 <col1/>
                 <col2>
                 <col2/>
        <row/>
    <recordset1/>
    <recordset2>
          <row>
                  <col1>
                 <col1/>
                 <col2>
                 <col2/>
                 <col3>
                 <col3/> 
                <col4>
                 <col4/>
         <row/>
    <recordset2/>
    such as:   order and order item scenario.
    in general,how to implement the scenario?
    i have to make use of BPM to resolve the problem?
    ple give some hint and stuff about this. thanks a lot!!!

    Hi Joy ,
    Check out this :
    http://www.codeproject.com/Messages/2516517/Re-How-to-write-the-multiple-query-in-single-store-procedure.aspx
    Hope you will find this discussion informative : http://forums.asp.net/p/1021356/1765680.aspx
    Regards,

  • Sender JDBC Adapter Select/Update Issue

    Dear All,
    We have configured a Sender JDBC Adapter to Poll data from the DB2 tables. It is working fine and both the select and the update queries written are also getting properly executed and are changing the status of the flag from Y to N once read from database.
    In the communication channel ->
    select * from <table> where flag = 'N'.
    update <table> set flag = 'Y' where flag = 'N'.
    But I have one doubt after executing the select query some new data comes into the table of status flag 'N"., then will this unselected data will also be updated to 'Y' .
    The question is while we do a select and update from XI on the DB table and at the same time there is an insert happening into the table from the other end how will the adpater behave in this case.Will it result in missing of some records during next select/update transaction from XI..
    Your inputs will be appreciated.
    Regards
    Amit

    Amit
    Did you ever get a solution to your question ?
       Sender JDBC Adapter Select/Update Issue  
    Posted: Apr 24, 2008 2:29 PM           Reply 
    Dear All,
    We have configured a Sender JDBC Adapter to Poll data from the DB2 tables. It is working fine and both the select and the update queries written are also getting properly executed and are changing the status of the flag from Y to N once read from database.
    In the communication channel ->
    select * from <table> where flag = 'N'.
    update <table> set flag = 'Y' where flag = 'N'.
    But I have one doubt after executing the select query some new data comes into the table of status flag 'N"., then will this unselected data will also be updated to 'Y' .
    The question is while we do a select and update from XI on the DB table and at the same time there is an insert happening into the table from the other end how will the adpater behave in this case.Will it result in missing of some records during next select/update transaction from XI..
    Your inputs will be appreciated.
    Regards
    Amit

  • Sender JDBC adapter can be Synchronous?

    Hi,
    can we use sender JDBC adapter as synchronous in JDBC-XI-RFC Scenario without BPM?
    thank you
    babu

    thank you for your reply.
    Agasthuri,
    that link doesn't explain about sender JDBC,it explains about reciever JDBC adapter and more over using BPM,I have asked without BPM.
    Chandra
    do you know how can we achieve this?please stick to my question sender JDBC-xi-RFC without BPM.
    thank you again.
    babu

  • Sender JDBC Adapter - Stored procedure

    Hello all, I just read a lot of topics in this forum about this subject.
    I found two indications in contracdictions in the documentation :<a href="http://help.sap.com/saphelp_nw04/helpdata/en/7e/5df96381ec72468a00815dd80f8b63/frameset.htm">Configuring the Sender JDBC Adapter</a>
    1. Concerning Query SQL Statement
    You have the following options:
    &#9679;     Specify a valid SQL SELECT statement to select the data to be sent from the specified database.
    &#9679;     Specify an SQL EXECUTE statement to execute a stored procedure, which contains exactly one SELECT statement.
    2. Concerning Update SQL Statement :
    This is recommended if the data has not only been read, but also changed by a stored procedure entered under Query SQL Statement.
    It is ambigous, isn't it ?
    My question is simple :
    Does somebody already use Sender JDBC Adapter with Stored procedure as Select statement including many steps :
    - update actions on database
    - select query to return data to XI adapter
    (Update statement stay empty or with value <TEST>.
    To provide more information, I have a reference table to read. But this reference table must be updated by a stored procedure before being able to be read accordingly.
    So As I can't do both process with Sender Adapter (call a procedure and execute a select statement) => I want to include both actions (updates and select) in an alone stored procedure.
    Could I get wanted data as a resultset ?

    Hi,
    >><i>Update statement stay empty or with value <TEST>.</i>
    It should be <TEST> if you do not want an Update to happen.
    Regarding Sender JDBC adapter with stored procedures, which DB are you trying to access. Sender JDBC adapter does not support Oracle Stored Procedures as they return Cursors and Sender JDBC adapter can deal with only Resultset.
    As for executing both Update and Select in the SP, though I havent tried, this should surely be possible.
    Regards,
    Bhavesh

  • Sender JDBC Adapter hang after network problem ?

    Hi,
    I got problem with Sender JDBC Adapter. in the normal condition it is working fine. no problem at all.
    The problem coming after network connection problem within XI and database for about more than 24 hours. After the connection resume the Sender JDBC Adapter doesn't want to pickup the data.
    Communication Channel Log  Showing  (Without finish Processing).
      6/16/08 5:49:04 PM   Processing started
      6/16/08 5:48:04 PM   Processing started
      6/16/08 5:47:04 PM   Processing started
      6/16/08 5:46:04 PM   Processing started
      6/16/08 5:45:04 PM   Processing started
    In normal Communication Channel Showing :
    6/16/08 5:33:39 PM efcbd379-6b57-4922-364f-9c047e82ac1b Polling interval started. Length: 30.0 seconds
    6/16/08 5:33:39 PM efcbd379-6b57-4922-364f-9c047e82ac1b Processing finished successfully
    6/16/08 5:33:39 PM   Processing started
    6/16/08 5:33:09 PM efcbd379-6b57-4922-364f-9c047e82ac1b Polling interval started. Length: 30.0 seconds
    6/16/08 5:33:09 PM efcbd379-6b57-4922-364f-9c047e82ac1b Processing finished successfully
    6/16/08 5:33:09 PM   Processing started
    The problem resolve after restart the whole XI system. is there any other way to solve the problem without restarting the whole xi server. Because i have tried to stop and start the communication channel but still doesn't work until restart the xi. server.
    Please advise.
    Thank you and Best Regards
    Fernand

    Check JDBC FAQ note 831162
    7. Network-Level Connection Problems
    Q: The TCP/IP connection to my database host is running over an unreliable network connection, i.e. the connection is sometimes interrupted. Consequently, I sporadically receive an SQLException regarding a closed connection in the system trace or audit log or the connection as well as the JDBC Adapter channel are hanging.
    How can I work around this connectivity issue?
    A: Enable the "Advanced Mode" for the respective JDBC Adapter channel and select the option "Disconnect from Database After Processing each Message".
    Note that this might put additional load on your DBMS due to the creation of a new database connection for each message.
    If you are connecting to an Oracle database, also refer to question #10 for an alternative solution.

  • Transaction handling in sender JDBC adapter

    Hello,
    In a scenario where a third party application updates a field (counting it up) and we pick up these counts and zero out the field with the sender JDBC adapter, we would like that the third party application is not able to update while the JDBC sender adapter is processing.
    We were under the assumption that the select and update statements of the sender JDBC adapter where executed within the same DB transaction and set the isolation level to "repeatable read" to make sure the third party app. could  not update while the adapter is processing.
    This had no effect.
    Do the select and update statement occur within the same transaction?
    Thanks,
    Dan
    Edited by: Dan Hansen on May 5, 2008 9:58 AM

    Thanks for the answers so far, I have looked through this and can find no reason why the current set up with "repeatable_read" should not work... a little more info. We are running against a MSSQL 2005 database using a table with the following structure.
    CREATE TABLE [dbo].[OPERATION] (
         [WERKS] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
         [AUFNR] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
         [VORNR] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
         [SSAVD] [datetime] NULL ,
         [ARBPL] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
         [MGVRG] [bigint] NULL ,
         [LMNGA] [bigint] NULL ,
         [LTXA1] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
         [ZCONFQTY] [numeric](18, 0) NULL ,
         [ZTIMESTAMP] [datetime] NULL ,
         [ZSTATUS] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
         [STAT] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
         [SSEVD] [datetime] NULL ,
         [FSEVD] [datetime] NULL ,
         [FSAVD] [datetime] NULL ,
         [XMNGA] [bigint] NULL ,
         [RMNGA] [bigint] NULL ,
         [RUECK] [bigint] NULL ,
         [ZPACKQTY] [bigint] NOT NULL ,
         [STEUS] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
         [ZSCRAPQTY] [numeric](18, 0) NULL ,
         [ZREWORKQTY] [numeric](18, 0) NULL ,
         [BEARZ] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
         [BEAZE] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
         [RUEST] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
         [RSTZE] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
    ) ON [PRIMARY]
    GO
    We read information about the quantities per primary key combination with the select statement where the ZSTATUS field is "CONF" and then zero out the quantity field and set the ZSTATUS to CONF2SAP with the update statement.
    Another app counts up the quantities and sets the ZSTATUS to CONF as needed.
    Sometimes we see that we miss a count because we read before someone has increased the quantity but update back after they did and thereby zero out their entry.

  • Variables or parameters in Sender JDBC Adapter.

    Hi,
    I have the following question:
    Is there any way to use variables or parameters when specifying the WHERE clause of a SQL SELECT statement or when using a Store Procedure in a Sender JDBC Adapter? If so, can anyone give an example.
    Thanks in advance.
    Sebastian Pereira.

    Hi Sebastian,
                   The links mentioned below will help you in this regard:
    Using a stored procedure for a  sender jdbc adapter
    Stored Procedure in sender JDBC
    JDBC Sender - Oracle Stored procedures
    Reward with points if helpful
    Regards
    Sai Ganesh

  • Executing an Oracle Stored Procedure from Sender JDBC adapter

    I could really use some help from someone who had done this before. 
    I've read the help about using the JDBC sender adapter, but it's not helping enough.
    I found this line: "Specify an SQL EXECUTE statement to execute a stored procedure, which contains exactly one SELECT statement.
    The expression must correspond to the SQL variant supported by the relevant JDBC driver. It can also contain table JOINs."
    That's definately what we want to do, but we can't figure out the syntax.
    The procedure in oracle looks like this:
    CREATE OR REPLACE PROCEDURE test_ref_cursor
    ( cur_generic IN OUT result_sets.cur_generic)
    as
    BEGIN
    Open cur_generic for
    select
       proposal_number,
       to_char(sequence_number),
       column_name,
       column_value,
       update_timestamp,
       update_user
       from
       coeus.sap_test;
    END test_ref_cursor;
    And we have tried every kind of statement we can think of, but the file adapter always gives us an "invalid sql statement" error.
    Does anyone know what syntax we need to put in the "Query SQL Statement" in the JDBC sender adapter in order to call this procedure?  Or is there something wrong with the procedure that is causing the error?
    <i>I will absolutely return and give points, but PLEASE read my whole post before answering and do not just link me to or quote the help for configuring a sender JDBC adapter or blogs that are about the JDBC adapter in general but do not deal with the issues I am having. Thank you.</i>

    Hi Vanda,
    Unfortunately, the sender JDBC adapter does not support Oracle's store procedure/function.  Unlike stored procedures from other database vendors, Oracle returns a cursor, not a resultset.  The sender JDBC adapter must send a resultset to XI.
    There are 2 possible ways you can accomplish this:
    1.  Use BPM and call the Oracle stored procedure using a receiver adapter via a asynch-synch bridge.
    2.  Develop a user-module for the adapter, which can be used with a sender adapter.
    Thanks
    Prasad

  • Question about the DB adapter

    Question about the DB adapter
    ns2006.0.7
    Question:
    It seems that we can only have 1 db adapter, but in the adapter defiition we have to specify the database.  If I want to communicate to several different databases on different platforms, Oracle / SQL I need to install a DB adapter for each database connection. 
    I can't figure out how to add a second DB adapter, does anyone know how?
    Thank you
    Daniel
    Safeway Inc.

    Hi
    We're new at developing our own agents etc. We've leveraged the supplied DB agent and written the relevant adapter, however we're struggling with the transformation.
    Could I be cheeky and ask if anyone would be willing to share a transformation they have written for the DB adapter? Unfortunately no-one in our team has had past XML experience, so we're trying to backwards engineer from examples.
    Thanks, Meghan

  • Error while executing the stored procedure through sender JDBC adapter

    Hi All,
    I am getting below error while executing the stored procedure through sender JDBC adapter.
    Database-level error reported by JDBC driver while executing statement 'exec SapgetNextEntity 'SalesOrder''. The JDBC driver returned the following error message: 'com.microsoft.sqlserver.jdbc.SQLServerException: The statement did not return a result set.'. For details, contact your database server vendor.
    what is the problem? any idea to anyone...
    regards
    Ramesh

    hi Dharamveer,
    I am not getting below statement for your reply
    Try to use Refrence Cursor it will return u reference of resultset.
    I mention SP like this
    exec SapgetNextEntity 'SalesOrder'
    SapgetNextEntity -
    > SP Name
    SalesOrder----
    > Parameter I am passing...
    regards
    Ramesh

  • Dynamic query configuration in sender jdbc adapter

    Hi,
    According my undertsnading in XI.3.0 dynamic query in sender JDBC adapter is not possible.
    could any one confirms the possibility of this feature in XI 7.0 .
    Thanks,
    venu

    Hi VJ,
    sorry for late responding to your answer.
    One of our requirements is the query statement that we write in sender communication channel should be changed dynamically, for example in where condition the condition parameters values required to change.
    Thanks,
    venu

  • Stored procedure in Sender JDBC Adapter

    Hi All,
    My Scenrio goes like this ...
    Stored Procedure(SQL Server) --- PI  -
    File
    I need to write the results of  stored procedure to File.Here I don't need any mapping.So how many DT , MT and MI need to be created?
    The interface need to run by 6AM from Monday to Thrusday, how can i achieve this ?
    Stored Procedure has only select statement and no Update statement , but it takes Date as Input parameter , so what i need to provide in sender JDBC adapter.
    Thanks,
    Monish

    Hi Monish,
    As per your requirement it is JDBC to File. Please be careful with the structure to be created for sender JDBC. I am unable to understand why you donot require a mapping for this. How XI will send the data to a file then.As per my knowledge if it's file to file and just pick and drop then we can neglect IR and go for ID.But here you are working with JDBC and File so you will be in need of it.
    IR:
    DT: 2
    JDBC_Sender_DT
    File_Output_DT(Optional)
    You can use the JDBC sender data type structure for File output also.
    MT as per your DT
    MI:2
    Outbound MI: JDBC structure
    Inbound MI : File structure
    MM: 1
    IM: 1
    ID as similar to other scenarios.All 1 objects for RD,ID,Sender Agreement and Receiver Agreement.
    Sender JDBC channel:
    Query: Select * from table where date
    But I have a query how are you providing date in input paramerter.It will be dynamically entered into the query right.
    You can mention the Avalibility planning for your interface to work in RWB.
    Go to RWB>Component Monitoring>Adapter Engine->Communication Channel Monitoring>Avaliablity Planning
    Please explain.
    Regards,
    Nutan

  • Problem in sender JDBC adapter

    hello,
    I am facing one typical problem in sender JDBC adapter.
    Here is the issue,
    JDBC API method getString threw an exception: java.sql.SQLException: Cursor state not valid.
    Can anyone please help me out in solving this problem?
    Actually after a retry of 3 times the message has been successfully sent. Till then i am getting these error
    On 1st attempt ,
    Error during conversion of query result  to XML java.sql.SQLException: Cursor state not valid
    On 2nd attempt,
    Error during conversion of query result  to XML java.sql.SQLException: Internal driver error                                                                               
    (class.java.lang.InterruptedException)
    On 3rd attempt,
    Processing finished successfully.
    This is the scenario that i can see in the audit log.
    Can you please help me out in solving this issue.
    Thanks,
    Soorya

    Hi gaurav,
    It was a good response from your side.
    I have gone through the FAQ but could not able to find anything.
    Can you please help me out in this regard ?
    Also i am using select query of this kind,
    SELECT
    SEFVHRC.VHRBRCD,SEFVHRC.VHRCUCD,SEFVHRC.VHRVIN,SEFVHRC.VHRMOCD,SEFVHRC.VHRCHAS,
    SEFVHRC.VHRSLOR,SEFVHRC.VHRDIVI,SEFVHRC.VHRMGCD,SEFVHRC.VHRMOCH,SEFVHRC.VHRVHTY,
    SEFVHRC.VHRBDTY,SEFVHRC.VHRMFYR,SEFVHRC.VHRMOYR,SEFVHRC.VHRMODS,
    SEFVHRC.VHRMDTL,SEFVHRC.VHRCLBR,SEFVHRC.VHRRCID,SEFVHRC.VHRARDT,
    SEFVHRC.VHRLUTM,SEFVHRC.VHRLUDT,SEFVHRC.VHRKEYN,SEFVHRC.VHRCTORN,
    SEFVHRC.VHRCTIMP,SEFVHRC.VHRPRDT,SEFVHRC.VHRPRDT,SEFVHRC.VHRRCDT,
    SEFVHFT.VHFCLCD,SEFVHFT.VHFCAT,SEFVHFT.VHFCADSC,SEFVHFT.VHFKEY,SEFVHFT.VHFTEXT1,
    SEFVHFT.VHFTEXT2,SEFVHFT.VHFTEXT3,SEFVHFT.VHFTEXT4
    FROM
    SAPTESTLIB.SEFVHRC,SAPTESTLIB.SEFVHFT
    WHERE
    SEFVHRC.VHRVIN = SEFVHFT.VHFVIN AND SEFVHRC.VHRSTTS = ' '
    and update query of this kind,
    Update SEFVHRC SET VHRSTTS = 'R' WHERE VHRSTTS = ' '
    I am using prity big select query. is there any option to optimize it?
    Can you please help me out in solving this problem
    urs,
    Soorya

  • Stored procedure : how to call SP in sender JDBC adapter for mysql

    HI friends ,
    we have JDBC---->XI--
    >SAP  scenario. For some business requirement, we have to call STORED PROCEDURE , please let me know how to call  SP in sender JDBC adapter for mysql .
    Thanks
    mojib

    Hi Mojib,
    Please create a sample stored procedure like this which contains select statement and in communication channel give
    wite stored procedure name only to sql query statment and in update statement write <test>.
    I am executing this stored procedure successfully.
    Create Proc GetResultX As
    Begin
    Select * From TESTX
    End
    Execute statement for stored procedure is :
    Exec GetResultX
    Regards
    Laxmi Bhushan Jha
    Rewards point if found usful
    I have given same answer to one of the same  thread

Maybe you are looking for