Update F4211 asynchronous.. statement rolledback

jefzapata

jefzapata

Active Member
Hi!
I have a problem with asynchronous updating on the table F4211.

- In the P4210, in Post Button Click, I record in a custom table some value from column added to the detail grid. This is working.
- After, in the Post Button Click - Asynch, I call a business function. This is OK
- The business function browse my custom and for each row, call another custom BSFN used to made some data validation. This is OK
- At the end of this BSFN, I call a F4211.Update to update some field with new value. This take a minute, and after, I can see in JDE.LOG some error...It's seem like JDE doesn't want me to update the F4211 table... even if the F4211EndDoc has occur.

3052/7468 WRK:Starting jdeCallObject Tue Jul 07 16:23:22.859207 B96706.c996
AVANT UPD
3052/7468 WRK:Starting jdeCallObject Tue Jul 07 16:24:22.859436 Jdbodbc.c8349
ODB0000163 - wSQLExecute failure. rc=-1
3052/7468 WRK:Starting jdeCallObject Tue Jul 07 16:24:22.874001 Jdbodbc.c8349
ODB0000164 - STMT:00 [40001][-911] [IBM][CLI Driver][DB2/AIX64] SQL0911N The current transaction has been rolled back because of a deadlock or timeout. Reason code "68". SQLSTATE=40001
3052/7468 WRK:Starting jdeCallObject Tue Jul 07 16:24:22.874003 Jdbodbc.c8349
ODB0000164 - STMT:01 [40001][-911] [IBM][CLI Driver][DB2/AIX64] SQL0911N The current transaction has been rolled back because of a deadlock or timeout. Reason code "68". SQLSTATE=40001
3052/7468 WRK:Starting jdeCallObject Tue Jul 07 16:24:22.874006 Jdb_drvm.c1096
JDB9900401 - Failed to execute db request
3052/7468 WRK:Starting jdeCallObject Tue Jul 07 16:24:22.874008 Jdb_exet.c3007
JDB3600011 - Failed to perform Update for F4211
3052/7468 WRK:Starting jdeCallObject Tue Jul 07 16:24:22.874030 B96706.c996
APRES UPD


I'm now very confused about the way I can use to finally update the F4211... I want to understand why JDE doesn't want me to update the F4211 table at this time, and what I can do to reach my goal.
confused.gif


Thanks a lot!
Jef
 
"even if the F4211EndDoc has occur": if i remember correctly, if not using css, end doc is called asynch, so u don't know if it has finished when you do your custom f4211-update. try this for a test: change the call to end doc to synch, and put your custom f4211-update logic in button clicked, right after the end doc.

more elegant way imo would be to put your custom logic in end doc itself, and instead of updating f4211 itself, update the datastructure right before it gets written to f4211.
 
Hi Jef,

It was more time discussed here, how to deal with Async BSFN calls in Post Button Click of OK, how to update additional field - mainly in F4211.

Sorry, currently I am very busy to write it again with details, so please, search JDEList Developers Forum - if I remember I post it again some monthes or weeks ago.

Regards,

Zoltán
 
Hi Zoltan,
the thread you have linked here is exactly what I do. I use the method #2, and for what you have written, this is working.

But in your explanation, you didn't bring detail about the F4211 update that I do under the custom BSFN...

The asynchronous call is working perfectly, but its just the update on the F4211 that doesn't work.

And for what you said Remo, I'm not too much sure of what I did to modify data structure of the EndDoc BSFN and also the C BSFN itself. I'm afraid of changing the datastructure, but I have an idea of how I could only change the C BSFN, I will code the browsing of my custom table in the function, by this way, I will not be forced to change data structure.

If any other advice for me, that's welcome!

Thanks a lot for your answer, its appreciated.

Jef
 
jef, i wasn't talking about changing the end doc data structure (that's not something u want to do), but adding logic to end doc itself (which, in your case would be to retrieve the desired values from your custom table, and update the desired value(s) in the data structure that holds the f4211-fields, just before end doc writes them to f4211).

however, if u're not too comfortable with changing/writing c-code, try my 1st suggestion and see if that works for you:

1. change the call to end doc in W4210A OK - post button clicked from asynch to synch by unchecking* the asynch checkmark;
2. move your custom f4211-update logic to OK - post button clicked, right after the end doc.

* note: depending on what tools release u are, u may not be able to undo this action. but u can always try this locally, without checking p4210 out/in.

(ps: i said OK - button clicked in my orig reply, but end doc is in OK - post button clicked. my bad)
 
Finally, I've added my C code to the enddoc BSFN, and IM mostly done with it...it was less complicated than I think.
wink.gif


Your idea about adding my call in the form event, and set "synch" the other bsfn call was not bad, but I try it and it brings performance problem (certainly too slow for the user...).

I'll keep this post updated until I reach my goal (still coding)!

Thanks...
Jef
 
Just for your information, I succesfully updated the F4211 with the C code added to the EndDoc BSFN. A little tricky, but now I understand how it works!
smile.gif


Thanks, and nice day to you
Jef
 
cool. what i usually do in a case like this, is to put the logic in a custom NER which i then call in end doc.
 
a small addition on putting custom logic in end doc (or any other MBF for that matter): what i usually do and consider good practice is to put an if around it to only execute the logic if coming from the desired application (which in your case would be P4210). this i do to avoid negative impact in case the MBF in question is called from other apps/ubes. you can use jdeGetApplicationName to get the app name.

and on making the end doc call synch: yes, i know it's gonna affect performance. but it was just to test my prediction that your original problem resulted from end doc not having finished when you did your f4211-update.
 
Back
Top