MIDRANGE dot COM Mailing List Archive



Home » C400-L » May 2008

Re: File left open in QZRCSRVS job



fixed

I am using C for obvious reason. I know it. I also know half a dozen other languages (starting from Fortran, PL/I and Assembler), and RPG is not among them. I don't see much reason to study one more language just to slove this problem.

Actually I started already rewriting API-s to use user space and thje results are very very good.

I of course agree with Simon, when he says, that if adding a printf makes program work, there is a memory problem somewhere. But the same applies to debug mode. But this does not make me happy :-)

So I saw switching to user space as a possible solution - and it happened to be pretty straightforward and efficient...


-----Original Message-----
From:
c400-l-bounces+jevgeni.astanovski=sampopank.ee@xxxxxxxxxxxx
[mailto:c400-l-bounces+jevgeni.astanovski=sampopank.ee@midrang
e.com]On Behalf Of Ted Slate
Sent: Monday, May 12, 2008 3:29 PM
To: c400-l@xxxxxxxxxxxx
Subject: Re: [C400-L] File left open in QZRCSRVS job


Try sending scope message (QMHSNDSM) API. If your program
crashes you can perform cleanup routines. Also, check for
the record lock timeout values, so even if the program
crashes no one lock can keep others in a stalemate. Finally,
if that's the only reason you're using C for this, you might
consider RPG and SQL. I rarely use C for strict DB file
handling, it's not worth the trouble with SQL and RPG around.
I don't see where a file open is an issue unless it's an
exclusive lock. If the file is in QTEMP there's no reason to
hold an exclusive lock(if you are) which would solve the
re-entry problem.
However, I noticed you stated that a user space is an option.
Then you could use a stream file (flat file). Again, same
thing just don't open it exclusive and if the program bombs
you can re-create it repeatedly with no locks. It is
possible that the record handling code is causing storage
issues as suggested so maybe removing that code or moving it
to RPG may help.
But aside from all that, I would use queues for what you're
doing it's a much more elegant solution and very robust on
the i. It doesn't make sense to use files or user spaces for
message passing and IPC.
_________________________________________________________________
Stay in touch when you're away with Windows Live Messenger.
http://www.windowslive.com/messenger/overview.html?ocid=TXT_TA
GLM_WL_Refresh_messenger_052008
--
This is the C programming iSeries / AS400 (C400-L) mailing list
To post a message email: C400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/c400-l
or email: C400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/c400-l.






Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2014 by MIDRANGE dot COM and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available here. If you have questions about this, please contact