pb in custom ube to save pdf files

antoine_mpo

Reputable Poster
Hi list,

We want to save some pdf to a custom location, renaming them so the name contains usefull information.
(For instance we want to keep invoices, saving them whith the customer and invoice number in the name).

Here is how it should work, basically :
1 - At the end of the ube we want to save, we call a custom bsfn (N56ARCHI) that looks in the job file (F986110) to find

th current ube processing (looking with ube name and version, and processing status), and save the full pdf name in a

custom file (F56ARCHI), with a unique UKID, the server where to save it, and the name for saving.
2 - Then we call a custom ube (R56ARCHIV), in asynchrone mode, passing the previous UKID as a parameter. This ube looks

in the custom table F56ARCHI to get all the information needed, and call a custom C bsfn (B56CPFIC) that copy a file

from one location to another (from the printqueue to the location we choose, renaming the file as needed). This ube is

launched on the same monothread queue (so it processes after the one that calls it is done)

My problem is that the second ube (R56ARCHIV) goes to error, raising an exception (ACCESS_VIOLATION). You can look at

the jde.log attached.

But if i launch this ube manually, putting a ukid in data selection, the ube is working well.
It copies and rename the pdf correctly.

I first thought that the delay between the first job (the one to save) and the second (the one that should copy file) was too short, and that may be JDE kept a handle on the pdf file for a while. So i tried to increase the queue delay (i changed it from 2 sec to 30 sec), but it still the same.

Does anyone have any idea ?

Thanks,
 

Attachments

  • 99223-R56ARCHIV_TCAG001_221272.PDF.jde.log.txt
    776 bytes · Views: 103
Hi Antoine,

Where do you call the mentioned *56* BSFNs and UBE?
From a frame APPL or UBE from the UBE, which produce the .pdf?
In the second case, I suppose the .pdf still open by the invoice UBE, so it is locked and the second UBE unable to access it.

An other approach can be, to place all of the logic onto a table trigger of F986110 - but do not start UBE from there, just use ER codes and BSFN calls.

Regards,

Zoltán
 
Hi Zoltan,

The first custom bsfn (that save the pdf name, ..) is called from the ube i want to save.
The second ube (that should handle the file copy) is called from the ube i want to save (at the end section of the report footer) - so the one that procudes the pdf -.
Why would the first job (that produces the pdf) be locked is it's status in 'D' ? (has i mentionned, i let a 30 secondes delay in the ube queue, and i could manually copy the pdf file when the ube was finished, before the saving ube goes to processing).

About the trigger solution, we don't want to do so. Too many ubes are launched everyday, it's a bit risky to put a trigger on this touchy table.
Furthermore i think i read some special technical points for triggers on that table (related to the default environment set in the jas.ini, or something like that).

Rgds,
 
Hi,

Here are some news about my issue :
It seems that my custom C bsfn to copy files is not the problem. I disabled the code where i call it, and the ube still goes in error when called by another ube (and works when launched manually).
I'm gonna try to create a new ube and re-type the code to check it's not a corrupted object problem.
I'll keep you informed.

Rgds,
 
Hi Antoine,

OK, I didn't put together all in my mind, that you had written.

Calling the second UBE asynchronously with extra delay in the print queue can not cause .pdf lock problem.

Just an other question:
How do you call the second UBE? Via Report Interconnect or via BSFN call or other way?

Good luck,

Zoltán
 
Hi list,

It was well what i thought ! I recreate the ube that handle the file copy (create a new ube and re-typing all the code) and now it's working perfectly !!
JDE .... Strange behaviour sometimes ...

Thanks for your suggestion Zoltan.

Rgds,
 
Back
Top