on 08-09-2007 1:19 PM
Hi SDNers,
I have a scenario which picks data from AS400 table using JDBC adapter.
My sample SQL query and update query are as follows
SQL query : Select * from <table> where <keyfield> = min(keyfield) and flag ="";
Update query: Update <table> set flag = "true" where <keyfield> = min(keyfield) and flag ="";
This is to ensure records are processed one by one.
All goes well. Suddenly I have a issue where out of "n" records in the table one record failed to reach the target system. My cause of concern is there is no error in RWB and SXMB_MONI.
I have identified the missing record and could see the flag has been set to "true" in the table. I dont have TREX installed in XI, so could not track the message in XI.
Has any one faced this issue? Any ideas are highly appreciated.
Regards,
Jai Shankar
I'm wondering if this has nothing to do with the JDBC part of your interface, and maybe something to do with your receiver or a mapping issue that wouldn't output an error.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi All,
Thanks. I guess we tracked the issue. It has to do with transaction isolation level. Though I had set it to repeatable read, a record flag was updated incorrectly due to the insert happened between JDBC adapters select and update.
I could find 2 msgs in XI for a single record and no msg for the record missing in target.
Now, I have changed the transaction isolation level to "Serilaziable" and hope the issue will not pop up again.
If, any one have any other thoughts on this pls share it here.
Regards,
Jai Shankar
Hi All,
It seems, still the issue is not solved. We have the same issue again inspite of setting the transaction isolation level to serializable.
SAP Note says
<i>The SELECT and the UPDATE are run in the same DB transaction,
i.e. both statements have the same view on the database.
Make sure that both statements use the same WHERE clause. An
additional requirement for the correct operation of this scenario
is the configuration of an appropriate transaction isolation level
on the database (i.e., repeatable_read or serializable). You might
also consider using a "SELECT FOR UPDATE" statement instead of a
plain SELECT statement to ensure proper locking on the database</i>
We have ensured
a. Same where clause.
b. Serializable transaction isolation level
Am not much sure how SELECT FOR UPDATE works. We are using AS400 db.
Any experience with SELECT FOR UPDATE.
Regards,
Jai Shankar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jai,
Few of my colleagues faced same issue.
The problem traced out was:
in source system one of the columns was not set as primary key, so duplicate records were existing; and in the target system that column was set as primary key due to which it was not accepting duplicate records.
Check whether you have same type of issue.
Ravi.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.