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.
Similar Messages
-
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,
SooryaHi 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 -
Sender JDBC adapter...problem
Hi,
the real problem is Sender JDBC adapter sends data in following format.
<?xml version="1.0" encoding="UTF-8"?>
<resultset>
<row>
<Associate_ID>16444</Associate_ID>
<Associate_Name>Sudhir</Associate_Name>
<Status>false</Status>
</row>
</resultset>
But in Design time mapping...structure of source message will be like
<?xml version="1.0" encoding="UTF-8"?>
<ns5:DB2File_DB_MT xmlns:ns5="urn:db2file">
<Resultset>
<Row>
<Associate_ID>16444</Associate_ID>
<Associate_Name>Sudhir</Associate_Name>
<Status>false</Status>
</Row>
</Resultset>
</ns5:DB2File_DB_MT>
How does this tag ... <ns5:DB2File_DB_MT xmlns:ns5="urn:db2file"> get generated in runtime
and apart from 1 to 1 mappings b/w the three fields above in the row tag...wt other mappings to be performed
Pls help...
SunitaHi Sunita,
what i understood from your query is namespace tag is coming while message mapping. This namespace can be avoided in the message type if you keep the XML namespace field empty while creating message type. But i afraid you have to do the message mapping again.
Regards,
Satish -
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
Rameshhi 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 -
We get "uFF06uFF03x0;" from sender JDBC adapter
Thank you.
This is naoki kurihara.
We have a problem in sender JDBC adapter.
We use java mapping and sender JDBC adapter in PI7.1 on Windows.(DB is sqlserver)
and we test the interface and we found error.
the reason is to get "&#x0;" from JDBC adapter.
and our java mapping can't parse it. and we got error.
the column is not null.
how we can prevent "&#x0;",
(sorry I cant write "&#" 1byte word, so I wrote 2bytes word)
please give me your help!!
ThanksHi,
Replace the & character with & ; in your java mapping. The same goes for these special characters:
< with < ;
> with > ;
" with " ;
' with &apos ;
Please remove the space between the escape character and the ; in your Java mapping. The spaces are typed here because the equivalent characters are not displaying correctly.
It should be able to handle the # though. Hope this helps
Regards,
Mark -
How to use Stored Procedure Call in Sender JDBC adapter
Hi All,
Could someone send me a blog on how to use Stored Procedure call in Sender JDBC adapter?
XierHi Xler
refer these links
/people/yining.mao/blog/2006/09/13/tips-and-tutorial-for-sender-jdbc-adapter
http://help.sap.com/saphelp_nw04/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm
Also, you can check Sriram's blog for executing Stored Procedures,
/people/sriram.vasudevan3/blog/2005/02/14/calling-stored-procs-in-maxdb-using-sap-xi
/people/jegathees.waran/blog/2007/03/02/oracle-table-functions-and-jdbc-sender-adapter
This blog might be helpfull on stored procedures for JDBC
JDBC Stored Procedures
/people/siva.maranani/blog/2005/05/21/jdbc-stored-procedures
Please go through these threads and see if it helps...
Re: How to execute Stored Procedure?
Re: Problem with JDBC stored procedure
Thnaks !! -
Sender JDBC Adapter Supports Stored Procedures????
Dear All,
I was trying to use the Sender JDBC adapter to call the Stored procedure in the Sender JDBC adapter is possible to do this???
I don't think Sender JDBC Adapter is supported to execute the Oracle Started Procedures. With my understanding only the Receiver JDBC Adapter will supported for the Stored Procedures using the message mapping Action = EXECUTE and Table = DBO.EmployeeMasterTable.
Please let me know how to achieve the below scenario.
My Scenario JDBC to RFC
Query SQL Statement:
select * from dbo.emp where flag = 'Insert' or flag = 'Update' or flag = 'Delete'
Update SQL Statement:
UPDATE dbo.emp SET flag = null WHERE flag IN ('Insert', 'Update');
DELETE dbo.emp WHERE flag = 'Delete';
In the my update statement I need to update few data flag with Insert , Update and need to delete the of the old records as mentioned above the query.
In the response mapping I am using the Action = INSERT and Table = emp.
Thanks,
Jane F.Hi Jane,
>>My requirment is to select from the DB and update and delete needs to be done. How I need to call this stored procedure in Sender JDBC adapter.
An example of SP call is mentioned in the previous note Note 941317 - XI / PI JDBC Adapter: Known Problems / Incompatibilities
SP Code
---------- pkg1 ----------
CREATE PACKAGE pkg1 AS
TYPE numset_t IS TABLE OF NUMBER;
FUNCTION f1(x NUMBER) RETURN numset_t PIPELINED;
END pkg1;
CREATE PACKAGE BODY pkg1 AS
-- FUNCTION f1 returns a collection of elements (1,2,3,... x)
FUNCTION f1(x NUMBER) RETURN numset_t PIPELINED IS
BEGIN
FOR i IN 1..x LOOP
PIPE ROW(i);
END LOOP;
RETURN;
END;
END pkg1;
In sender channel mention
>> SELECT * FROM TABLE(pkg1.f1(5));
>>Is this need to be in the one stored procedure right. Can ou let me know how it should be handled in JDBC Adapter.
Yes it shoudl be a single SP. Mention a select statement as given in above example.
What is your Oracle version?
Regards
Suraj -
Sender JDBC adapter : Update SQL Statement : stored procedure
Hi,
Can we use a stored procedure in the sender jdbc adapter in 'Update SQL Statement'.
The problem i am facing is like, we are selecting data from two tables in 'SQL statement for query' and then in 'Update SQL Statement' , we need to delete that data from these two tables.
Please let me know if it is possible.
Thanks,
Rohityou can use a Stored procedure in the
Query SQL Statement
You have the following options:
· Specify a valid SQL SELECT statement to select the data to be sent from the specified database.
· 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.
so have your whole select and update as part of this single Stored procedure -
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
AmitAmit
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 SELECT / UPDATE issue - updates more rows than selected
Hi,
We have configured a Sender JDBC Adapter to poll records from an Oracle table based on a flag field and then update the flag for the selected records. When tested in DEV and QA environments (where test data comes in intermittently and not in huge volumes), itu2019s working fine.
Both SELECT and UPDATE queries written in the Sender JDBC adapter are getting properly executed and are changing the status of the flag for the selected records from Y to N once read from the database.
select * from <table> where flag = 'N'.
update <table> set flag = 'Y' where flag = 'N'.
But in the PROD environment (with records getting updated in the database every second), after XI executes the SELECT query and just before the UPDATE query is executed, new records come into the Oracle table with status flag 'N". So when the UPDATE query runs just after the SELECT query, then these unselected records also get updated to 'Y'. Thus these records never get into the resultset and hence XI and thus remain unprocessed.
So when XI does a SELECT and UPDATE on the Oracle DB table and concurrently there is an INSERT happening into the table from the other end, the JDBC sender adapter is picking up a certain number of records but updating the status of more records than it picked up.
So how does XI deal with such a common scenario without dropping records?
Thanks,
VishakThe condition being checked is the same for both SELECT and UPDATE statements.
Initially I tried setting transaction isolation levels on the database to repeatable_read and serializable but it was throwing me a java.sql.SQLException error saying that these transaction levels were not valid.
I asked for these transaction level permissions for the XI user from my DBA but the DB I am accessing provides only a view into other databases and so it's not possible. -
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 AMThanks 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. -
Hi all,
We are having an extrange problem. We are trying to read some info from an oracle Database, but we have always this error :
Error: SQLException during query 'SELECT * FROM XX': java.sql.SQLException: ORA-00942: table or view does not exist: SQLException: ORA-00942: table or view does not exist
And WE have checked it, and the table is there. To understand what is happening we try with another table and it works, we have compare both an has the same features.
Any Ideas?Hi,
This is the format in which your Data polled from the DB wiill be created,
<i><resultset>
<row>
<column-name1>column-value</ column-name1>
<column-name2>column-value</ column-name2>
<column-name3>column-value</ column-name3>
</row>
<row>
<column-name1>column-value</ column-name1>
<column-name2>column-value</ column-name2>
<column-name3>column-value</ column-name3>
</row>
</resultset></i>
Resultset is to be replaced by your DT / Message Type name.
In the Sender JDBC adapter, give the Document Name as the Message Type name and the Document Namespace as the Namespace of your Message Type.
Is this how you have created the source structure?
Regards
Bhavesh -
Need help reg sender JDBC adapter
Hi,
I am having a requirement like, i need to fetch the data from two data base tables. and after fetching the data, i need to update those two tables.
For selecting the data from two tables, two select statements i need to write, how i can give two select statements in sender JDBC comm channel.
In sender JDBC channel, only one update query we can give...how i can update two tables?
Regards,
Venkata Ramana.Hello Venkat,
For your requirement, go for stored procedure and find the below thread.
Fetching data from JDBC without using JDBC sender adapter
Re: Executing an Oracle Stored Procedure from Sender JDBC adapter
Re: Sender JDBC adapter not picking up data
Re: Retrive data from two diffirent tables
hope this will help you
Thanks,
Venky -
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
HuiHi,
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 -
Configuring sender jdbc adapter
Hi all,
I have a requirement in which i have to select certain data from Oracle table and send it to an IDOC via SAP XI.
Problem is the select can happen from several tables. For example:
SELECT col1,col2,col3 FROM <tablename>
The <tablename> has to be variable. I do not need to do any JOIN. At a time select will be only from a single table i.e. col1, col2, col3 will all belong to the same table. But the adapter should poll multiple tables.
One more requirement is that once a particular record from a particular table has been selected some UPDATE also need to be done on the same record.
Pls can anybody provide me with a proper solution.
This requirement is a bit urgent.
Thanks in advance.
Regards
NeetuNeetu,
You need to have the Table name dynamic in the Sender JDBC adapter's Select Query . This is not possible
You can consider using a Reciver JDBC adapter for which you can have a look at this blog ,
/people/bhavesh.kantilal/blog/2006/07/03/jdbc-receiver-adapter--synchronous-select-150-step-by-step
Or, you need a Separate sender JDBC adapter for every table to be polled.
>><i>One more requirement is that once a particular record from a particular table has been selected some UPDATE also need to be done on the same record.</i>
If you are using the Sender JDBC adapter, this would be simple using the UPDATE field of the Sender JDBC adapter .
If you are planning to use Receiver JDBC adapter, then You need a separate Send Step for this Update.
Better way to go would be to have separate sender JDBC adapters.
Regards,
Bhavesh
Maybe you are looking for
-
Can not open Acrobat Pro 9 out of my adobe creative suite 4 web premium. Keeps giving an error message. Adobe Acrobat was installed as part of a suite. To enable Adobe Acrobat start another component of this suite. I am running Windows 7 64 and al
-
.DS_Store files on USB thumbdrives - a way to stop them from being created?
Hello! Forgive me if this has been asked to death, but at school I need to copy homework files back and forth to the school's XP-based computers constantly. Because in any given day I usually update half a dozen files across the "homework" folder on
-
Duplicate event in videos from iPhoto
Hello... I'm having an issue with how iMovie is showing my iPhoto Movies. I initially went into iMovie and had it build my iPhoto Movie database. Sometime later, I decided to organize my events in iPhoto and merge some events, which would move some m
-
Step by step debugging pl/sql procedure
How can we debug a pl/sql procedure step by step
-
Oracle Web ADI integrate with Fixed Asset
Dear All, We are doing a test for integrating fixed asset - physical inventory with Oracle Web ADI. We have managed to define the layout and create mapping for Fixed Asset - Physical Inventory, but when it came to create document for fixed asset, it