Hi,
I have developed a shared container to add error-messages to a error-log (sequential-file). The name of the file is hard-coded. I use this container in several (upto 20) server-jobs. When I run the sequence with all these server-jobs running parallel at a certain moment the job fails with the following message:
'Inflow_DB_DBSTP_clean..AddErrorLog.ERROR_LOG.ERROR_LOG_OUT: DSD.SEQOpen Unable to create file C:\LPGP_D_CRISKM_PROJECT\ErrorLog.csv.'
I think this error is a result of a job trying to access the error-file when it is locked for update by another job (is it?). The only solution to solve this problem I can think of is to execute the jobs in sequence instead of in parallel.
Does anyone know a better solution for this problem?
Problem with accessing sequential file in a shared container
Moderators: chulett, rschirm, roy
Problem with accessing sequential file in a shared container
Kind regards,
Johannes Drost
Johannes Drost
Two or more processes cannot WRITE to a sequential file simultaneously. Consider using a parameter in the file name.
Kenneth Bland
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
-
- Premium Member
- Posts: 503
- Joined: Wed Jun 29, 2005 8:14 am
Why use a hash-file? Is it possible to read and write simultaneously from multiple jobs to a hash-file?DeepakCorning wrote:If you are simultaneously triggering two jobs with the shared container in it then it will give the same error as they can write to the seq file at the same time. Try using Hashed File.
Kind regards,
Johannes Drost
Johannes Drost
Hashed files can handle multiple processes reading/writing, as long as they are not accessing the same row. Avoid using the locking mechanisms as it is a bad technique.
Kenneth Bland
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
-
- Premium Member
- Posts: 503
- Joined: Wed Jun 29, 2005 8:14 am
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
A Hashed File is simply another mechanism for implementing a database table. So imagine that you're inserting new rows into a database table.
Create the hashed file with a UV stage but edit the DDL so that you get auto-generated key values.
Create the hashed file with a UV stage but edit the DDL so that you get auto-generated key values.
Code: Select all
CREATE TABLE ErrorTable (
SurrKey INTEGER NOT NULL DEFAULT NEXT AVAILABLE,
ErrCode VARCHAR(20) NOT NULL DEFAULT '',
ErrText VARCHAR(254) NOT NULL DEFAULT '',
JobName VARCHAR(254) NOT NULL DEFAULT '',
JobStartTimeStamp CHAR(19)
);
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.